- cut video
- get first frame from video
- change gamma of the file
- drop the sound
- change frame rate
- generate video from images at given fps
- see total frames
- see frame rate
- generate gif from images with ImageMagick
Here are some useful code I used to process videos in the terminal with ffmpeg.
I find memorising those command being simply impossible.
Here are some handy cli scripts I use to cut videos.
cut video
ffmpeg -i video.mp4 -ss 00:00:10 -t 00:00:20 -async 1 out.mp4
-ssstarting time-tduration
get first frame from video
ffmpeg -i video.mp4 -vframes 1 image.png
change gamma of the file
ffmpeg -i input -vf eq=gamma=1.5:saturation=1.3 -c:a copy out
drop the sound
ffmpeg -i file_2 -an file_2
change frame rate
ffmpeg -i <input> -filter:v fps=fps=30 <output>
generate video from images at given fps
ffmpeg -framerate 15 -i image_%04d.png -c:v libx264 -r 15 -pix_fmt yuv420p out.mp4
see total frames
ffprobe -v error \
-select_streams v:0 \
-show_entries stream=nb_frames -of \
default=nokey=1:noprint_wrappers=1 \
video_name
see frame rate
ffprobe -v 0 -of csv=p=0 -select_streams 0 -show_entries stream=r_frame_rate
generate gif from images with ImageMagick
convert -loop 0 -delay 10 *.png image.gif
convert -loop 0 -delay 10 -density 150 -quality 100 *.pdf image.gif