2014-01-13 159 views
0

我試圖使用avserver包來重新流式傳輸我的IP攝像機的流,以便能夠記錄此流並以remotelly方式訪問它,而不必從第攝像頭,以避免無線網絡過載。使用'avserver'流輸入到流輸出

繼鏈接https://libav.org/avserver.html,我想出了下面的命令:

avserver -f /etc/avserver.conf & avconv -i http://user:[email protected]/videostream.asf http://localhost:80/feed1.ffm 

這給了我下面的輸出

avserver version 0.8.3-6:0.8.3-6ubuntu2, Copyright (c) 2000-2012 the Libav developers 
built on Oct 1 2012 15:03:26 with gcc 4.7.2 
avconv version 0.8.3-6:0.8.3-6ubuntu2, Copyright (c) 2000-2012 the Libav developers 
built on Oct 1 2012 15:03:26 with gcc 4.7.2 
Mon Jan 13 20:13:44 2014 AVserver started. 
[asf @ 0x153cac0] max_analyze_duration reached 
[asf @ 0x153cac0] Estimating duration from bitrate, this may be inaccurate 
Input #0, asf, from 'http://admin:[email protected]/videostream.asf': 
Duration: N/A, start: 0.000000, bitrate: 32 kb/s 
Stream #0.0: Video: mjpeg, yuvj422p, 320x240, 100 tbr, 1k tbn, 1k tbc 
Stream #0.1: Audio: adpcm_ima_wav, 8000 Hz, 1 channels, s16, 32 kb/s 
Incompatible pixel format 'yuvj422p' for codec 'mpeg1video', auto-selecting format 'yuv420p' 
[buffer @ 0x153ec80] w:320 h:240 pixfmt:yuvj422p 
[avsink @ 0x1544820] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out' 
[scale @ 0x1543460] w:320 h:240 fmt:yuvj422p -> w:320 h:240 fmt:yuv420p flags:0x4 
[mp2 @ 0x1544aa0] Requested sampling rate unsupported using closest supported (16000) 
Mon Jan 13 20:13:50 2014 Feed '/tmp/feed1.ffm.ffm' stream number does not match registered feed 
Output #0, ffm, to 'http://localhost:80/feed1.ffm': 
Metadata: 
encoder   : Lavf53.21.0 
Stream #0.0: Video: mpeg1video, yuv420p, 320x240 [PAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 1000k tbn, 60 tbc 
Stream #0.1: Audio: mp2, 16000 Hz, 1 channels, s16, 128 kb/s 
Stream mapping: 
Stream #0:0 -> #0:0 (mjpeg -> mpeg1video) 
Stream #0:1 -> #0:1 (adpcm_ima_wav -> mp2) 
Press ctrl-c to stop encoding 
Mon Jan 13 20:13:50 2014 127.0.0.1 - - [POST] "/feed1.ffm HTTP/1.1" 200 4096 

當我嘗試通過VLC media player打開這個流,使用

http://192.168.1.15/test.asf 

我收到以下附加信息輸出

Mon Jan 13 20:17:39 2014 192.168.1.6 - - [GET] "/test.asf HTTP/1.1" 200 115s dup=12210 drop=0 
Mon Jan 13 20:17:39 2014 Codec for stream 0 does not use global headers but container format requires global headers 
Mon Jan 13 20:17:39 2014 Codec for stream 1 does not use global headers but container format requires global headers 

而我在VLC媒體播放器上什麼也沒得到。我不太確定究竟發生了什麼或如何修復,所以對此的任何啓發都將非常受歡迎。

+0

的註釋掉部分添加'AVOptionVideo標誌+ global_header''AVOptionAudio標誌+ global_header'在avserver.conf 標籤 –

回答

0

請嘗試使用其他格式,如MP3

只是

須藤的vim /etc/avserver.conf

註釋掉與

#<stream test.asf> 
#</Stream> 

取消對MP3節段,並嘗試使用它。

<stream test.mp3></Stream> 

如果您使用只有音頻的數據流,這將起作用。

的視頻

只是使用

<Stream test1.mgp><Stream>