Differences
This shows you the differences between two versions of the page.
| |
tech:software:programs:cli:ffmpeg [2022/11/07 17:44] – created alephalpha0 | tech:software:programs:cli:ffmpeg [2022/11/08 03:03] (current) – alephalpha0 |
---|
===== ffmpeg cli snippets===== | ===== ffmpeg cli snippets===== |
| |
Cutting Videos((https://leetschau.github.io/edit-video-files-on-ubuntu.html)) : \\ | ==== Cutting Videos ==== |
* ''ffmpeg -ss 00:00:15 -i input.mkv -to 00:01:00 -c copy output.mkv'' | * ''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'' | * ''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. | ''-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. |