[FFmpeg-user] ebuR128 display of live source

Bouke / Videotoolshed bouke at videotoolshed.com
Sun Mar 19 12:17:17 EET 2023


> On 16 Mar 2023, at 17:39, Moritz Barsnick <barsnick at gmx.net> wrote:
> 
> On Fri, Mar 03, 2023 at 12:31:40 +0100, Bouke / Videotoolshed wrote:
>>> On 1 Mar 2023, at 11:53, Bouke / Videotoolshed <bouke at videotoolshed.com> wrote:
>>> Trying to get a visualisation of my levels during record / stream.
>>> This works fine for file based material:
>>> ffplay -f lavfi -i "amovie=/Users/bouke/Downloads/test.wav,ebur128=video=1:meter=18:target=-16 [out0][out1]"
>>> But I would like to have a live source (I’m on Mac, AVfoundation I guess.)
>> 
>> Tried the following:
>> ffplay -f lavfi -i "amovie='\:2':f=avfoundation,ebur128=video=1:meter=18:target=-16 [out0][out1]”
>> 
>> Closer, but still no cigar:
>> It does not throw an error, but nothing is shown, as if input is not fed to the ebur128 filter
> 
> Are you sure your avfoundation device delivers any audio packets into
> the filter chain?

Hi Moritz,
No, I have not, since I wrote the original question I have tried another approach that does work:
Feeding AVfoundation into FFmpeg, parse the result and draw a nice graph myself.

But then a new issue arrived on Windows, where I asked here:

———
Trying to build a metering tool that displays (almost) RT values.
On Mac, all works fine with AVfoundation, but on Win with Directshow I have an issue:

C:\Users\Bouke>ffmpeg.exe -nostats -f dshow -ar 48000 -i audio="Line (Steinberg CI2)" -filter_complex "ebur128=peak=true" -f null -

Now, this works fine, BUT, the output to stderr is at very irregular intervals.
Output is as expected lines like:
[Parsed_ebur128_0 @ 000001915fe77a40] t: 0.199979   TARGET:-23 LUFS    M:-120.7 S:-120.7     I: -70.0 LUFS       LRA:   0.0 LU  FTPK: -55.5 -71.0 dBFS  TPK: -55.2 -69.8 dBFS
[Parsed_ebur128_0 @ 000001915fe77a40] t: 0.299979   TARGET:-23 LUFS    M:-120.7 S:-120.7     I: -70.0 LUFS       LRA:   0.0 LU  FTPK: -56.2 -72.7 dBFS  TPK: -55.2 -69.8 dBFS

Now, sometimes one line is outputted (as expected) but most of the times it’s 2 up to 4 lines at the same time.
That does not make for a pretty visual show if I parse it ‘as fast as possible’

I could buffer the output and do my display stuff for each line with my own interval / if buffer line length >= 4 or alike, but that would introduce half a second delay, and that does not compute well in my brain when I have to ride the faders…

Is there anything I can do to have FFmpeg spit out each line ‘as soon as it is available’?
(I’m starting FFmpeg from Python, listening to StdOut / StdErr.)

———

Bouke




More information about the ffmpeg-user mailing list