[MPlayer-users] Transcoding from one aspect ratio to another
Rolf Ernst
rolf.ernst at silverlightning.org
Wed Nov 3 19:11:02 CET 2010
On 11/3/2010 12:59 PM, Krzysztof Duchnowski wrote:
> On 03.11.2010 17:55, JD wrote:
>
>>>> I have a video file that has an aspect ratio of
>>>> 2.353 : 1
>>>> I would like to transcode it to an aspect ratio
>>>> of 1.6 : 1 (like 1280x800).
>>>> Is this even possible?
>>>>
>>> I assume you do not want to skew the picture, just change the
>>> resolution? If so, just -vf scale= will do that for you and figure out
>>> the proper aspect ratio itself.
>>>
>> Yes - you assume correctly. Thank you Rolf. I will try it.
> First of all, dscale is better - you give max resolution and it is
> rescaled properly, but virtually. After that you mut scale it with scale
> but no guessing of resolution.
> I had that problem with script that need to scale DAR(1.33:1)/SAR(1:1),
> DAR(1.77:1)/SAR(1:1) and DAR(1.33:1)/SAR(1:1.33) (anamorphic, displayed
> DAR=1.77) videos to 1.77:1 screen (MP4 for Android phone) without hand
> made optimization every time - example for you:
>
> -vf-add dscale=1280:800:0,scale=0:0,expand=1280:800
>
> This is for maitaining SAR. If you don't want to use bitrate for
> encoding black border then it is enough to expand to power of 16:
>
> -vf-add dscale=1280:800:0,scale=0:0,expand=::::::16
>
> If you change DAR of video wihtout maitaining SAR then it will squeze it
> verticaly or horizontaly (depend of source material).
>
> So, when changing DAR 2.352:1 video (1920x816) to DAR 1.6:1 video
> (1280x800) you must either crop it or expand with black borders to
> maintain SAR/PAR (pixel aspect ratio - square pixel, no squeze).
>>> First of all, dscale is better
A simple scale is fine. If you start out with 1920:1080 and then scale
to say 720:480 you get maximum resolution, aspect ratio is maintained,
you actually *get* 720x480 pixels. If you play it back you get an
identical picture. If the initial video started out with black borders
you might want to crop those first and then scale which gives you
absolutely the best resolution, namely packing the full information into
a full 720*480 pixels without having to muck with extending it. You only
have to extend it if you have a player that somehow limits the
interpretation of the aspect ratio. If you started out with 1920:480 and
rescaled and played it back on a 1280:800 display device, the player
itself will properly add the black borders upon playback, that is any
reasonably intelligent player. You can freely convert back and forth
between square pixels and anamorphic formats - mencoder will take care
of correcting the aspect ratio for you automatically.
Only if you have a player that *must* have square pixels do you have to
extend and add black borders (which is generally undesirable).
--
/re
"My friends, watch out for the little fellow with an idea"
Tommy Douglass
More information about the MPlayer-users
mailing list