[FFmpeg-user] Cutdetection (dynamic threshold) and Fadedetection with ffmpeg

Christoph Gerstbauer christophgerstbauer at gmail.com
Fri Jan 23 14:39:01 CET 2015

Am 23.01.2015 um 13:57 schrieb Dave Rice:
> On Jan 23, 2015, at 5:23 AM, Christoph Gerstbauer <christophgerstbauer at gmail.com> wrote:
>>> The YDIF value in the signalstats filter could show this.
>>> ffprobe -f lavfi movie=DETECT_CUTS.mov,signalstats -show_entries "frame_tags=lavfi.signalstats.YDIF” -of flat
>>> Perhaps filter out lines where YDIF is higher than 10.
>> Hi, that does not work on my machine. (Win7)
>> Command line output:
>> C:\Users\gersti>ffprobe -f lavfi movie=C:\ffmpeg\bin\DETECT_CUTS.mov,signalstats -show_entries "frame_tags=lavfi.signalstats.YDIF” -of flat
>> ffprobe version N-64919-ga613257 Copyright (c) 2007-2014 the FFmpeg developers
>>   built on Jul 23 2014 00:35:22 with gcc 4.8.3 (GCC)
>>   configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
>> ray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
>> b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
>> enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
>>   libavutil      52. 92.101 / 52. 92.101
>>   libavcodec     55. 69.100 / 55. 69.100
>>   libavformat    55. 48.101 / 55. 48.101
>>   libavdevice    55. 13.102 / 55. 13.102
>>   libavfilter     4. 11.102 /  4. 11.102
>>   libswscale      2.  6.100 /  2.  6.100
>>   libswresample   0. 19.100 /  0. 19.100
>>   libpostproc    52.  3.100 / 52.  3.100
>> [Parsed_movie_0 @ 0000000002b41ee0] Failed to avformat_open_input 'C'
>> [lavfi @ 0000000002b34b20] Error initializing filter 'movie' with args 'C:ffmpegbinDETECT_CUTS.mov'
>> movie=C:\ffmpeg\bin\DETECT_CUTS.mov,signalstats: No such file or directory
> Is C:\ffmpeg\bin\DETECT_CUTS.mov an actual file on your machine?
Hi Dave

yes: DETECT_CUTS.mov is an actual file on my workstation.
> Also your build is old.
I tried it with an new version. same here:

C:\Users\gersti>ffprobenew -f lavfi 
movie=C:\ffmpegneu\bin\DETECT_CUTS.mov,signalstats -show_entries 
"frame_tags=lavfi.signalstats.YDIF” -of flat
ffprobe version N-69060-gcd960c8 Copyright (c) 2007-2015 the FFmpeg 
   built on Jan 14 2015 22:13:45 with gcc 4.9.2 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads 
--enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r 
--enable-gnutls --enable-iconv --enable-libass --enable-libblu
ray --enable-libbs2b --enable-libcaca --enable-libfreetype 
--enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug 
--enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libopenjpeg --enable-libopus --enable-librtmp 
--enable-libschroedinger --enable-libsoxr --enable-libspeex 
--enable-libtheora --enable-libtwolame --enable-libvidstab 
--enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx 
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 
--enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enab
   libavutil      54. 16.100 / 54. 16.100
   libavcodec     56. 20.100 / 56. 20.100
   libavformat    56. 18.101 / 56. 18.101
   libavdevice    56.  4.100 / 56.  4.100
   libavfilter     5.  7.101 /  5.  7.101
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  1.100 /  1.  1.100
   libpostproc    53.  3.100 / 53.  3.100
[Parsed_movie_0 @ 0000000002c6d960] Failed to avformat_open_input 'C'
[lavfi @ 0000000002c6aec0] Error initializing filter 'movie' with args 
movie=C:\ffmpegneu\bin\DETECT_CUTS.mov,signalstats: No such file or 

> Do you see signalstats when running 'ffmpeg -filters'?
> Dave Rice
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

ffmpeg -filters:

   T.. = Timeline support
   .S. = Slice threading
   ..C = Commmand support
   A = Audio input/output
   V = Video input/output
   N = Dynamic number and/or type of input/output
   | = Source or sink filter
  T.. adelay           A->A       Delay one or more audio channels.
  ... aecho            A->A       Add echoing to the audio.
  ... aeval            A->A       Filter audio signal according to a 
specified expression.
  T.. afade            A->A       Fade in/out input audio.
  ... aformat          A->A       Convert the input audio to one of the 
specified formats.
  ... ainterleave      N->A       Temporally interleave audio inputs.
  ... allpass          A->A       Apply a two-pole all-pass filter.
  ... amerge           N->A       Merge two or more audio streams into a 
single multi-channel stream.
  ... amix             N->A       Audio mixing.
  ... anull            A->A       Pass the source unchanged to the output.
  T.. apad             A->A       Pad audio with silence.
  ... aperms           A->A       Set permissions for the output audio 
  ... aphaser          A->A       Add a phasing effect to the audio.
  ... aresample        A->A       Resample audio data.
  ... aselect          A->N       Select audio frames to pass in output.
  ... asendcmd         A->A       Send commands to filters.
  ... asetnsamples     A->A       Set the number of samples for each 
output audio frames.
  ... asetpts          A->A       Set PTS for the output audio frame.
  ... asetrate         A->A       Change the sample rate without 
altering the data.
  ... asettb           A->A       Set timebase for the audio output link.
  ... ashowinfo        A->A       Show textual information for each 
audio frame.
  ... asplit           A->N       Pass on the audio input to N audio 
  ... astats           A->A       Show time domain statistics about 
audio frames.
  ... astreamsync      AA->AA     Copy two streams of audio data in a 
configurable order.
  ..C atempo           A->A       Adjust audio tempo.
  ... atrim            A->A       Pick one continuous section from the 
input, drop the rest.
  ... bandpass         A->A       Apply a two-pole Butterworth band-pass 
  ... bandreject       A->A       Apply a two-pole Butterworth 
band-reject filter.
  ... bass             A->A       Boost or cut lower frequencies.
  ... biquad           A->A       Apply a biquad IIR filter with the 
given coefficients.
  ... bs2b             A->A       Bauer stereo-to-binaural filter.
  ... channelmap       A->A       Remap audio channels.
  ... channelsplit     A->N       Split audio into per-channel streams.
  ... compand          A->A       Compress or expand audio dynamic range.
  ... earwax           A->A       Widen the stereo image.
  ... ebur128          A->N       EBU R128 scanner.
  ... equalizer        A->A       Apply two-pole peaking equalization 
(EQ) filter.
  ... flanger          A->A       Apply a flanging effect to the audio.
  ... highpass         A->A       Apply a high-pass filter with 3dB 
point frequency.
  ... join             N->A       Join multiple audio streams into 
multi-channel output.
  ... lowpass          A->A       Apply a low-pass filter with 3dB point 
  ... pan              A->A       Remix channels with coefficients 
  ... replaygain       A->A       ReplayGain scanner.
  ... silencedetect    A->A       Detect silence.
  ... silenceremove    A->A       Remove silence.
  ... treble           A->A       Boost or cut upper frequencies.
  T.C volume           A->A       Change input volume.
  ... volumedetect     A->A       Detect audio volume.
  ... aevalsrc         |->A       Generate an audio signal generated by 
an expression.
  ... anullsrc         |->A       Null audio source, return empty audio 
  ... sine             |->A       Generate sine wave audio signal.
  ... anullsink        A->|       Do absolutely nothing with the input 
  ... alphaextract     V->N       Extract an alpha channel as a 
grayscale image component.
  ... alphamerge       VV->V      Copy the luma value of the second 
input into the alpha channel of the first input.
  ... ass              V->V       Render ASS subtitles onto input video 
using the libass library.
  T.. bbox             V->V       Compute bounding box for each frame.
  ... blackdetect      V->V       Detect video intervals that are 
(almost) black.
  ... blackframe       V->V       Detect frames that are (almost) black.
  TS. blend            VV->V      Blend two video frames into each other.
  T.. boxblur          V->V       Blur the input.
  T.. codecview        V->V       Visualize information about some codecs
  T.. colorbalance     V->V       Adjust the color balance.
  T.. colorchannelmixer V->V       Adjust colors by mixing color channels.
  T.. colorlevels      V->V       Adjust the color levels.
  T.. colormatrix      V->V       Convert color matrix.
  ... copy             V->V       Copy the input video unchanged to the 
  ... crop             V->V       Crop the input video.
  T.. cropdetect       V->V       Auto-detect crop size.
  TS. curves           V->V       Adjust components curves.
  TS. dctdnoiz         V->V       Denoise frames using 2D DCT.
  ... decimate         N->V       Decimate frames (post field matching 
  ... dejudder         V->V       Remove judder produced by pullup.
  T.. delogo           V->V       Remove logo from input video.
  ... deshake          V->V       Stabilize shaky video.
  T.. drawbox          V->V       Draw a colored box on the input video.
  T.. drawgrid         V->V       Draw a colored grid on the input video.
  T.C drawtext         V->V       Draw text on top of video frames using 
libfreetype library.
  T.. edgedetect       V->V       Detect and draw edge.
  ... elbg             V->V       Apply posterize effect, using the ELBG 
  ... extractplanes    V->N       Extract planes as grayscale frames.
  .S. fade             V->V       Fade in/out input video.
  ... field            V->V       Extract a field from the input video.
  ... fieldmatch       N->V       Field matching for inverse telecine.
  T.. fieldorder       V->V       Set the field order.
  ... format           V->V       Convert the input video to one of the 
specified pixel formats.
  ... fps              V->V       Force constant framerate.
  ... framepack        VV->V      Generate a frame packed stereoscopic 
  T.. framestep        V->V       Select one frame every N frames.
  ... frei0r           V->V       Apply a frei0r effect.
  T.. fspp             V->V       Apply Fast Simple Post-processing filter.
  T.. geq              V->V       Apply generic equation to each pixel.
  T.. gradfun          V->V       Debands video quickly using gradients.
  TS. haldclut         VV->V      Adjust colors using a Hald CLUT.
  .S. hflip            V->V       Horizontally flip the input video.
  T.. histeq           V->V       Apply global color histogram equalization.
  ... histogram        V->V       Compute and draw a histogram.
  T.. hqdn3d           V->V       Apply a High Quality 3D Denoiser.
  .S. hqx              V->V       Scale the input by 2, 3 or 4 using the 
hq*x magnification algorithm.
  T.C hue              V->V       Adjust the hue and saturation of the 
input video.
  ... idet             V->V       Interlace detect Filter.
  T.. il               V->V       Deinterleave or interleave fields.
  ... interlace        V->V       Convert progressive video into interlaced.
  ... interleave       N->V       Temporally interleave video inputs.
  ... kerndeint        V->V       Apply kernel deinterlacing to the input.
  .S. lenscorrection   V->V       Rectify the image by correcting for 
lens distortion.
  TS. lut3d            V->V       Adjust colors using a 3D LUT.
  T.. lut              V->V       Compute and apply a lookup table to 
the RGB/YUV input video.
  T.. lutrgb           V->V       Compute and apply a lookup table to 
the RGB input video.
  T.. lutyuv           V->V       Compute and apply a lookup table to 
the YUV input video.
  ... mcdeint          V->V       Apply motion compensating deinterlacing.
  ... mergeplanes      N->V       Merge planes.
  ... mp               V->V       Apply a libmpcodecs filter to the 
input video.
  ... mpdecimate       V->V       Remove near-duplicate frames.
  T.. negate           V->V       Negate input video.
  ... noformat         V->V       Force libavfilter not to use any of 
the specified pixel formats for the input to the next filter.
  TS. noise            V->V       Add noise.
  ... null             V->V       Pass the source unchanged to the output.
  T.C overlay          VV->V      Overlay a video source on top of the 
  T.. owdenoise        V->V       Denoise using wavelets.
  ... pad              V->V       Pad the input video.
  ... perms            V->V       Set permissions for the output video 
  TS. perspective      V->V       Correct the perspective of video.
  T.. phase            V->V       Phase shift fields.
  ... pixdesctest      V->V       Test pixel format definitions.
  T.C pp               V->V       Filter video using libpostproc.
  T.. pp7              V->V       Apply Postprocessing 7 filter.
  ... psnr             VV->V      Calculate the PSNR between two video 
  ... pullup           V->V       Pullup from field sequence to frames.
  T.. qp               V->V       Change video quantization parameters.
  T.. removelogo       V->V       Remove a TV logo based on a mask image.
  TSC rotate           V->V       Rotate the input image.
  T.. sab              V->V       Apply shape adaptive blur.
  ... scale            V->V       Scale the input video size and/or 
convert the image format.
  ... select           V->N       Select video frames to pass in output.
  ... sendcmd          V->V       Send commands to filters.
  ... separatefields   V->V       Split input video frames into fields.
  ... setdar           V->V       Set the frame display aspect ratio.
  ... setfield         V->V       Force field for the output video frame.
  ... setpts           V->V       Set PTS for the output video frame.
  ... setsar           V->V       Set the pixel sample aspect ratio.
  ... settb            V->V       Set timebase for the video output link.
  ... showinfo         V->V       Show textual information for each 
video frame.
  ... shuffleplanes    V->V       Shuffle video planes
  .S. signalstats      V->V       Generate statistics from video analysis.
  T.. smartblur        V->V       Blur the input video without impacting 
the outlines.
  ... split            V->N       Pass on the input to N video outputs.
  T.C spp              V->V       Apply a simple post processing filter.
  ... stereo3d         V->V       Convert video stereoscopic 3D view.
  ... subtitles        V->V       Render text subtitles onto input video 
using the libass library.
  ... super2xsai       V->V       Scale the input by 2x using the 
Super2xSaI pixel art algorithm.
  ... swapuv           V->V       Swap U and V components.
  .S. tblend           V->V       Blend successive frames.
  ... telecine         V->V       Apply a telecine pattern.
  ... thumbnail        V->V       Select the most representative frame 
in a given sequence of consecutive frames.
  ... tile             V->V       Tile several successive frames together.
  ... tinterlace       V->V       Perform temporal field interlacing.
  .S. transpose        V->V       Transpose input video.
  ... trim             V->V       Pick one continuous section from the 
input, drop the rest.
  T.. unsharp          V->V       Sharpen or blur the input video.
  T.. uspp             V->V       Apply Ultra Simple / Slow 
Post-processing filter.
  ... vflip            V->V       Flip the input video vertically.
  ... vidstabdetect    V->V       Extract relative transformations, pass 
1 of 2 for stabilization (see vidstabtransform for pass 2).
  ... vidstabtransform V->V       Transform the frames, pass 2 of 2 for 
stabilization (see vidstabdetect for pass 1).
  T.. vignette         V->V       Make or reverse a vignette effect.
  T.. w3fdif           V->V       Apply Martin Weston three field 
  .S. xbr              V->V       Scale the input using xBR algorithm.
  TS. yadif            V->V       Deinterlace the input image.
  T.. zoompan          V->V       Apply Zoom & Pan effect.
  ... cellauto         |->V       Create pattern generated by an 
elementary cellular automaton.
  ..C color            |->V       Provide an uniformly colored input.
  ... frei0r_src       |->V       Generate a frei0r source.
  ... haldclutsrc      |->V       Provide an identity Hald CLUT.
  ... life             |->V       Create life.
  ... mandelbrot       |->V       Render a Mandelbrot fractal.
  ... mptestsrc        |->V       Generate various test pattern.
  ... nullsrc          |->V       Null video source, return unprocessed 
video frames.
  ... rgbtestsrc       |->V       Generate RGB test pattern.
  ... smptebars        |->V       Generate SMPTE color bars.
  ... smptehdbars      |->V       Generate SMPTE HD color bars.
  ... testsrc          |->V       Generate test pattern.
  ... nullsink         V->|       Do absolutely nothing with the input 
  ... avectorscope     A->V       Convert input audio to vectorscope 
video output.
  ... concat           N->N       Concatenate audio and video streams.
  ... showcqt          A->V       Convert input audio to a CQT (Constant 
Q Transform) spectrum video output.
  ... showspectrum     A->V       Convert input audio to a spectrum 
video output.
  ... showwaves        A->V       Convert input audio to a video output.
  ... amovie           |->N       Read audio from a movie source.
  ... movie            |->N       Read from a movie source.
  ... ffbuffersink     V->|       Buffer video frames, and make them 
available to the end of the filter graph.
  ... ffabuffersink    A->|       Buffer audio frames, and make them 
available to the end of the filter graph.
  ... abuffer          |->A       Buffer audio frames, and make them 
accessible to the filterchain.
  ... buffer           |->V       Buffer video frames, and make them 
accessible to the filterchain.
  ... abuffersink      A->|       Buffer audio frames, and make them 
available to the end of the filter graph.
  ... buffersink       V->|       Buffer video frames, and make them 
available to the end of the filter graph.
  ... afifo            A->A       Buffer input frames and send them when 
they are requested.
  ... fifo             V->V       Buffer input images and send them when 
they are requested.

best regards

More information about the ffmpeg-user mailing list