FFMPEG

https://ffmpeg.org

A complete, cross-platform solution to record, convert and stream audio and video.

ffmpeg cli snippets

Cutting Videos

  • ffmpeg -ss 00:00:15 -i input.mkv -to 00:01:00 -c copy output.mkv1)
  • ffmpeg -i input.mp4 -to 00:00:46 output.mp4

-ss is starting time, -to is duration of cut, -c is codec and copy is input's codec copied to output's.

Making GIFs

  • `ffmpeg -ss mm:ss -t mm:ss -i input.mp4 -vf “fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse” -loop 0 output.gif`

-s mm:ss time from beginning to start the gif, running for -t mm:ss lengh of time, from -i input.mp4. -vf “…” sets the filters: fps, gif resolution width @ 320 and maintain aspect ratio; sets flags for use of lanczos scaling algo, split flag makes it possible to do this in one command. -loop -1/0/.. sets GIF looping to No Loop, Infinite Loop, or counted loop respectively. Output is the gif you made.

tech/software/programs/cli/ffmpeg.txt · Last modified: 2022/11/08 03:03 by alephalpha0
CC Attribution-Share Alike 4.0 International Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International