我使用的是最新的 vlc 版本,它们是在同一个窗口中还是在多个窗口中都没有关系,只要你可以同时看到它们。
这是我正在尝试的:
int main(int argc, char **argv)
{
libvlc_instance_t *inst;
libvlc_media_player_t *mp;
libvlc_media_t *m;
inst = libvlc_new(0, NULL);
m = libvlc_media_new_path(inst, "/tmp/mpt-smart-travels-classical-clip.ts");
mp = libvlc_media_player_new_from_media(m);
libvlc_media_release(m);
libvlc_media_player_play(mp);
libvlc_track_description_t *videoIDs = libvlc_video_get_track_description(mp);
int numberOfTracks = sizeof videoIDs;
int count = 0;
int id;
while (count <= numberOfTracks) {
id = videoIDs[count];
libvlc_video_set_track(mp,id);
count += 1;
}
sleep(10);
libvlc_media_player_stop(mp);
libvlc_media_player_release(mp);
libvlc_release(inst);
return 0;
}
$ gcc $(pkg-config --cflags libvlc) -c test.c -o test.o
$ gcc test.o -o test $(pkg-config --libs libvlc)
可能需要使用名为“p_next”的指针来获取下一个流的 ID。videolan.org/developers/vlc/doc/doxyge/html/structlibvlc_track_description__t.html _ _