Skip to content

Instantly share code, notes, and snippets.

@danielvartan
Last active August 26, 2025 20:47
Show Gist options
  • Save danielvartan/80b5261572f0f4d4a660f830178695f2 to your computer and use it in GitHub Desktop.
Save danielvartan/80b5261572f0f4d4a660f830178695f2 to your computer and use it in GitHub Desktop.
FFMEG commands
# Source: https://stackoverflow.com/a/42827058/8258804
ffmpeg -ss 00:01:00 -to 00:02:00 -i input.mp4 -c copy output.mp4
ffmpeg -i input.webm -r 10 output.gif
# ffmpeg -i in.webm -r 10 -ss 00:00:01 -to 00:00:05 out.gif
# Source: https://stackoverflow.com/questions/9913032/how-can-i-extract-audio-from-video-with-ffmpeg
ffmpeg -i input.avi -vn -acodec copy output.aac
ffmpeg -i input.avi -q:a 0 -map a ouput.mp3
# Source: https://unix.stackexchange.com/questions/28803/how-can-i-reduce-a-videos-size-with-ffmpeg
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4
ffmpeg -i input.mp4 -vcodec libx265 -crf 50 output.mp4
# Source: https://superuser.com/a/268986/2033807
ffmpeg -i input.webm -c copy -an output.webm
# Source: https://stackoverflow.com/a/18148739/8258804
ffmpeg -i input.webm -c copy output.mp4
ffmpeg -fflags +genpts -i input.webm -r 24 output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment