Common and useful ffmpeg commands. Go back to Eruhinim.
FFmpeg commands
Basic video/audio format conversion ffmpeg -i input.webm output.mp4
You can put any video/audio file extension for the input and output. FFmpeg will do it's best to guess what to do. |
|
Extract audio from a video file ffmpeg -i input.webm -vn output.mp3 You can put any video/audio file extension for the input and output. FFmpeg will do it's best to guess what to do. |
|
Take a sample from a video url/local file ffmpeg -ss 00:00:10 -i https://sample-videos.com/video123/mp4/240/big_buck_bunny_240p_5mb.mp4 -t 00:00:20 -async 1 -strict -2 output.mp4 Where:
Really useful if you don't want to download an entire video, but just a sample. |
|
Screen grab of the current desktop area ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1366x768 -i :0.0 -threads 4 -y output.webm Where:
It will record the screen together with audio and produce a output.webm as a result. |
|
Webcam recording ffmpeg -f alsa -i /dev/audio -f video4linux2 -s 1280x720 -i /dev/video0 output.mp4 Where:
Records webcam with mic and outputs to a mp4 file. |
|
Change the resolution of a video file ffmpeg -i input.avi -s 320x240 -c:a copy output.mp4 Where:
|
|
Make a GIF from a video file $ ffmpeg -i video.mp4 -r 5 'frames/frame-%03d.jpg' $ convert -delay 20 -loop 0 frames/*.jpg myimage.gif Where:
|