ffmpeg resizing video puts it at wrong resolution

2019-05-30 04:34发布

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?

标签: macos ffmpeg
3条回答
闹够了就滚
2楼-- · 2019-05-30 04:46

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).

查看更多
冷血范
3楼-- · 2019-05-30 05:08

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
查看更多
成全新的幸福
4楼-- · 2019-05-30 05:11

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

查看更多
登录 后发表回答