Skip to content

Instantly share code, notes, and snippets.

@lalizita
Created October 24, 2023 22:38
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lalizita/e88b9adef2c3c0ca18efc717d203b313 to your computer and use it in GitHub Desktop.
Save lalizita/e88b9adef2c3c0ca18efc717d203b313 to your computer and use it in GitHub Desktop.
ffmpeg scripts for video processing
# Cut/Trim video
ffmpeg -ss 5 -i input.mp4 -to 10 output.mp4
# Video to gif
ffmpeg -ss 61.0 -t 2.5 -i <input> -filter_complex "[0:v] fps=12,scale=w=480:h=-1,split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=new=1" output.gif
# thumbnail
ffmpeg -i mov_bbb.mp4 -ss 00:00:03 -r 1 -s 1280x720 -f image2 thumb_mov.jpeg
#text in video
ffmpeg -i input.mp4 -vf "drawtext=text='My text starting at 640x360':x=20:y=150:fontsize=24:fontcolor=white" -c:a copy text-video.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment