2017-04-25 36 views
0

libvlc를 사용하여 RTSP 스트림을 재생하려고합니다. 여기 내 코드입니다 :libvlc를 사용하여 RTSP 스트림을 재생하는 방법

MainWindow::MainWindow(QWidget *parent) : 
    QMainWindow(parent), 
    ui(new Ui::MainWindow) 
{ 
    ui->setupUi(this); 

    const char* fileName = "rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov"; 
    int windId = this->winId(); 

    libvlc_instance_t *instance = libvlc_new(0, NULL); 
    libvlc_media_t *vlcMedia = libvlc_media_new_location(instance, fileName); 
    libvlc_media_player_t* player = libvlc_media_player_new_from_media(vlcMedia); 

    libvlc_media_player_set_xwindow(player, windId); 
    libvlc_media_player_play(player); 
} 

그리고 문제가 libvlc이 같은 서버로 설정 명령을 보낼 것입니다 :

SETUP rtsp://184.72.239.149:554/vod/mp4://bigbuckbunny_175k.mov RTSP/1.0 

그것은 VLC 플레이어에서 completelty 다릅니다. vlc 플레이어가 보내는 내용은 다음과 같습니다.

SETUP rtsp://184.72.239.149:554/vod/mp4://bigbuckbunny_175k.mov/trackID=0 
SETUP rtsp://184.72.239.149:554/vod/mp4://bigbuckbunny_175k.mov/trackID=1 

답변

0

libvlc에는 여러 개의 RTSP 액세스 플러그인이 있습니다. realrtsp 대신 live555를 사용하고 있는지 확인하십시오.