Ffmpeg Commands

Jan. 24, 2023

I’m saving these commands to have an easy way to find them if I need them in the future. For a little context, when I have helped my son with his homework, sometimes I have needed to increase the volume because my cell records them with very low volume (I haven’t found a fix for that), and sometimes I need a fragment of other videos and then to concatenate them. And also, when I started using other more sophisticated video editing tools (like Flowblade), I needed constant framerate videos, which my cell doesn’t do (for some reason).

So here they are:

# increase audio volume
ffmpeg -i input.mp4 -af volume=100 -vcodec copy output.mp4

# copy a fragment of the input video
ffmpeg -i input.mp4 -ss 00:02:01.100 -to 00:02:04:900 -c copy output.mp4

# concatenate 2 videos
ffmpeg -i input1.mkv -i input2.mkv -filter_complex "[0:v] [0:a] ][1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" \
       -map "[v]" -map "[a]" output.mkv

# reencode to fixed framerate
ffmpeg -i input.mkv -vsync 1 -crf 19 -r 30 -c:v libx264 -preset ultrafast -c:a copy output.mkv

# whitelist protocols to be able to download files from a playlist
ffmpeg -protocol_whitelist "file,crypto,data,https,http,tls,tcp" -i input_playlist.m3u8 -c copy output.mp4