Skip to main content

ffmpeg Notes

Last Updated: August 24, 2021

Transform video down to 1080p and add black bars if needed

ffmpeg -i 'input.mp4' \
-vf scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:-1:-1:color=black \
-crf 20 -preset slow 'output.mp4'

Trim video

ffmpeg -ss 01:21:24 -i input.mp4 -t 7 -c copy output.mp4

Combine video and audio

 ffmpeg -i input.mp4 -i input.flac -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 output.mp4