Qt开发:使用VLC播放视频,并且显示画面

 

Qt5如何使用VLC库,可以看博客:http://blog.csdn.net/taoerit/article/details/76871116


     libvlc_instance_t * libvlc_inst;
     libvlc_media_player_t *libvlc_mp;
     libvlc_media_t *libvlc_m;

      const char *char_url;
      char_url = "E:\\FFMPEG\\dzq.MP4";

      libvlc_inst = libvlc_new(0,NULL);


       //m = libvlc_media_new_location (libvlc_inst, "http://mycool.movie.com/test.mov");

        libvlc_m = libvlc_media_new_path (libvlc_inst, char_url);

        /* Create a media player playing environement */
        libvlc_mp = libvlc_media_player_new_from_media (libvlc_m);

        /* No need to keep the media now */
        libvlc_media_release (libvlc_m);


        HWND screen_hwnd = (HWND)ui->lbShowImage->winId();

       //on windows
        libvlc_media_player_set_hwnd (libvlc_mp,screen_hwnd);

        /* play the media_player */
        int x=libvlc_media_player_play (libvlc_mp);

 

 

 

 

 

 

你可能感兴趣的:(VLC,流媒体,Qt)