A Couple of Useful Commands for FFmpeg
Here is a collection of various useful commands for FFmpeg that perhaps some day may come in handy for you. It also shows a tiny bit of the endless possibilities that FFmpeg has.
Extract frames as images from a video
ffmpeg -i video.mp4 filename%04d.jpgMake video from a set of images
ffmpeg -framerate 25 -i ./filename%4d.png video.mp4Extract xx seconds clip from a long video
ffmpeg -ss 00:00:55 -i video.mp4 -t 00:00:10 -vcodec copy -acodec copy videoclip.mp4Extract and save audio from a video file
ffmpeg -i video.mp4 -vn -acodec copy audio.aacAdd audio to a video
ffmpeg -y -i video.mp4 -i audio.aac -c copy -map 0:v:0 -map 1:a:0 video-with-audio.mp4Join two video side by side
- for horizontal stacking of the videos
ffmpeg -i video1.mp4 -i video2.mp4 -filter_complex hstack -c:v ffv1 output.mp4- for vertical stacking of the videos
ffmpeg -i ./sample-1.mp4 -i ./sample-out-image1.mp4 -filter_complex vstack -c:v ffv1 output.mp4Convert all audio Opus files in one folder in to Wav
for %f in (*.opus) do ffmpeg -i "%f" "%~nf.wav"Convert m4a to wav (20Kh Mono 16 bit)
ffmpeg -i input.m4a -ac 1 -ar 22050 -sample_fmt s16 output.wavConvert mp4 to gif
ffmpeg -i INPUT.mp4 -vf "fps=25,scale=iw:ih:flags=lanczos,palettegen" palette.png
ffmpeg -i INPUT.mp4 -i palette.png -filter_complex "fps=25,scale=iw:ih:flags=lanczos[x];[x][1:v]paletteuse" output.gif

Recent Comments