18
4
I have a video stream with the following properties:
Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x416 [SAR 1:1 DAR 45:26], 1908 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
When I run it in VLC, I have to press "A" to change aspect ratio to "4:3" to make the video show with the correct aspect ratio.
Looking at the video facts, Is the error that a) the actual video has been incorrectly stretched in the pixel data, or b) there is simply some metadata value that has been incorrectly set?
If the former, I know I can re-encode the video and change the width and height. But if the latter, what ffmpeg command to I run to fix the metadata without re-encoding the video itself?
Excellent! Changing the aspect worked straight away! – forthrin – 2015-04-30T18:04:53.890
1You can't use
-c copy
and scale at the same time; however you can use-aspect
to change the aspect ratio at the container level (but not the stream level). – llogan – 2015-04-30T18:56:20.390@LordNeckbeard, using
-aspect
does work for playback inffplay
, but not in WMP or MPC-HC. It adds an additional SAR/DAR item to theStream #…
info line inFFmpeg/probe/play
but doesn't seem to be solution for general playback. Stretching the video with the window seems like the easiest solution for MPC-HC playback. – Lumi – 2016-01-03T14:10:59.860didn't work for me for MPEG2 without reencoding – Mikhail V – 2016-07-01T11:33:25.020
I don't know why it didn't work for me. It just outputs the same video! – Tina J – 2016-07-22T01:02:08.707
As was stated above, you can't just copy the stream and expect it to work (everywhere), you're going to have to re-encode, e.g.:
ffmpeg -strict -2 -i [INPUT] -aspect 720:540 -strict -2 [OUTPUT]
. I added-strict -2
(note that's -2, not just 2) to get ffmpeg to stop complaining about the aac audio in the original. This re-encoded a square source into an output at 4:3. – Andrew Beals – 2017-05-20T10:47:32.657Unfortunately, did not work for AVI container 1280x720 [SAR 12:11 DAR 64:33]… – AnrDaemon – 2018-09-09T20:20:49.547