How to get Audio Delay/Video Delay/Media Player Data from the libvlc_add_intf(inst,"qt") API

This forum is about all development around libVLC.
pramodkalva
New Cone
New Cone
Posts: 8
Joined: 17 Aug 2016 12:11
VLC version: 2.1.6
Operating System: Linux

How to get Audio Delay/Video Delay/Media Player Data from the libvlc_add_intf(inst,"qt") API

Postby pramodkalva » 26 Aug 2016 08:00

Code: Select all

sprintf(smem_options,"#duplicate{dst=display,select=noaudio,dst=\"transcode{vcodec=none,acodec=s16l}:smem{" "audio-postrender-callback=%lld," "audio-prerender-callback=%lld}," "audio-data=%lld\"", (long long int)(intptr_t)(void*)&handle_stream, (long long int)(intptr_t)(void*)&prepare_render, ); const char * const *vlc_args[] = {"-vvv","--sout",smem_options}; inst = libvlc_new(sizeof(vlc_args)/sizeof(vlc_args[0]),vlc_args); libvlc_add_intf(inst,"qt");
Basic Functionality of above Code is to play a mp4 video file and transcode audio into PCM(WAV) format and store in a buffer using smem.

when i add interface using libvlc_add_intf(inst,"qt");
-->It immediately launches qt window and i am opening a video file to play using the same qt window,
Video is displaying on the qt window and audio via the provided smem callbacks is converting into pcm format everything works fine as i expected.

But here comes the issue ,
-->How can i get the audio delay,video delay and the Media Player data when vlc is launched via libvlc_add_intf();
These info. as I understand can be obtained via the media_player_t object. So, how can I obtain media_player when vlc is launched via add_intf() isn't there a get_current_media_player_from_instance() kind of function available?
-->Note: I am not using libvlc_media_player_play(mp); I am able to get the required info, when I use this.

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How to get Audio Delay/Video Delay/Media Player Data from the libvlc_add_intf(inst,"qt") API

Postby Rémi Denis-Courmont » 26 Aug 2016 10:23

I don't really understand what infos you want to get, but there is no media player object if you don't create one. The GUI does not use a media player object internally, so there are no media player objects to be had.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

pramodkalva
New Cone
New Cone
Posts: 8
Joined: 17 Aug 2016 12:11
VLC version: 2.1.6
Operating System: Linux

Re: How to get Audio Delay/Video Delay/Media Player Data from the libvlc_add_intf(inst,"qt") API

Postby pramodkalva » 29 Aug 2016 07:50

In our project we are using VLC (via libVLC) to split video stream "duplicate" display on the default display and stream the audio got via "transcode"/"smem" through the different output interface [after certain optimizations]. If a media object is created by our program by providing a hard-coded path, then to counter/offset the audio streaming delays we can introduce some delay in the video playback (hoping to introduce some delay). However, if the GUI is launched the how can we feed this kind of a delay or even get information of how much audio is lagging (delay) from the media being played in GUI ?

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How to get Audio Delay/Video Delay/Media Player Data from the libvlc_add_intf(inst,"qt") API

Postby Rémi Denis-Courmont » 29 Aug 2016 22:59

Check the play timestamp (PTS) field.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 11 guests