2017-08-25 92 views
1

我想通过网络流式传输摄像头。我已将USB摄像头连接到i.MX6板,并希望通过网络在Ubuntu14.04/16.04中进行流式传输。在ARM板(i.MX6)中流传输USB网络摄像头

顺便说一下,我已经在i.MX6板上安装了gstreamer和ffmpeg工具。

此外,我可以使用以下ffmpeg命令在Ubuntu14.04 PC中流式传输USB摄像头。但是,如果我在其他Ubuntu16.04中使用ffplay,它也不起作用,我不知道为什么(都是相同的ffmpeg版本)。

ffmpeg -f v4l2 -i /dev/video0 -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f mpegts udp://192.168.0.37:1234 

ffplay udp://192.168.0.37:1234 

的Ubuntu 16.06(不工作)

[email protected]:~/workdir$ ffplay udp://192.168.0.105:1234 
ffplay version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2003-2017 the FFmpeg developers 
    built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609 
    configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv 
    libavutil  54. 31.100/54. 31.100 
    libavcodec  56. 60.100/56. 60.100 
    libavformat 56. 40.101/56. 40.101 
    libavdevice 56. 4.100/56. 4.100 
    libavfilter  5. 40.101/5. 40.101 
    libavresample 2. 1. 0/2. 1. 0 
    libswscale  3. 1.101/3. 1.101 
    libswresample 1. 2.101/1. 2.101 
    libpostproc 53. 3.100/53. 3.100 
    nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0 

的Ubuntu 14.04:(工作)

[email protected]:~$ 
[email protected]:~$ ffplay udp://127.0.0.1:1234 
ffplay version 3.3.2 Copyright (c) 2003-2017 the FFmpeg developers 
    built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3) 
    configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libtheora --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab --enable-libwavpack --enable-nvenc 
    libavutil  55. 58.100/55. 58.100 
    libavcodec  57. 89.100/57. 89.100 
    libavformat 57. 71.100/57. 71.100 
    libavdevice 57. 6.100/57. 6.100 
    libavfilter  6. 82.100/6. 82.100 
    libavresample 3. 5. 0/3. 5. 0 
    libswscale  4. 6.100/4. 6.100 
    libswresample 2. 7.100/2. 7.100 
    libpostproc 54. 5.100/54. 5.100 
[h264 @ 0xb0621660] non-existing PPS 0 referenced sq= 0B f=0/0 
    Last message repeated 1 times 
[h264 @ 0xb0621660] decode_slice_header error 
[h264 @ 0xb0621660] non-existing PPS 0 referenced 
[h264 @ 0xb0621660] decode_slice_header error 
[h264 @ 0xb0621660] non-existing PPS 0 referenced 
[h264 @ 0xb0621660] decode_slice_header error 
[h264 @ 0xb0621660] non-existing PPS 0 referenced 
[h264 @ 0xb0621660] decode_slice_header error 
[h264 @ 0xb0621660] no frame! 
[h264 @ 0xb0621660] non-existing PPS 0 referenced sq= 0B f=0/0 
1751.47 M-V: -0.021 fd= 0 aq= 0KB vq= 11KB sq= 0B f=0/0 
1751.63 M-V: -0.020 fd= 0 aq= 0KB vq= 11KB sq= 0B f=0/0 
1751.80 M-V: -0.020 fd= 0 aq= 0KB vq= 11KB sq= 0B f=0/0 

最后,我想用不同的ARM板,以流。我也无法构建ffplay命令。同样问题与覆盆子pi也。我在这里做错了什么或误解了什么?

+0

看起来有点像防火墙问题。 也许增加'?broadcast = 1'选项可以减轻 文档是[here](https://ffmpeg.org/ffmpeg-protocols.html#udp) – MrBar

+0

不起作用。 ffplay udp://192.168.0.105:1234?broadcast = 1 – Titus

+0

应该添加标志,我的意思是将它添加到ffmpeg命令中 – MrBar

回答

0

您想将iMX6的实时USB摄像头信息流传输到PC。假设我的理解正确,对iMX6

gst-launch-1.0 imxv4l2src device=/dev/video3 ! videoconvert ! queue ! vpuenc_h264 ! rtph264pay ! udpsink host=10.18.0.125 port=5004 

运行下面的管道,并通过我的电脑上运行下面的管道

gst-launch-1.0 udpsrc port=5004 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, payload=(int)96, encoding-name=(string)H264" ! rtph264depay ! avdec_h264 ! xvimagesink 

我可以查看计算机上的USB摄像头流。

相关问题