ffmpeg resizing video puts it at wrong resolution

2019-05-30 04:28发布

问题:

I have a 1080p video that i'm trying to resize for an iOS app upload. So i tried scaling it to the iPhone 6 resolution of 1334x750:

ffmpeg -i WrathTrailer.mp4 -strict -2 -vf scale=1334:750 WrathTrailer1334x750.mp4

The output file comes to 1333x750. iTunes connect won't accept it. Any ideas?

回答1:

Here's a way to do it without the black padding. Note the force to aspect 1.779:

ffmpeg -i input.mp4 -strict -2 -vf scale=1334x750 -aspect 1.779 output.mp4


回答2:

Not entirely what i wanted to achieve, but managed to do it by adding black padding:

ffmpeg -i WrathTrailer.mp4 -strict -2 -filter:v "scale=iw*min($width/iw\,$height/ih):ih*min($width/iw\,$height/ih), pad=$width:$height:($width-iw*min($width/iw\,$height/ih))/2:($height-ih*min($width/iw\,$height/ih))/2" WrathTrailer1334x750.mp4

Command sourced from: https://superuser.com/questions/547296/resizing-videos-with-ffmpeg-avconv-to-fit-into-static-sized-player



回答3:

I used the command:

ffmpeg -i iPhonePreview.mp4 -strict -2 -vf scale=750:1334 -aspect 0.56271889 iPhone4.7.mp4

The real aspect is 0.56221889. Experimentally, I find correct aspect: 0.56271889 (changed 2 to 7).



标签: macos ffmpeg