

-ar defines the frequency (here it's 44100).the second -map defines where to start the audio in the audio fileĮncode audio file to mp3 ffmpeg -i input.opus -ar 44100 -ac 2 -b:a 128k output.mp3.the first -map defines where to start the audio in the video file.the -c copy avoid re-encoding the streams.Use -c copy to avoid re-enconding the videos (they need to have the same base codec)Īdd audio to video ffmpeg -i input.mp4 -i input.mp3 -c copy -map 0:v:0 -map 1:a:0 output.mp4.use -crf to define quality (lesser is better)Ĭoncatenate videos ffmpeg -f concat -i input.txt -c copy output.mp4Ĭreate a text file with the files you want to concatenate into a single video or audio file.to avoid re-enconding the video, use stream copy via -c, define the video with v and the codec ( libx264 in the example).use ss to select the starting and ending time.Cut a part of a video : ffmpeg -i input.mp4 -ss 00:00 -to 00:10 -c:v libx264 -crf 30 output.mp4 For more commands check the ffmpeg documentation page.

ffmpeg is super powerful and can sometimes be enough for quick media manipulations. This page contains ffmpeg commands that I find useful. Editorial New + Inter Open Dyslexic Atkinson Hyper Legible
