Version 5 (modified by rogerdpack, 5 years ago) (diff)

add list of normals

FFmpeg Filtering Guide

FFmpeg has access to many filters and more are added on a regular basis. To see what filters are available with your build see ffmpeg -filters. Refer to the libavfilter documentation for more information and examples. This wiki page is for user contributed examples and tips. Contributions to this page are encouraged.



Starting with something simple. Resize a 640x480 input to a 320x240 output.

ffmpeg -i input -vf scale=iw/2:-1 output

iw is input width. In this example the input width is 640. 640/2 = 320. The -1 tells the scale filter to preserve the aspect ratio of the output, so in this example the scale filter will choose a value of 240. See the libavfilter documentation for additional information.

Speed up your video

Increase the speed of a 20 minute video to fit 1 minute output. 1 minute / 20 minutes = 0.05.

ffmpeg -i input -vf setpts=0.05*PTS output

Note that this method will drop frames to achieve your desired speed.

Please show a complete command if you would like to add more examples.

Here is a list of some other filters created by users:

Here is a list of the filters bundled with libavfilter as of 2.43.2

anull            Pass the source unchanged to the output.
aresample        Resample audio data.
ashowinfo        Show textual information for each audio frame.
amovie           Read audio from a movie source.
anullsrc         Null audio source, return empty audio frames.
abuffersink      Buffer audio frames, and make them available to the end of the filter graph.
anullsink        Do absolutely nothing with the input audio.
blackframe       Detect frames that are (almost) black.
boxblur          Blur the input.
copy             Copy the input video unchanged to the output.
crop             Crop the input video to width:height:x:y.
cropdetect       Auto-detect crop size.
delogo           Remove logo from input video.
drawbox          Draw a colored box on the input video.
drawtext         Draw text on top of video frames using libfreetype library.
fade             Fade in/out input video
fieldorder       Set the field order.
fifo             Buffer input images and send them when they are requested.
format           Convert the input video to one of the specified pixel formats.
gradfun          Debands video quickly using gradients.
hflip            Horizontally flip the input video.
hqdn3d           Apply a High Quality 3D Denoiser.
lut              Compute and apply a lookup table to the RGB/YUV input video.
lutrgb           Compute and apply a lookup table to the RGB input video.
lutyuv           Compute and apply a lookup table to the YUV input video.
mp               libmpcodecs wrapper.
negate           Negate input video.
noformat         Force libavfilter not to use any of the specified pixel formats for the input to the next filter.
null             Pass the source unchanged to the output.
overlay          Overlay a video source on top of the input.
pad              Pad input image to width:height[:x:y[:color]] (default x and y: 0, default color: black).
pixdesctest      Test pixel format definitions.
scale            Scale the input video to width:height size and/or convert the image format.
select           Select frames to pass in output.
setdar           Set the frame display aspect ratio.
setpts           Set PTS for the output video frame.
setsar           Set the pixel sample aspect ratio.
settb            Set timebase for the output link.
showinfo         Show textual information for each video frame.
slicify          Pass the images of input video on to next video filter as multiple slices.
split            Pass on the input to two outputs.
transpose        Transpose input video.
unsharp          Sharpen or blur the input video.
vflip            Flip the input video vertically.
yadif            Deinterlace the input image
buffer           Buffer video frames, and make them accessible to the filterchain.
color            Provide an uniformly colored input, syntax is: [color[:size[:rate]]]
movie            Read from a movie source.
mptestsrc        Generate various test pattern.
nullsrc          Null video source, never return images.
rgbtestsrc       Generate RGB test pattern.
testsrc          Generate test pattern.
buffersink       Buffer video frames, and make them available to the end of the filter graph.
nullsink         Do absolutely nothing with the input video.

Attachments (1)

Download all attachments as: .zip