ffmpeg
Setup ffmpeg. See also Arch Wiki: ffmpeg
Install
Ubuntu
sudo apt install ffmpegWindows
choco install ffmpegOr
winget install Gyan.FFmpegUsage
Simple stream copy
To rebuild “99.9% complete” videos without re-encoding.
ffmpeg -i input.mkv -c copy -o output.mkvRemove audio without reencoding video
ffmpeg -i in.mp4 -vcodec copy -an out.mp4ffmpeg -i input-video.avi -vn -acodec copy output-audio.aacOptions explained:
-vn: no video output.-an: no audio output.-{a,v}codec copy: copy without re-encoding.
Cutting videos
Without re-encoding, just simple copying as-is:
ffmpeg -i input.mp4 -ss 00:01:00 -to 00:02:00 -c copy output.mp4With re-encoding, slower but more frame accurate:
ffmpeg -i input.mp4 -ss 00:00:03 -t 00:00:08 -async 1 output.mp4Options explained:
-ssfor starting timehh::mm::ss-tfor duration ofhh::mm::ss, or-tofor end timehh::mm::ss
Last updated on