Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. VlcMediaPlayer: making audio callback (amplitude monitor)
QtWS25 Last Chance

VlcMediaPlayer: making audio callback (amplitude monitor)

Scheduled Pinned Locked Moved Unsolved General and Desktop
vlc-qtc++
2 Posts 2 Posters 427 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    seyon
    wrote on 13 Apr 2022, 20:17 last edited by
    #1

    I'm using VlcMediaPlayer to play video with audio, and I'm having trouble figuring out how one might hook the audio and process it with code (I'd like to monitor audio as the video plays programmatically).

    Low-level, I believe the main way to do this in raw libvlc is using sout, i.e.
    --sout #transcode{acodec=s16l}:smem{audio-postrender-callback=<callback_addr>,audio-prerender-callback=<callback_addr>}

    I can initialize my VlcInstance using this option but unfortunately while the callback works, that then breaks my media player, it's just a black screen.
    My assumption became that this "consumes" the streams. I can find some examples of splitting video as to record it to a file while processing, for instance, as here

    So I thought maybe I can redirect one copy to display i.e. --sout #duplicate{dst=display,dst=\"transcode{acodec=s16l}:smem{audio-postrender-callback=<callback_addr>,audio-prerender-callback=<callback_addr>\"}
    Unfortunately this too breaks the media player.

    I see a distantly relevant github issue here for a C# VLC lib that says using sout breaks vout, but it seems VlcMediaPlayer does not rely on vout since the flag is 0 even when it works. So I am not sure why this isn't working.

    I hoped there was some class such as QAudioProbe but it doesn't seem to connect with vlc, so at this point I'm not sure what to try.

    So I guess my question is: is there a way to get this to work with vlc-qt that's easier than synchronizing some other audio lib with my VlcMediaPlayer, and if so how?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 14 Apr 2022, 20:16 last edited by
      #2

      Hi and welcome to devnet,

      That's a pretty interesting question. However, you should bring it to the VLC-Qt maintainers. They will likely be more knowledgeable about that issue.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      2/2

      14 Apr 2022, 20:16

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved