关于海康摄像头rtsp视频流传输的问题

weixin_35811558 2016-11-21 03:24:51
手里有一个海康摄像头产生的rtsp视频流,如果想在ubuntu下通过FFmpeg程序让该视频流进行传输,并且能在远程ip上能实时播放,是什么个流程?大神们指点下迷津
...全文
51743 23 打赏 收藏 转发到动态 举报
写回复
用AI写文章
23 条回复
切换为时间正序
请发表友善的回复…
发表回复
leeking888 2017-08-24
  • 打赏
  • 举报
回复
终于找到设置tcp的方式了。
FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(rtspPath);
grabber.setOption("rtsp_transport", "tcp");
grabber.start();
但是问题是,在50帧后,grabber.grab();返回的全部都是null了。想不明白是什么原因。会不会是rtsp传输过来的数据太多,而ffmpeg处理的太慢而导致的呢?
leeking888 2017-08-23
  • 打赏
  • 举报
回复
我使用javacv的FFmpegFrameGrabber获取海康的rtsp实时流也是有这个问题,不知道有没有人如何设置FFmpegFrameGrabber的为tcp的协议。我感觉会不会是grab()处理的太慢,后面的流太大了无法处理导致把前面的数据覆盖而造成的呢? 以下是错误的代码:

Input #0, rtsp, from 'rtsp://admin:123123@192.168.1.64:554/Streaming/Channels/1':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.040000, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709), 2560x1440, 25 fps, 25 tbr, 90k tbn
[swscaler @ 000000001be02720] deprecated pixel format used, make sure you did set range correctly
[rtsp @ 0000000000f8c9a0] max delay reached. need to consume packet
[rtsp @ 0000000000f8c9a0] RTP: missed 4188 packets
[rtsp @ 0000000000f8c9a0] RTP: PT=60: bad cseq 61ae expected=5152
[rtsp @ 0000000000f8c9a0] max delay reached. need to consume packet
[rtsp @ 0000000000f8c9a0] RTP: missed 4189 packets
[rtsp @ 0000000000f8c9a0] max delay reached. need to consume packet
[rtsp @ 0000000000f8c9a0] RTP: missed 96 packets
[h264 @ 000000001a9fbfe0] left block unavailable for requested intra mode
[h264 @ 000000001a9fbfe0] error while decoding MB 0 67, bytestream 23926
[h264 @ 000000001a9fbfe0] concealing 3729 DC, 3729 AC, 3729 MV errors in P frame
[swscaler @ 000000001be02720] deprecated pixel format used, make sure you did set range correctly
[rtsp @ 0000000000f8c9a0] max delay reached. need to consume packet
[rtsp @ 0000000000f8c9a0] RTP: missed 99 packets
weixin_35811558 2016-12-15
  • 打赏
  • 举报
回复
我现在有时也会出现这个问题,也没有完全解决 不过你尝试着把buffer调调整大一些试试,我之前动过FileMaxSize这里出现 你的情况,不过当我调整到100后 解码出现的频率低了很多

SUM_ye 2016-12-07
  • 打赏
  • 举报
回复
楼主,你好,我现在把ffmpeg移植到arm板子上,也出现了解码264文件出错,请教你是怎么解决的?
我看了你和那位大佬的交流信息,发现关于那个好像是加上TCP获取就可以了,但是我用TCP获取之后还是会出现解码错误,另外录制下来的视频明显缺帧
weixin_35811558 2016-11-26
  • 打赏
  • 举报
回复 1
谢谢大哥的一路支持 今天晚上19.22分 总算把视频流在vlc上面播放出来了 我觉得在格式注意的前提下和电脑也有关系,换了三台电脑 在最后一台上实现了 ,真心谢谢
qprevf 2016-11-26
  • 打赏
  • 举报
回复
引用 17 楼 weixin_35811558 的回复:
大哥 谢了这么耐心的教导 这个配置文件 我原封不动的写了 但是问题依旧vlc一打开就停了, (1)关于这个ffsever.conf配置文件的放置和书写有什么讲究么? (2)我尝试着 在
ffserver -f /etc/ffserver.conf
启动时, 打开网页上的
http:localhost:9999/teststat.html
查看ffserver的运行情况,网页是刷不出来的?感觉我的ffserver是没有启动的,这个和我的配置文件有怎么关联呢?还是和安装的过程有关联? (3)大哥有没推荐的安装教程,能让小我对比着研究下 最后真心谢谢,一路的陪伴
你上面的http://localhost:9999/teststat.html少了2个斜杠,我上传的conf里没有添加teststatus的,你需要的话在末尾加上<Stream teststat.html> Format status </Stream> ffserver conf的格式一定要写对,否则可能会出现莫名其妙的问题。ffserver安装很简单,你下个源码包,解压后先进到解压目录,先./configure, 然后make就好了.或则你直接用我编译好的http://download.csdn.net/detail/qprevf/9694322
weixin_35811558 2016-11-26
  • 打赏
  • 举报
回复
大哥 谢了这么耐心的教导 这个配置文件 我原封不动的写了 但是问题依旧vlc一打开就停了, (1)关于这个ffsever.conf配置文件的放置和书写有什么讲究么? (2)我尝试着 在
ffserver -f /etc/ffserver.conf
启动时, 打开网页上的
http:localhost:9999/teststat.html
查看ffserver的运行情况,网页是刷不出来的?感觉我的ffserver是没有启动的,这个和我的配置文件有怎么关联呢?还是和安装的过程有关联? (3)大哥有没推荐的安装教程,能让小我对比着研究下 最后真心谢谢,一路的陪伴
qprevf 2016-11-25
  • 打赏
  • 举报
回复
应该是你ffserver.conf的问题, 你用我的http://download.csdn.net/detail/qprevf/9693715
qprevf 2016-11-25
  • 打赏
  • 举报
回复
你的ffserver,conf就用我给你的,不要改。看你上面log是ffserver挂掉了。我这边用虚拟机测了下,没问题呀
weixin_35811558 2016-11-25
  • 打赏
  • 举报
回复
谢谢提示 但是执行测试的时候问题还是依旧 还望能指出其中的不当之处 ffserver.conf配置文件部分 第一种:
<Feed feed1.ffm>
        File ./feed1.ffm
        FileMaxSize 100M
        ACL allow localhost
</Feed>
还是第二种:
<Feed feed1.ffm>
        File ./feed1.ffm
        FileMaxSize 100M
        ACL allow 127.0.0.1
</Feed>
进行测试,提示的错误均是一样 ffserver部分
bra-fei@brafei-Compaq-CQ45-Notebook-PC:~$ ffserver -f /etc/ffserver.conf
ffserver version N-82475-g83a139e Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --prefix=/home/bra-fei/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/bra-fei/ffmpeg_build/include --extra-ldflags=-L/home/bra-fei/ffmpeg_build/lib --bindir=/home/bra-fei/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
  libavutil      55. 40.100 / 55. 40.100
  libavcodec     57. 66.103 / 57. 66.103
  libavformat    57. 57.100 / 57. 57.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 67.100 /  6. 67.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Fri Nov 25 15:05:09 2016 Codecs do not match for stream 0
Fri Nov 25 15:05:09 2016 [ffm @ 0x2a46fe0]Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Fri Nov 25 15:05:09 2016 FFserver started.
Fri Nov 25 15:05:35 2016 127.0.0.1 - - [GET] "/feed1.ffm HTTP/1.1" 200 4175
Segmentation fault (core dumped)
bra-fei@brafei-Compaq-CQ45-Notebook-PC:~$ 
vlc部分:
url:http://localhost:9999/test.flv
bra-fei@brafei-Compaq-CQ45-Notebook-PC:~$ sudo ufw disable
[sudo] password for bra-fei: 
Firewall stopped and disabled on system startup
bra-fei@brafei-Compaq-CQ45-Notebook-PC:~$ vlc
VLC media player 2.1.6 Rincewind (revision 2.1.6-0-gea01d28)
[0xf3f068] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0x7f5744001088] access_http access error: failed to read answer
[0x7f5744001088] main access error: connection failed: Connection refused
[0x7f5744001088] access_http access error: cannot connect to localhost:9999
[0x7f5744001088] main access error: connection failed: Connection refused
[0x7f5744001088] access_mms access error: cannot connect to localhost:9999
[0x7f5748000c08] main input error: open of `http://localhost:9999/test.flv' failed
ffmpeg部分
ffmpeg -f rtsp -rtsp_transport tcp -i rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream http://localhost:9999/feed1.ffm
提示的错误:
frame=  590 fps= 26 q=3.7 size=    6220kB time=00:00:23.56 bitrate=2162.7kbits/s
frame=  602 fps= 26 q=3.4 size=    6336kB time=00:00:24.04 bitrate=2159.1kbits/s
frame=  616 fps= 26 q=4.0 size=    6460kB time=00:00:24.60 bitrate=2151.2kbits/s
frame=  629 fps= 26 q=3.3 size=    6564kB time=00:00:25.12 bitrate=2140.6kbits/s
frame=  641 fps= 26 q=3.3 size=    6668kB time=00:00:25.60 bitrate=2133.8kbits/s
frame=  654 fps= 26 q=2.7 size=    6780kB time=00:00:26.12 bitrate=2126.4kbits/s
av_interleaved_write_frame(): Connection reset by peer
Error writing trailer of http://localhost:9999/feed1.ffm: Connection reset by peerframe=  666 fps= 26 q=2.3 Lsize=    6916kB time=00:00:26.60 bitrate=2129.9kbits/s dup=0 drop=4 speed=1.03x    
video:6878kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.556541%
Conversion failed!
bra-fei@brafei-Compaq-CQ45-Notebook-PC:~$ 
没打开vlc之前,感觉ffmpeg应该已经和ffserver链接起来,应该将视频流传送到ip的监听端口了,按照提示也没整出什么来,指点下迷津,谢谢, 备注:ffmpeg安装完成以后所有的函数我没动过,
qprevf 2016-11-24
  • 打赏
  • 举报
回复
vlc打开的链接是http://IP:9999/test.flv, IP是ffserver的IP
weixin_35811558 2016-11-24
  • 打赏
  • 举报
回复
真心感谢一路的指导 将UDP方式强制转换成TCP后,RTP再也不会出现丢包的现象,本想再打开vlc进行播放的时候,折腾着还是出现了错误,还请您能再耐心指导下
bra-fei@brafei-Compaq-CQ45-Notebook-PC:~$ sudo ufw disable
[sudo] password for bra-fei: 
Firewall stopped and disabled on system startup
bra-fei@brafei-Compaq-CQ45-Notebook-PC:~$ vlc
VLC media player 2.1.6 Rincewind (revision 2.1.6-0-gea01d28)
[0x157f068] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0x7f538c0026c8] main stream error: cannot pre fill buffer
[0x7f538c0026c8] main stream error: cannot pre fill buffer
[0x7f538c0026c8] main stream error: cannot pre fill buffer
bra-fei@brafei-Compaq-CQ45-Notebook-PC:~$ vlc
VLC media player 2.1.6 Rincewind (revision 2.1.6-0-gea01d28)
[0x23f1068] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0x7fe568000fa8] access_http access error: failed to read answer
[0x7fe568000fa8] main access error: connection failed: Connection refused
[0x7fe568000fa8] access_http access error: cannot connect to localhost:9999
[0x7fe568000fa8] main access error: connection failed: Connection refused
[0x7fe568000fa8] access_mms access error: cannot connect to localhost:9999
[0x7fe570000c08] main input error: open of `http://localhost:9999/test.flv' failed

frame=18194 fps= 25 q=4.8 size=  178988kB time=00:12:07.72 bitrate=2014.9kbits/s
frame=18208 fps= 25 q=4.9 size=  179112kB time=00:12:08.28 bitrate=2014.7kbits/s
frame=18221 fps= 25 q=4.4 size=  179228kB time=00:12:08.80 bitrate=2014.6kbits/s
frame=18233 fps= 25 q=4.2 size=  179348kB time=00:12:09.28 bitrate=2014.6kbits/s
frame=18246 fps= 25 q=5.6 size=  179496kB time=00:12:09.80 bitrate=2014.8kbits/s
frame=18260 fps= 25 q=4.1 size=  179608kB time=00:12:10.36 bitrate=2014.6kbits/s
frame=18274 fps= 25 q=4.0 size=  179716kB time=00:12:10.92 bitrate=2014.2kbits/s
frame=18287 fps= 25 q=3.9 size=  179860kB time=00:12:11.44 bitrate=2014.4kbits/s
frame=18300 fps= 25 q=4.0 size=  179976kB time=00:12:11.96 bitrate=2014.3kbits/s
av_interleaved_write_frame(): Connection reset by peer
Error writing trailer of http://localhost:9999/feed1.ffm: Connection reset by peerframe=18306 fps= 25 q=5.3 Lsize=  180084kB time=00:12:12.20 bitrate=2014.8kbits/s dup=0 drop=4 speed=   1x    
video:179175kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.507253%
Conversion failed!
qprevf 2016-11-24
  • 打赏
  • 举报
回复
你这个是ffmepg连接ffserver时, 被ffserver拒绝了,你把ffserver重启下
weixin_35811558 2016-11-24
  • 打赏
  • 举报
回复
谢谢指导,我觉得也是的 但是 更改以后查看提示的错误 似乎还是 ffmpeg无法连接到 摄像头 还望指教
little-fly@ubuntu:~$ ffmpeg -f rtsp -rtsp_transport tcp -i rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream http://localhost:9999/feed1.ffm
ffmpeg version 2.4.3 Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  8 2016 05:20:06 with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --enable-shared --prefix=/usr/local/ffmpeg
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
Input #0, rtsp, from 'rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.240000, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuv420p, 1280x720, 25 fps, 25 tbr, 90k tbn, 50 tbc
[http @ 0x26578c0] HTTP error 503 Server too busy
http://localhost:9999/feed1.ffm: Input/output error
qprevf 2016-11-24
  • 打赏
  • 举报
回复
看样子是UDP 方式导致RTP丢包, 你还是用TCP来试试, 我昨天给你的命令粘贴时弄错了,应该是这样的ffmpeg -f rtsp -rtsp_transport tcp -i rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream http://localhost:9999/feed1.ffm,
weixin_35811558 2016-11-24
  • 打赏
  • 举报
回复
谢谢您的真情教诲,今天我把启动格式改了下,强制转换成TCP协议,但是链接依旧被拒绝,折腾来也没任何起色
little-fly@ubuntu:~$ ffmpeg -f rtsp -i -rtsp_transport tcp rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream http://localhost:9999/feed1.ffm
ffmpeg version 2.4.3 Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  8 2016 05:20:06 with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --enable-shared --prefix=/usr/local/ffmpeg
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
[tcp @ 0x22ad8a0] Connection to tcp://:554?timeout=0 failed (Connection refused), trying next address
[tcp @ 0x22ad8a0] Connection to tcp://:554?timeout=0 failed: Connection refused
-rtsp_transport: Input/output error
于是在另外一台笔记本ubuntu系统上从新跑了一次 (不是虚拟机),链接的问题没有出现但是却会有如下的故障
bra-fei@brafei-Compaq-CQ45-Notebook-PC:~$ ffmpeg -f rtsp -i rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream http://localhost:9999/feed1.ffm
ffmpeg version N-82475-g83a139e Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --prefix=/home/bra-fei/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/bra-fei/ffmpeg_build/include --extra-ldflags=-L/home/bra-fei/ffmpeg_build/lib --bindir=/home/bra-fei/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
  libavutil      55. 40.100 / 55. 40.100
  libavcodec     57. 66.103 / 57. 66.103
  libavformat    57. 57.100 / 57. 57.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 67.100 /  6. 67.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, rtsp, from 'rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.240000, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuv420p(progressive), 1280x720, 25 fps, 25 tbr, 90k tbn, 50 tbc
Output #0, ffm, to 'http://localhost:9999/feed1.ffm':
  Metadata:
    title           : Media Presentation
    creation_time   : now
    encoder         : Lavf57.57.100
    Stream #0:0: Video: flv1 (flv), yuv420p, 1280x720, q=2-31, 2000 kb/s, 25 fps, 1000k tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.66.103 flv
    Side data:
      cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 0 vbv_delay: -1
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> flv1 (flv))
Press [q] to stop, [?] for help
[rtsp @ 0x31f43a0] max delay reached. need to consume packet
[rtsp @ 0x31f43a0] RTP: missed 15 packets
frame=   32 fps=0.0 q=2.0 size=     476kB time=00:00:01.24 bitrate=3144.7kbits/s[rtsp @ 0x31f43a0] max delay reached. need to consume packet
[rtsp @ 0x31f43a0] RTP: missed 28 packets
[h264 @ 0x32fd080] out of range intra chroma pred mode
[h264 @ 0x32fd080] error while decoding MB 77 8
[h264 @ 0x32fd080] concealing 2932 DC, 2932 AC, 2932 MV errors in I frame
frame=   42 fps= 42 q=2.0 size=     640kB time=00:00:01.64 bitrate=3196.9kbits/sframe=   57 fps= 37 q=2.1 size=     844kB time=00:00:02.24 bitrate=3086.6kbits/sframe=   70 fps= 34 q=2.6 size=    1012kB time=00:00:02.76 bitrate=3003.7kbits/sframe=   83 fps= 33 q=3.1 size=    1172kB time=00:00:03.28 bitrate=2927.1kbits/s[rtsp @ 0x31f43a0] max delay reached. need to consume packet
[rtsp @ 0x31f43a0] RTP: missed 10 packets
[h264 @ 0x32fd080] out of range intra chroma pred mode
[h264 @ 0x32fd080] error while decoding MB 75 8
[h264 @ 0x32fd080] concealing 2934 DC, 2934 AC, 2934 MV errors in I frame
frame=   96 fps= 31 q=4.7 size=    1320kB time=00:00:03.80 bitrate=2845.6kbits/sframe=  109 fps= 30 q=2.5 size=    1560kB time=00:00:04.32 bitrate=2958.2kbits/sframe=  122 fps= 30 q=5.6 size=    1676kB time=00:00:04.84 bitrate=2836.7kbits/sframe=  135 fps= 29 q=7.4 size=    1792kB time=00:00:05.36 bitrate=2738.8kbits/s[rtsp @ 0x31f43a0] max delay reached. need to consume packet
[rtsp @ 0x31f43a0] RTP: missed 39 packets
[h264 @ 0x32fd080] corrupted macroblock 5 10 (total_coeff=-1)
[h264 @ 0x32fd080] error while decoding MB 5 10
[h264 @ 0x32fd080] concealing 2844 DC, 2844 AC, 2844 MV errors in I frame
frame=  148 fps= 29 q=10.3 size=    1904kB time=00:00:05.88 bitrate=2652.6kbits/frame=  161 fps= 28 q=9.8 size=    2020kB time=00:00:06.40 bitrate=2585.6kbits/s dup=0 drop=4 speed=1.13x    
[3]+  Stopped                 ffmpeg -f rtsp -i rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream http://localhost:9999/feed1.ffm
劳烦能再指导下么?
qprevf 2016-11-23
  • 打赏
  • 举报
回复
如果你是虚拟机的话,你需要ffmpeg -f rtsp -rtsp_transport tcp -i rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream http://localhost:9999/feed1.ffm, 指定用TCP方式传递R
引用 6 楼 weixin_35811558 的回复:
真心谢谢您的耐心的指导 环境是这样的 我是台式机,在win10下安装了VMware虚拟机 虚拟机里面安装了ubuntu14.04 台式机通过无线网卡链接到小米路由器 海康威视摄像头通过网线链接在路由器上 理论上 台式机和摄像头在同一局域网下 通过 win10 下的vlc 和虚拟机下的vlc均可以在输入视频流的时候查看到摄像头的视频流
ffmpeg -f rtsp -i -rtsp_transport tcp rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream http://localhost:9999/feed1.ffm 强制使用TCP方式试下, 默认是udp的
weixin_35811558 2016-11-23
  • 打赏
  • 举报
回复
真心谢谢您的耐心的指导 环境是这样的 我是台式机,在win10下安装了VMware虚拟机 虚拟机里面安装了ubuntu14.04 台式机通过无线网卡链接到小米路由器 海康威视摄像头通过网线链接在路由器上 理论上 台式机和摄像头在同一局域网下 通过 win10 下的vlc 和虚拟机下的vlc均可以在输入视频流的时候查看到摄像头的视频流
qprevf 2016-11-23
  • 打赏
  • 举报
回复
引用 4 楼 weixin_35811558 的回复:
谢谢您的耐心,昨天回复您时候,马虎打错了vlc的输入, 按照您的方法再修改了下,不知道是不是打开的方式不对,提示的错误还在,特把操作过程贴出来,还请帮我看下指出其中的不当之处 配置文件:
sudo vi /etc/ffserver.conf
HTTPPort 9999
RTSPPort 9990

HTTPBindAddress 0.0.0.0

MaxHTTPConnections 2000

MaxClients 1000
MaxBandwidth 1000

CustomLog -

<Feed feed1.ffm>
        File ./feed1.ffm
        FileMaxSize 10M
        ACL allow localhost
</Feed>
<Stream test.flv>
        Feed feed1.ffm
        Format flv
#       VideoCodec libx264
        VideoFrameRate 25
        VideoBitRate 2000
        VideoSize 1280x720
#       AVPresetVideo default
#       AVPresetVideo baseline
        AVOptionVideo flags +global_header
#       AudioBitRate 24
#       AudioChannels 1
#       AudioSampleRate 44100
        AVOptionAudio flags +global_header
</Stream>

<Stream teststat.html>
        Format status
</Stream>
开启ffserver
 ffserver -f /etc/ffserver.conf

ffserver version 2.4.3 Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  8 2016 05:20:06 with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --enable-shared --prefix=/usr/local/ffmpeg
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
Wed Nov 23 19:06:22 2016 FFserver started
开启ffmpeg提示了个错误
 ffmpeg -f rtsp -i rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream http://localhost:9999/feed1.ffm

ffmpeg version 2.4.3 Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  8 2016 05:20:06 with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --enable-shared --prefix=/usr/local/ffmpeg
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
[rtsp @ 0x11cfc20] UDP timeout, retrying with TCP
[rtsp @ 0x11cfc20] method PAUSE failed: 551 Option not supported
[rtsp @ 0x11cfc20] Could not find codec parameters for stream 0 (Video: h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream: could not find codec parameters
Input #0, rtsp, from 'rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream':
  Metadata:
    title           : Media Presentation
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264, 90k tbr, 90k tbn, 180k tbc
[http @ 0x11f3b20] HTTP error 503 Server too busy
http://localhost:9999/feed1.ffm: Input/output error
其中的rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream是我摄像头的视频流部分,ffmpeg这个程序我只完成编译安装,编码配置文件什么的没有动过,还请指出面对这个错误时,该从哪里入手,尝试了很久也没有进展
这是你的ffmpeg没法连上摄像头, 能告知你的网络环境吗?你的Ubuntu是在虚拟机的环境下,然后摄像头跟电脑在一个局域网?
weixin_35811558 2016-11-23
  • 打赏
  • 举报
回复
谢谢您的耐心,昨天回复您时候,马虎打错了vlc的输入, 按照您的方法再修改了下,不知道是不是打开的方式不对,提示的错误还在,特把操作过程贴出来,还请帮我看下指出其中的不当之处 配置文件:
sudo vi /etc/ffserver.conf
HTTPPort 9999
RTSPPort 9990

HTTPBindAddress 0.0.0.0

MaxHTTPConnections 2000

MaxClients 1000
MaxBandwidth 1000

CustomLog -

<Feed feed1.ffm>
        File ./feed1.ffm
        FileMaxSize 10M
        ACL allow localhost
</Feed>
<Stream test.flv>
        Feed feed1.ffm
        Format flv
#       VideoCodec libx264
        VideoFrameRate 25
        VideoBitRate 2000
        VideoSize 1280x720
#       AVPresetVideo default
#       AVPresetVideo baseline
        AVOptionVideo flags +global_header
#       AudioBitRate 24
#       AudioChannels 1
#       AudioSampleRate 44100
        AVOptionAudio flags +global_header
</Stream>

<Stream teststat.html>
        Format status
</Stream>
开启ffserver
 ffserver -f /etc/ffserver.conf

ffserver version 2.4.3 Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  8 2016 05:20:06 with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --enable-shared --prefix=/usr/local/ffmpeg
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
Wed Nov 23 19:06:22 2016 FFserver started
开启ffmpeg提示了个错误
 ffmpeg -f rtsp -i rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream http://localhost:9999/feed1.ffm

ffmpeg version 2.4.3 Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  8 2016 05:20:06 with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --enable-shared --prefix=/usr/local/ffmpeg
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
[rtsp @ 0x11cfc20] UDP timeout, retrying with TCP
[rtsp @ 0x11cfc20] method PAUSE failed: 551 Option not supported
[rtsp @ 0x11cfc20] Could not find codec parameters for stream 0 (Video: h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream: could not find codec parameters
Input #0, rtsp, from 'rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream':
  Metadata:
    title           : Media Presentation
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264, 90k tbr, 90k tbn, 180k tbc
[http @ 0x11f3b20] HTTP error 503 Server too busy
http://localhost:9999/feed1.ffm: Input/output error
其中的rtsp://admin:SELJQJ00@192.168.31.247:554/h264/ch1/main/av_stream是我摄像头的视频流部分,ffmpeg这个程序我只完成编译安装,编码配置文件什么的没有动过,还请指出面对这个错误时,该从哪里入手,尝试了很久也没有进展
加载更多回复(3)

1,451

社区成员

发帖
与我相关
我的任务
社区描述
多媒体/设计/Flash/Silverlight 开发 图象工具使用
社区管理员
  • 图象工具使用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧