[FFmpeg-user] ebuR128 display of live source

Gyan Doshi ffmpeg at gyani.pro
Mon Mar 20 12:59:52 EET 2023



On 2023-03-19 03:47 pm, Bouke / Videotoolshed wrote:
> 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.)

The ebur filter has an option to store the readouts as frame metadata. 
You can then use ametadata filter to print out the metadata to a file or 
pipe. The filter has an option 'direct' to flush out writes immediately 
instead of buffering them.

Regards,
Gyan



More information about the ffmpeg-user mailing list