Need to get level of audio signal in dbfs/lufs during playback with libmpv

63 Views Asked by At

Exploring the possibility of moving the video player from libvlc to libmpv, I came across a problem - I can not find a way to get the value of the audio signal level for each video frame (in dbfs / lufs). This is necessary to display the volume level during video playback. But libvlc and ffme have similar mechanisms.

For example, ffme has the ability to get raw audio data for further processing before outputting to an audio device. You can bind to this event (Unosquare.FFME.MediaElement.RenderingAudio http://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html#Unosquare_FFME_MediaElement_RenderingAudio) which carries RenderingAudioEventArgs, which has a method that allows get to this data (GetBufferData() http://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.RenderingAudioEventArgs.html#Unosquare_FFME_Common_RenderingAudioEventArgs_GetBufferData) which we can read and process. Libvlc can perform similar operations.

But I cannot find such functionality in libmpv. Does anyone have any ideas how to solve this issue?

P.S. It is planned to use mpv.net (https://github.com/hudec117/Mpv.NET-lib-/blob/master/src/Mpv.NET) for the move. This SDK has the ability to call ffmpeg for video and audio processing, maybe anyone have any idea how to use ffmpeg to solve this problem?

0

There are 0 best solutions below