Created
October 17, 2014 09:22
-
-
Save sponomarev/6a2c85da27b911421cd8 to your computer and use it in GitHub Desktop.
convert any source video to fixed size flv with coloured letterboxes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# params: $input, $output, $width, $height, $color | |
# for landscape (normal) orientation | |
ffmpeg -y -i $input -vcodec flv1 -vf "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:color=$color" -vb 4000k -acodec mp3 -ar 44100 -ab 320k -vsync 1 -async 1 $output | |
# for portrait orientation | |
ffmpeg -y -i $input -vcodec flv1 -vf "transpose=1, 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:color=$color" -vb 4000k -acodec mp3 -ar 44100 -ab 320k -vsync 1 -async 1 $output | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment