Skip to content

ffmpeg

Trim video and copy codec.

Cutting multimedia files based on start and end time using ffmpeg

bash
ffmpeg -ss 00:01:00 -to 00:02:00 -i 'input.mp4' -c copy 'output.mp4'
CommandExplanation
-iThis specifies the input file. In that case, it is (input.mp4).
-ssUsed with -i, this seeks in the input file (input.mp4) to position.
00:01:00This is the time your trimmed video will start with.
-toThis specifies duration from start (00:01:00) to end (00:02:00).
00:02:00This is the time your trimmed video will end with.
-c copyThis is an option to trim via stream copy. (NB: Very fast)

The timing format is hh:mm:ss.

Merging video and audio files

bash
sudo ffmpeg -i input.mp4 -i input.webm -strict -2 -c copy -map 0:v:0 -map 1:a:0 output.mp4

Audio boost

FFMPEG how to increase the volume of copied audio?

Is it possible to change volume with no reencode with ffmpeg?

Increase/Decrease audio volume using FFmpeg

how to change volume of audio at specific time in audio and add that audio to video(with audio) using ffmpeg command?

Music video to mp3

bash
ffmpeg -i "島人ぬ宝 [KkSamPEizGw].webm" -i "mpv-shot0002.jpg" -map 0:a -map 1 -c:a libmp3lame -b:a 192k -id3v2_version 3 -metadata title="島人ぬ宝" -metadata artist="Hina, Kana" -metadata album="「沖縄で好きになった子が方言すぎてツラすぎる」エンディングテーマ「島人ぬ宝」" -metadata year="2025" "島人ぬ宝 [KkSamPEizGw].mp3"

ffmpeg -i "あなたに [47J62jiclBw].webm" -i "mpv-shot0001.jpg" -map 0:a -map 1 -c:a libmp3lame -b:a 192k -id3v2_version 3 -metadata title="あなたに" -metadata artist="Hina, Kana" -metadata album="「沖縄で好きになった子が方言すぎてツラすぎる」エンディングテーマ「あなたに」" -metadata year="2025" "あなたに [47J62jiclBw].mp3"

ffmpeg -i "Best Friend [dUzYDB3kYZo].webm" -i "mpv-shot0003.jpg" -map 0:a -map 1 -c:a libmp3lame -b:a 192k -id3v2_version 3 -metadata title="Best Friend" -metadata artist="Hina, Kana" -metadata album="「沖縄で好きになった子が方言すぎてツラすぎる」エンディングテーマ「Best Friend」" -metadata year="2025" "Best Friend [dUzYDB3kYZo].mp3"

Credit @Wayne19980