You can change the colour of the padding.įfmpeg -i input -c:v libvpx-vp9 -crf 30 -vf "scale=$:-1:-1:color=black" output. This will resize the video to fit in it's original version and then pad it. The following does this, where RW is the width, and RH is the height you want. This way, if you have a few 4:3 clips is a majority 16:9 video, all will be well. Is it possible to use ffmpeg to add blank / black height, while preserving the video and audio quality Tried doing this, which seemed to work (took about 2 hours, the same length of the video), but greatly reduced the file size/video quality): ffmpeg -i input.mkv -filter:v 'pad3840:2160:0:280' -c:a copy myoutputvideo. This is useful if you are going to concatenate videos for example to edit something together, and want the size/aspect ratio consistent. You could also crop in the video to match the specified resolution and aspect ratio.įinally, you can resize it like the first solution and add black bars to fill your desired resolution. On the other hand, you can force it to be the specified resolution, and stretch/compress the video. First, you could not set the width or height with -1, and this way, FFMPEG will scale it keeping the same aspect ratio (eg: -vf scale=1920:-1) and match the missing width/height for what it needs to be for that aspect ratio. Otherwise, it will just add 60 pixels to bottom. Leave the X offset at 0 & set Y offset to -30 so pixels are added at top & bottom. By default FFMPEG scales video to a given resolution but keeps the original aspect ratio, so you can end up with a 1920×1080 video that plays in 4:3. Add 60 black pixels back to the vertial dimension ( inh+60 ).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |