Project

General

Profile

Scale (resize) recordings with multiple aspect ratios (16:9 during commercials, 4:3 during movie)

Added by Tomas Matejicek over 12 years ago

I have a MKV files (DVB-T recording generated by TVHeadend).
These mkv contain all recorded channel data including commercials.

I would like to re-scale my recordings to be 2x smaller in size (width/height). However I'm unable to do that correctly (tried ffmpeg and mencoder).

The aspect ratio of video image is changing even during playback, since the video is 4:3 for some time, then it switches to 16:9 during commercials, and then again back to 4:3; later it may switch to 16:9 again, all within the one single MKV file.

If I use ffmpeg or mencoder to scale down the video, it makes it indeed smaller, but remembers the aspect ratio used at the beginning of the video and it forces the same aspect during the whole video stream, ignoring the fact that the stream's aspect changes from time to time. So If my recordings start with commercials which are 16:9, and then the programme goes 4:3 (The Simpsons old series, for example), my rescalled video is always 16:9 for the entire duration, which is bad.

Is there any way to rescale the video (for example to a fixed width, variable height) while automatically adjusting the height so that the aspect ratio is always preserved like in the original?

Thank you


Replies (4)

RE: Scale (resize) recordings with multiple aspect ratios (16:9 during commercials, 4:3 during movie) - Added by Tomas Matejicek over 12 years ago

After some further investigation, it seems that the original video stream is always broadcasted in constant width/height, but it contains some information about the size of a pixel. It has something to do with PAR and DAR (pixel aspect ratio and display aspect ratio). If the video is transcoded, it somehow losts the information which frame has which PAR/DAR, thus the player simply keeps just the first one.

I didn't find yet a way how to scale the video with preserving the information about PAR/DAR changes during playback.
I hope somebody clever here could bring some idea.

RE: Scale (resize) recordings with multiple aspect ratios (16:9 during commercials, 4:3 during movie) - Added by Hein Rigolo over 12 years ago

try to locate the points where the change takes place and then cut the mkv right at that point.
Then you should be able to resize each seperate part ..and then stick them back together again?

or even better ... leave out the commercials ;-)

Hein

RE: Scale (resize) recordings with multiple aspect ratios (16:9 during commercials, 4:3 during movie) - Added by Tomas Matejicek over 12 years ago

That would involve too much manual work.
I need to convert 10TB of recordings ... :)

RE: Scale (resize) recordings with multiple aspect ratios (16:9 during commercials, 4:3 during movie) - Added by Tomas Matejicek over 12 years ago

Here are some final remarks:
After very long research I found that ffmpeg can scale the video while correctly handling the aspect ratio changes, if you output the video to .mpg file. That means, it has only some troubles putting the video stream to matroska MKV like the original.

So basically my problem is gone as long as I accept the output video to be just the mpeg, without the matroska container.

    (1-4/4)