2017-06-27 144 views
0

我有使用vlc從相機錄製視頻流的問題。 當我運行命令vlc rtsp://172.X.X.X/live.sdp vlc以適當的方式顯示視頻。當我運行命令使用vlc從相機打開rtsp流

vlc rtsp://172.X.X.X/live.sdp --run-time=5 --sout=file/ps:test6.mpg vlc://quit 

有新創建的文件,但它重量爲0或4K,我無法打開它。在控制檯中我得到了下面的日誌哪裏不對 ?

VLC media player 2.2.2 Weatherwax (revision 2.2.2-0-g6259d80) 
[0000000000a31148] core libvlc: Uruchamianie vlc z domyślnym 
interfejsem. Użyj 'cvlc', aby używać vlc bez interfejsu. 
[00007f42cc003258] mux_ps mux: Open 
[00007f42cc003258] core mux error: cannot add this stream 
[00007f42cc04b168] core decoder error: cannot create packetizer 
output (mlaw) 
[00007f42ec002918] core input error: ES_OUT_RESET_PCR called 
[00007f42cc042988] core decoder error: cannot continue streaming 
due to errors 
[00007f42ec002918] core input error: ES_OUT_RESET_PCR called 
[00007f42cc003258] mux_ps mux: Close 
[00007f42cc003258] idummy demux: command `quit' 
QObject::~QObject: Timers cannot be stopped from another thread 

`

回答

0

我有同樣的問題,因爲你 libvlc_video_get_size成功返回0功能和-1,如果事實並非如此。 起初,你應該得到這個整數,以便看到vlc可以打開url。 令人驚訝地,當我用

  int error = libvlc_video_get_size(vmp, 0, &video_w, &video_h); 

的問題是固定