====== 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.mkv''((https://leetschau.github.io/edit-video-files-on-ubuntu.html)) * ''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.