2014-01-13 210 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>