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 re-encoding video
ffmpeg -i in.mp4 -c:v copy -an out.mp4ffmpeg -i input-video.avi -vn -c:a 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 -ss 00:01:00 -i input.mp4 -t 00:01:00 -c copy output.mp4With re-encoding, slower but more frame accurate:
ffmpeg -ss 00:00:03 -i input.mp4 -t 00:00:08 -async 1 output.mp4Options explained:
-ssfor seeking to starting timehh:mm:ss.-tfor the duration ofhh:mm:ss, or-tofor the end timehh:mm:ss.
Last updated on