unosquare / ffmediaelement

FFME: The Advanced WPF MediaElement (based on FFmpeg)
https://unosquare.github.io/ffmediaelement/
Other
1.15k stars 238 forks source link

Passing `filter-complex` parameters to FFMPEG #616

Open maptz opened 2 years ago

maptz commented 2 years ago

Can you you pass filter-complex arguments to FFMPEG?

I'm trying to use ffmediaelement to show various different scope views of an input video. For instance, I can show a vectorscope using the following video filter:

videoFilter.Append("waveform=filter=lowpass:scale=ire:graticule=green:flags=numbers+dots");

I'd like to show audio histogram levels from a video input using the ahistogram filter. This requires use of a filter-complex . Is there a way to pass a filter-complex parameter to FFMPEG using ffmediaelement?


For an example of the ahistogram command in action from the command line, see (here)[https://hhsprings.bitbucket.io/docs/programming/examples/ffmpeg/audio_visualization/_ahistogram_dmode_separate_.html].

Or look at the script below

#! /bin/sh
ifn="Air on the G String (from Orchestral Suite no. 3, BWV 1068).mp3"
ifnb="`basename \"${ifn}\" .mp3`"
pref="`basename $0 .sh`"

#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:a]ahistogram=s=1920x1080:dmode=separate[v]
" -map '[v]' -map '0:a' -c:a copy \
  "${pref}_${ifnb}.mp4"