Code: Select all
const char* vlc_argv[] =
{
"--no-audio", /* skip any audio track */
};
libvlc_instance_t* inst = libvlc_new(sizeof(vlc_argv) / sizeof(*vlc_argv), vlc_argv);
auto media = libvlc_media_new_path (inst, filename.c_str());
player = libvlc_media_player_new_from_media(media);
libvlc_media_release(media);
// Needed to initialize the player ?
libvlc_media_player_play(player);
libvlc_media_player_pause(player);
fps = libvlc_media_player_get_fps(player);
length = libvlc_media_player_get_length(player);
width = libvlc_video_get_width(player);
height = libvlc_video_get_height(player);
// TODO: Add libvlc_video_set_callbacks to set up callbacks to render to memory buffer
- Is there a more straightforward way to initialize the media player without starting playback besides calling libvlc_media_player_play then libvlc_media_player_pause?
- All of the get functions (fps, length, width, height) all return zero. Do I need to do something like read the first frame to get these values, and if so, how am I supposed to know how large my decoded frame buffer must be?