Page 1 of 1

Obtaining the vlc_media_player of the main loop

Posted: 23 Apr 2023 22:14
by tuxx
Hi All,

I am trying to write a plugin which takes a separate audio or video file and plays one of them back headlessly ("--no-video"), while displaying the other. The purpose is to play a video in multiple languages simultaneously and direct the audio output to different endpoints (e.g. bluetooth and speakers). I start vlc as follows:

Code: Select all

vlc --intf dual_playback ~/media/my.mkv
This should start the video passed in argv[3] and play a hard coded audio file in a new

Code: Select all

audio_instance=libvlc_new(0, NULL);
Unfortunately however, I haven't been able to figure out how I can access the vlc_media_player_t from the main loop which is playing the media file given to it from argv[3]. I would like for user input events such as pause/play/skipping/seeking to be propagated from the main interface to the headlessly playing audio interface. Is that possible? Any help would be greatly appreciated.

Re: Obtaining the vlc_media_player of the main loop

Posted: 24 Apr 2023 11:20
by chubinou
Hi,

You can't control the vlc player instance that's started as "vlc" from libvlc

libvlc allows you to create new player instances (https://videolan.videolan.me/vlc/group_ ... 9c39ad06af) that you can control within a you program

If you need to control an instance VLC (as a standalone program) you may look at the HTTP interface https://wiki.videolan.org/VLC_HTTP_requests/