我正在使用VLC-QT V1.1.0和libVlc V2.2.4,并希望同时记录和播放rtsp / rtmp流。但是我发现同时记录和播放时,仅显示视频,没有音频输出。我也无法成功设置音量。
libvlc显示如下错误:“无活动音频输出”。
Vlc::Mux fileType = Vlc::MP4;
QString out_file = "testrecord";
QString out_file_path = "D://";
_media1 = new VlcMedia("rtmp://live.hkstv.hk.lxdns.com/live/hks1",_instance1);
_media1->record(out_file, out_file_path, fileType, true);
_player1->open(_media1);
while (true)
{
Vlc::State state = _media1->state();
if (state != Vlc::State::Playing)
{
_sleep(1000);
}
else
{
bool mute = _player1->audio()->getMute();
int volume = _player1->audio()->volume();
_player1->audio()->setVolume(100);
volume = _player1->audio()->volume();
mute = _player1->audio()->getMute();
break;
}
}