Skip to main content
9 votes
Accepted

What is the ffmpeg filter equivalent of "Automatic levels" for colors?

Here's the details on what the presets do: [PRESET_COLOR_NEGATIVE] = { "0/1 0.129/1 0.466/0.498 0.725/0 1/0", "0/1 0.109/1 0.301/0.498 0.517/0 1/0", "0/1 0.098/1 0.235/0.498 0.423/0 1/0", ...
Gyan's user avatar
  • 33.3k
8 votes
Accepted

Correct "stripes" in VHS record

Those are interlacing artifacts. They become visible when the motion in the video is faster than the field rate, so that when both fields are combined into a progressive scan image, the movement is ...
Michael Liebman's user avatar
6 votes

How to set pts time format when using ffmpeg filter to add timestamp

Do In order to draw Timestamp: 01:25., you should specify this one to (feed) ffmpeg: drawtext = text = 'Timestamp\: %{pts\:gmtime\:0\:%M\\\:%S}.' Don't If you specify this one to (feed) ffmpeg: ...
Константин Ван's user avatar
5 votes
Accepted

replace black frames with previous frames

It's possible to have the black frames removed and earlier frames duplicated. ffmpeg -i in.mp4 -vf blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less -vsync cfr -c:a copy ...
Gyan's user avatar
  • 33.3k
4 votes
Accepted

How to concatenate multiple videos with fades (from- and to-black) in-between?

So here is what I came up with. A not fully one-liner solution 1) Generate black clips ffmpeg -f lavfi -i "color=black:s=1920x1080:r=30" \ -f lavfi -i "anullsrc=r=48000:cl=stereo" ...
TedGrassman's user avatar
4 votes
Accepted

Color leakage effects with ffmpeg blend=all_expr

The default pixel format for testsrc filter is rgb24, which gets converted to yuv444p for encoding to H264. The default pixel format for color is yuv420p, which is kept as-is. The blend filter ...
Gyan's user avatar
  • 33.3k
4 votes
Accepted

mplayer/ffmpeg How to set caca filter's output size

Found. Caca library is driven mostly by environment variables rather than filter params. export CACA_GEOMETRY=200x78 mplayer -vo caca $INPUT
Ondra Žižka's user avatar
4 votes
Accepted

ffmpeg: can I crop using vf while also using filter_complex at the same time?

Use this: ffmpeg -i input.mp4 -filter_complex \ "[0:v]crop='if(gte(iw,ih),ih,iw):if(gte(ih,iw),iw,ih)',scale=720x720,split=3[1v][2v][3v]; \ [1v]trim=0:4.95,setpts=PTS-STARTPTS[v1]; \ [2v]trim=4.95:...
Gyan's user avatar
  • 33.3k
3 votes
Accepted

FFmpeg: afade plugin, how to specify time 1:55 if colon separates filter parameters? Escape

Enclose the time argument in single quotes and escape the colons within. So, afade=t=out:curve=hsin:st='00\:0\:30':d='00\:00\:10'
Gyan's user avatar
  • 33.3k
3 votes

ffmpeg concat with or without audio

Use the concat demuxer instead: Create a text file of the following format file 'C:\source.mp4' inpoint 0 duration 1 file 'C:\source.mp4' inpoint 3 duration 1 file 'C:\source.mp4' inpoint 6 duration ...
Gyan's user avatar
  • 33.3k
3 votes
Accepted

Add semi-transparent box around subtitle

Use ffmpeg -i movie.mkv -strict -2 -vf "subtitles=subtitle.srt:force_style='FontName=ubuntu,fontsize=30,BorderStyle=3,OutlineColour=&H80000000',scale=720:-1" -qscale:v 3 Movie.avi See Style ...
Gyan's user avatar
  • 33.3k
3 votes

"ffmpeg" set fontsize and font

I did solved this with " " "subtitles=subtitle.srt:force_style='FontName=ubuntu,Fontsize=30'"
Slobodan Vidovic's user avatar
3 votes
Accepted

How to set pts time format when using ffmpeg filter to add timestamp

Use text='timestamp \: %{pts\:gmtime\:0\:%H\\\:%M\\\:%S}'
Gyan's user avatar
  • 33.3k
3 votes
Accepted

How to improve quality of a WebCam video?

More Light You're seeing noise for two reasons. One is the tiny sensor of your webcam, but since you don't want to buy a new one right now, you can't do anything about that. However, the sensor size ...
MoritzLost's user avatar
  • 5,412
3 votes
Accepted

ffmpeg blend mode multiply results in green overlay

I solved my problem thanks to @Gyan comment: ffmpeg -i bg.mp4 -i fg.mov -filter_complex "[0:v] format=rgba [bg]; [1:v] format=rgba [fg]; [bg][fg] blend=all_mode='multiply':all_opacity=1, format=rgba" ...
Alex's user avatar
  • 41
2 votes

What -preset medium stand for in ffmpeg

On the page you linked to it explains it fairly well: A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower preset will provide better ...
stib's user avatar
  • 13.7k
2 votes
Accepted

What -preset medium stand for in ffmpeg

preset is a private option that may be defined for an encoder, such as libx264. It is a shorthand method to set a whole bunch of options at once, and won't have any effect if set when using an encoder ...
Gyan's user avatar
  • 33.3k
2 votes
Accepted

ffmpeg fade to specific color values over time

The lut filter expressions don't work with time. geq does. geq=r='(1-0.7*min((T-S)/D,1))*p(X,Y)':g={the same as r}:b={the same}:enable='gte(t,S)' S should be your start time in second. D is duration ...
Gyan's user avatar
  • 33.3k
2 votes
Accepted

Stack images with "hstack"-filter from video or image sequence in ffmpeg

You're better off using the tile filter for this: ffmpeg -i INPUT.mov -vf fps=1,scale=192:108,tile=54x1 output.jpg The tile argument is the size of a rectangle. So for a 54 second video, 54x1 ...
Gyan's user avatar
  • 33.3k
2 votes

If I use a normal build of ffmpeg how take advantage of video acceleration for scale?

The answer to your second question is yes. Change -c:v libx264 to -c:v h264_nvenc. I use those builds as well. If you use the option -encoders you can see a list of included video and audio codecs. ...
Gordon's user avatar
  • 106
2 votes
Accepted

Replace all completely black frames with interpolated frames

After poring over the documentation all weekend, I figured out how to use the minterpolate filter to do motion interpolation. The full command is ffmpeg -i in.mp4 -vf blackframe=0,metadata=select:...
BlueRaja - Danny Pflughoeft's user avatar
2 votes
Accepted

Combine -vf yadif,format=yuv420p and -filter_complex for watermark

Use ffmpeg -i input.mp4 -i logo.png \ -filter_complex "[0]yadif,format=yuv420p[main];[1][main]scale2ref=iw/5:ow*450/450[wm][vid];[vid][wm]overlay=W-w-W*3/100:H-h-H*1/100:enable='gt(t,30)'" \ -...
Gyan's user avatar
  • 33.3k
1 vote

How to apply different filters to different parts of a video using AviSynth?

This can be done using the filter ClipClop. Here is an example script from the docs of the filter: Avisource("D:\avs\test.avi") ORG=Last V1 = FFT3DFilter(Plane=0,Sigma=1.6) # Light Luma V2 = ...
Krisztián Balla's user avatar
1 vote
Accepted

How to overlay 2 videos using depth layers

The main issue was, that the Z-Layer was not accurate enough, as Gyan said. Addtionally the condition needed to be changed from lt(A,B) to lte(A,B).
Pingger Shikkoken's user avatar
1 vote

Why when I overlay a logo on top of the video, the white color part of the logo is transparent?

There is no white color. That's the background color of the page showing through. Your input PNG is palettized 8-bit image where black color indicates transparency. Apply the following filter to the ...
Gyan's user avatar
  • 33.3k
1 vote

Premiere: Make music sound like it's coming from huge speakers?

I've had good luck by sampling a bit of the video's audio from another point, and splicing that in. The tone will be dead-on consistent. You just have to find a point in the song where it basically ...
ZenGeekDad's user avatar
1 vote

How to use ffmpeg to fade in/out a veriable frame rate video clip with unknown duration

This works here ffmpeg -i VID_1.mp4 -sseof -2 -copyts -i VID_1.mp4 -lavfi "[1]fade=out:s=1:d=2[tail];[0][tail]overlay,fade=in:s=0:d=2,scale=640:-2[video];anullsrc,atrim=0:2.1[audiotail];[0][audiotail]...
Gyan's user avatar
  • 33.3k
1 vote
Accepted

ffmpeg error "Error initializing complex filters"

Font paths have to be escaped: fontfile='c\:\\Windows\\Fonts\\simsun.ttc'
Gyan's user avatar
  • 33.3k

Only top scored, non community-wiki answers of a minimum length are eligible