libvlc_media_add_option isn't working
Posted: 10 Feb 2022 14:36
I have 1 video track (1 file), and 2 audio tracks (in 2 separate files).
I want to add audio tracks as slave to video. To do that I tried to use libvlc_media_slaves_add, but that function doesn't work.
VLC 3.0.17
My code
On the screen I see only video without audio. What is wrong in my code?
If I add slave with
libvlc_media_add_option(media, (const char*)(std::string(":input-slave=") + slaveAudioPath1).c_str());
all ok and audio playing with video. But this option allow to add only 1 slave.
I want to add audio tracks as slave to video. To do that I tried to use libvlc_media_slaves_add, but that function doesn't work.
VLC 3.0.17
My code
Code: Select all
...
libvlc_media_t* media = libvlc_media_new_path(vlcInstance, pathToVideo);
...
const char* slaveAudioPath1 = "F:\\\\Temp\\card_28_09_21\\CONTENTS\\AUDIO\\1105AH01.mxf";
const char* slaveAudioPath2 = "F:\\\\Temp\\card_28_09_21\\CONTENTS\\AUDIO\\1105AH01.mxf";
int ret = libvlc_media_slaves_add(media, libvlc_media_slave_type_audio, 4, slaveAudioPath1); // ret is 0
ret = libvlc_media_slaves_add(media, libvlc_media_slave_type_audio, 4, slaveAudioPath2); // ret is 0
auto status = libvlc_media_parse_with_options(media, libvlc_media_parse_local, -1);
libvlc_media_player_set_media(player, media);
libvlc_media_release(media);
...
libvlc_media_player_play(player);
...
If I add slave with
libvlc_media_add_option(media, (const char*)(std::string(":input-slave=") + slaveAudioPath1).c_str());
all ok and audio playing with video. But this option allow to add only 1 slave.