qt +VLC 播放
网络地址失败?
提示的
错误是
main access debug: looking for access module matching "file": 20 candidatesfilesystem access debug: opening file `C:\mycode5.2.1\build-Litter-qi-Desktop_Qt_5_3_0_MinGW_32bit-Debug\http:\\222.88.91.227\broadcast\sub?channel=910&id=ku6_live'filesystem access error: cannot open file C:\mycode5.2.1\build-Litter-qi-Desktop_Qt_5_3_0_MinGW_32bit-Debug\http:\\222.88.91.227\broadcast\sub?channel=910&id=ku6_live (Invalid argument)main access error: File reading failedmain access error: VLC could not open the file "C:\mycode5.2.1\build-Litter-qi-Desktop_Qt_5_3_0_MinGW_32bit-Debug\http:\\222.88.91.227\broadcast\sub?channel=910&id=ku6_live" (Invalid argument).main access debug: no access modules matchedmain input error: open of `file:///C:/mycode5.2.1/build-Litter-qi-Desktop_Qt_5_3_0_MinGW_32bit-Debug/http%3A%2F%2F222.88.91.227%2Fbroadcast%2Fsub%3Fchannel%3D910%26id%3Dku6_live' failedmain input error: Your input can't be openedmain input error: VLC is unable to open the MRL 'file:///C:/mycode5.2.1/build-Litter-qi-Desktop_Qt_5_3_0_MinGW_32bit-Debug/http%3A%2F%2F222.88.91.227%2Fbroadcast%2Fsub%3Fchannel%3D910%26id%3Dku6_live'. Check the log for details.奇怪的是我给的地址是http://222.88.91.227/broadcast/sub?channel=910&id=ku6_live,为什么最后播放的地址多了我的工程目录呢,我的代码是- #include "player.h"
- #include <QDebug>
- #include <QImage>
- #include <QDateTime>
- Play::Play(QObject *parent) :
- QObject(parent)
- {
- vlc_ins = NULL;
- vlc_player = NULL;
- vlc_media = NULL;
- Init();
- }
- Play::~Play()
- {
- libvlc_media_player_release (vlc_player);
- libvlc_release (vlc_ins);
- }
- void Play::SetUrl( QString url )
- {
- qDebug()<<"SetUrl";
- fileUrl = url;
- // fileUrl.replace("+","%2B");
- // fileUrl.replace("/","%2F");
- // fileUrl.replace("?","%3F");
- // fileUrl.replace("%","%25");
- // fileUrl.replace("#","%23");
- // fileUrl.replace("&","%%26");
- // fileUrl.replace("=","%3D");
- }
- void Play::Init()
- {
- const char * const vlc_args[] = {
- "-I", "dummy", /* Don't use any interface */
- "--ignore-config", /* Don't use VLC's config */
- "--extraintf=logger", //log anything
- "--verbose=2", //be much more verbose then normal for debugging purpose
- "--plugin-path=C:\\vlc\\plugins",
- "--vout=x11" };
- // init vlc modules, should be done only once
- vlc_ins = libvlc_new (sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args);
- // Create a media player playing environement
- vlc_player = libvlc_media_player_new(vlc_ins);
- }
- bool Play::InitVideoPlayer()
- {
- }
- void Play::OpenMedia()
- {
- qDebug()<<"OpenMedia()"<<fileUrl.toStdString().data();
- //vlc_media = libvlc_media_new_path(vlc_ins, "rtp://@:2626");
- vlc_media = libvlc_media_new_path(vlc_ins, fileUrl.toStdString().data());
- libvlc_media_player_set_media (vlc_player, vlc_media);
- }
- void Play::PlayVideo()
- {
- libvlc_media_player_play (vlc_player);
- qDebug()<<"PlayVideo()";
- }
- void Play::PauseVideo()
- {
- libvlc_media_player_pause (vlc_player);
- }
- void Play::StopVideo()
- {
- libvlc_media_player_stop (vlc_player);
- }
请高手指导我那里错了,说明下,我给的这个网络地址在VLC播放器里面是可以播放的。