Animate drawtext and drawbox with the sendcmd filter
ffmpeg -y -i input.mp4 -vf 'sendcmd=f=sendcmd.txt,drawbox,drawtext' output.mp4Create a live video echo effect with the lagfun filter
# linux
ffplay -i /dev/video0 -vf 'lagfun=decay=0.98[tmp]; [tmp] hue=180*sin(t)'
# macos
ffplay -f avfoundation -i 0 -framerate 30 -vf 'lagfun=decay=0.98[tmp]; [tmp] hue=180*sin(t)'Remove background noise from audio using the arnndn filter
ffmpeg -i input.mp4 -af 'arnndn=model=./arnndn-models/std.rnnn:mix=0.8' -c:a aac -b:a 320k -c:v copy output.mp4Analyze video frames, timecode and metadata with showinfo filter
ffmpeg -i input.mp4 -vf showinfo -f null -Apply a retro film effect with sepia and grain overlays "Retro Video Filter" using video masking, sepia tones and advanced overlaying technics
# take input.mp4, square.png mask file and '9v9VVN1RE84.mp4' grit/film distortion video and overlay it on the frame
ffmpeg -y -f rawvideo -pix_fmt rgb32 -s 1920x1080 -i /dev/zero -r 30 -filter_complex "movie='square.png'[sqr];[0:][sqr]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2[canvas];[canvas]chromakey=0x008000:blend=0:similarity=0.15[canvas2];[0:][canvas2]overlay[canvas3];movie='input.mp4',scale=1920:1080[i1];[0:][i1]overlay='if(gt(random(0), 0.2), 1, 4)':'if(gt(random(0), 0.1), 1, 2)',colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131[i2];[i2][canvas3]overlay[mix1];movie='9v9VVN1RE84.mp4',scale=1920:1080[grit_i1];[grit_i1]chromakey=0x16FF0A:blend=0.2:similarity=0.3,colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3[grit1];[0:][mix1]overlay[o1];[o1][grit1]overlay[o]" -map "[o]" -c:v libx264 -crf 31 -frames:v 300 output.mp4Stitch two video files side by side
ffmpeg -y -i yoga.mp4 -i sharks.mp4 -filter_complex "[0:v]pad=iw+iw:ih[v1];[v1][1:v]overlay=overlay_w:0[vid]" -an -map "[vid]" -c:v libx264 -crf 23 -preset veryfast output.mp4Simulate handheld camera shake with the crop filter
ffmpeg -f lavfi -i testsrc=duration=30:size=1280x720:rate=30 -vf 'crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*1.25):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*1.625)' -c:v libx264 -q:v 1 output.mp4All Examples
-
Count the total number of frames in a video — useful for verifying a transcode, scripting QA checks, or confirming a clip’s length in frames.
-
Convert a 60fps video to 30fps (or any frame rate) - handy for smaller files, matching an editor’s timeline, or taming high-frame-rate phone footage.tags: #frame-rate #fps
-
Downscale a video to 720p width without stretching or squashing it — handy before uploading to size- or resolution-limited platforms.
-
Download a DRM-free HLS (HTTP Live Streaming) playlist and save it as a single MP4 file - handy for archiving a stream you have permission to keep.tags: #hls #m3u8 #stream-download
-
Render subtitles permanently into the video pixels, so the text shows on any player - phones, TVs, social apps - with no subtitle-track support required.
-
Strip the audio track out of a video file in seconds - useful for silent b-roll, removing an unwanted soundtrack, or prepping footage for a new voiceover.tags: #remove-audio #stream-copy
-
This ffprobe command extracts the presentation timestamp (PTS) and size of every video packet from input.mp4, saving it to a CSV file.
-
Scale PNG images with transparent backgrounds while maintaining aspect ratio and alpha channel integrity for web graphics and design workflows.
-
FFmpeg’s ARNN (Audio Recurrent Neural Network) noise reduction filter is a powerful tool for improving audio quality in videos.
-
The following command generates a 10-second video (600 frames at 60 FPS) using an image (image.png) as the foreground and a black background while applying zoom and panning effects.tags: #zoompan
-
The following command will apply the builtin XFade video transition filter to two example input videos yoga.mp4 and sharks.mp4 Filter Options transition: Set one of available transition effects.tags: #transitions #filter #xfade
-
This ffmpeg “recipe” works by taking a video input, and mapping the first audio track to an output, you can define the output format using the -f option and a format value i.e: -f mp3.
-
The following command will be a video that plays at half speed with audio that’s both slowed down and pitched down by an octave.tags: #timestrech #rubberband #speed
-
This FFmpeg command converts an image and audio into a WebM video.tags: #encoding #image+audio=video
-
Apply EBU R128 loudness normalization to achieve broadcast-compliant audio levels.
-
global_quality parameter ranges from 1 (almost lossless) to 50 (very lossy).tags: #acceleration
-
Transform any video into a Telegram-compatible video sticker with automatic resizing and optimization.tags: #telegram #webm #vp9 #compression
-
The VP9 codec supports videos with an alpha channel, but simply overlaying them does not perform alpha blending.tags: #overlay
-
Kids bored on a rainy day, put this on and watch them play.
-
-i input file -c:a copy copy the audio stream as-is -c:v copy copy the video stream as-is -write_tmcd 0 do not write timecode to the output filetags: #metadata
-
Combine separate video-only and audio-only file parts (e.g. from a download manager) into a single MP4.
-
Recode your video using the modern libx265 video codec and copy the audio stream as is.
-
Transform OGG audio files to iPod-compatible M4A format while preserving metadata and ensuring full compatibility.
-
This example shows how to take a couple of images and turn them into a slowly changing animated WebP.
-
For WebP specific options and more information, see the relevant WebP documentation in the ffmpeg-codecs page.
-
This command combines two MP3 files, keeping their original audio streams from audio.mp3 (no re-encoding), and copies metadata from metadata.mp3 to output.mp3.
-
Create multiple video segments from one source file using FFmpeg’s efficient single-pass processing.tags: #timestamps #h264 #video-editing
-
The -encoders flag will print a list of supported audio/video and generally data generating encoders.
-
The following FFmpeg command extracts and displays detailed information about each frame in a video file.
-
The sendcmd filter in FFmpeg allows dynamic updates to video filters (e.g., drawtext and drawbox) at specific time intervals during playback or processing.
-
When extracting individual frames, FFmpeg is typically designed to extract full frames.tags: #video-extract
-
In this specific example, we read an RTSP stream from a server.
-
The following command will cut an audio clip in the middle based on the start and end samples of the input wav file.tags: #mp3
-
The following will take a given input video (e.g. bunny.mp4) and by using the select filter, will only let frames at a specific time (or any valid Expression) pass through.
-
Given a set of 9 images (e.g. for example), generate a video that loops at 12 fps for 3 seconds.
-
The following example is based on the crop filter Examples section.
-
The following command will take an input.mp4 file and ‘copy’ it over the RTMP protocol.
-
This is a very complex command with multiple steps.
-
This FFmpeg command uses the color filter source to generate an empty black frame.tags: #generator #filter #subtitles
-
If you try to transcode footage from Canon EOS 5D Mark II, you will find that ffmpeg, left to its defaults, will produce image that is slightly color shifted and also darker, drowning the blacks.tags: #canon5d
-
Given any input, copy the audio stream to a new mp4 filetags: #no-video #audio-extract
-
changing the Display Aspect Ratio from a video from 4:3 to 16:9tags: #aspectratio #video
-
Source: The wonderful ffmprovisr This will convert your WAV files to MP3s.tags: #mp3
-
Generate professional SMPTE color bars test pattern with custom text overlay for video calibration and testing purposes.
-
Source: Reddit This is a great example in demonstrating the versatility of using ‘inputs’, ‘outputs’ and ‘formats’ with ffmpeg.tags: #subtitles #meme #stdout
-
The following command will take any input video, in our case bunny.webm, snap a frame every 30 frames (using the filter select='not(mod(n\,30))'), scale it to 160x120 (using the filter scale=160:120)…tags: #filter #extract-thumbnails
-
Use ffprobe, grep and cut to list metadata of video.mp4 and ‘grep’ the duration value of the video.tags: #ffprobe
-
When writing a simulation or similar application, you may sometimes want to record a video of something, with your program generating individual frames and ffmpeg assembling them into a whole.tags: #video-extract #stdin #pipe
-
Stitch yoga.mp4 and sharks.mp4 side-by-side and output to output.mp4 The following example assumes the two videos are of the same width.
-
The following uses a video source generator and the color filter to generate a solid color video.
-
Assuming video.mp4 has an audio stream encoded with AAC, the following command will stream-copy that stream to audio.aac.tags: #audio-extract #no-video
-
The following will generate folder/image000.jpg, …, folder/image999.jpg jpg files for every frame of the the input video video.mp4 This is a useful method to extract a frame for a thumbnail or for fr…
-
By calling ffmpeg on a media file such as audio, video, or image without an output file - ffmpeg will list the different tracks on the media container, their encoding, and other relevant metadata.tags: #metadata
-
The testsrc filter generates a test video pattern showing a color pattern, a scrolling gradient, and a timestamp.
-
Conway’s Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.tags: #video-source #lavfi
-
Takes an input video file and ‘scale’ every video frame to a fixed size of 640x360 pixels.tags: #filter