Article Directory
As a personal note, I keep recording common commands of ffmpeg, and I will update them when I use them.
convert mp4 to gif
basic command
ffmpeg -i .\robotmove.mp4 -r 15 output.gif
will robotmove.mp4
translate to output.gif
15 frames per second.
Capture the specified segment and convert it to gif
ffmpeg -t 3 -ss 00:00:02 -i small.mp4 small-clip.gif
The above command starts from the second second in the video, and converts the clip with a duration of 3 seconds into a gif
Adjust resolution
ffmpeg -i small.mp4 -b 2048k small.gif
ffmpeg converts medium-quality gifs by default. If you want to convert high-quality gifs, you can modify the bit rate.
Basic operation of MP4
video cut
ffmpeg -ss 00:00:00 -t 00:00:30 -i test.mp4 -vcodec copy -acodec copy output.mp4
Cut from 0 seconds to 30 seconds, the input file is test.mp4, the output file is output.mp4