I 've tried some command line given in some thread about changing aspect ration of MP4 using ffmpeg.
Too bad that all of them is through re encoding process.
Do anyone know what line used to change aspect ration of MP4 video without re encode using ffmpeg?
Thanks in advanced
+ Reply to Thread
Results 1 to 9 of 9
-i input.mp4 -vcodec copy -acodec copy -aspect x:y output.mp4
Not all players will obey aspect ratio flags.
It's ok , as long as it worked for you
1) ffmpeg's -aspect x:y is really affecting the DAR (display aspect ratio) at the container level, mp4box writes data as PAR (pixel aspect ratio), also known as SAR (sample aspect ratio) at the bitstream level in the header as a VUI parameter. So you demux it, changes are gone with ffmpeg, but stay with mp4box. Out of the players that accept either, more players tend to accept stream level changes than container level changes (more reliable) . Also , there is more control with PAR values, you can distinguish between ITU vs. non ITU aspect ratios more easily (The short version is basically there are cases where you need to acknowledge different ways of AR interpretation)
2) ffmpeg's MP4 muxer seems less reliable , at least in the past. Sometimes muxes did not play correctly on some devices, yet the same mux with mp4box, or l-smash works fine. This has to do with MP4 muxes in general, not necessarily AR changing only
There's a muxing-only build of ffmpeg here that'll modify info such as aspect ratio in the video bitstream.
One advantage off the top of my head (I've not used it in a fair while) is it'll mux from one container to another.
I read through a bit of the thread a linked to and it appears the ffmpeg build can still accept "-aspect x:y" or "-aspect X" in the commandline to change the container aspect ratio along with a SAR to change the bitstram aspect ratio. If so, it's a pity both aspect ratios can't be expressed the same way, but it appears it probably can change both the container and bitstream aspect ratios at the same time. Maybe I missed that the first time I used it, as to fix problem aspect ratios in the past I've remuxed with the ffmpeg build I linked to while changing the SAR in the bitstream, then I've remuxed them again with MKVMergeGUI to set the container aspect ratio. When both aspect ratios are the same, at least there won't be conflicts.
Last edited by hello_hello; 9th Jul 2015 at 04:23.
I have been using ffmpeg to change change the aspect ratio of video files (actually .avi to mp4) on a Ubuntu & a Gumstix COM. This tested OK with snippets, but we have become aware that for larger files (~100MB, which is not that large for a video) the process seems not to work. A file gets copied with the new file extension and no errors are reported but the file won't open in MP4Explorer (which I use to examine the track header box values) and plays with the wrong aspect ratio in (e.g.) VLC.
How could it work for small files but not for larger ones?