Correcting aspect ratio during transcoding

About encoding, codec settings, muxers and filter usage
PureVirtual
Blank Cone
Blank Cone
Posts: 14
Joined: 26 Apr 2008 01:51

Correcting aspect ratio during transcoding

Postby PureVirtual » 12 Dec 2008 22:19

Please help me understand how to correct the aspect ratio (AR) when transcoding. My situation is the following.

Input file (in.avi) has resolution 720x480, black margins at both sides (left and right) and 16:9 AR (which seams to be correct). Some experimenting has shown that the picture gets normal if it's cropped 90 pixels from both sides (becoming 540x480) and then stretched a little to the 4:3 AR (640x480). To do this while transcoding I use the following command line:

Code: Select all

vlc -vvv in.avi vlc://quit --sout #transcode{ cropleft=90, cropright=90, width=640, height=480, vcodec=h264, vb=4096, acodec=mp3, ab=320 }:std{ access=file, mux=mp4, dst=out.mp4 }
The resulting file (out.mp4) looks fine, but it somehow holds the wrong AR *tagged within*. The MediaInfo utility shows: “Display aspect ratio: 1.125” (as if it was still 540x480), and not the desired 1.333 (4:3). So when this files gets transcoded for streaming (becoming 320x240) the black margins “magically” reappear (that naturally doesn't happen with the other files being transcoded the same way). I tried to experiment with “aspect” and “canvas-aspect”, but with no results.

If anyone has any ideas how to set the “tagged” AR to be the same as the physical “pixels” AR (640:480 = 4:3) please be so kind to tell me.

Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 13 guests