使用ffmpeg / avconv将流式摄像头传输到RTMP libx264不起作用

时间:2016-03-15 09:07:56

标签: rtmp avconv

我一直在尝试使用RTMP将我的网络摄像头流式传输到Ustream。

使用标准命令效果很好:

  

“avconv -f video4linux2 -r 25 -s 320x240 -i / dev / video0 -f flv rtmp:// host / pass”

但我加入了 15 秒的延迟! 因此我决定使用libx264压缩视频。 我下载并确认它已正确安装。 但是在运行此命令时:

  

“avconv -f video4linux2 -r 25 -s 320x240 -i / dev / video0 -c:v libx264 -pix_fmt yuv420p -f flv rtmp:// host / pass”

关于ffmpeg我得到“非法指令” 并且在avconv下它开始流,但在Ustream频道中没有显示任何内容。

avconv命令的输出

avconv version 9.14-6:9.14-1rpi1rpi1, Copyright (c) 2000-2014 the
Libav developers
built on Jul 22 2014 15:08:12 with gcc 4.6 (Debian 4.6.3-14+rpi1)
[video4linux2 @ 0x709740] The driver changed the time per frame from 1/5 to 1/30
    [video4linux2 @ 0x709740] Estimating duration from bitrate, this may
    be inaccurate
    Input #0, video4linux2, from '/dev/video0':
      Duration: N/A, start: 5069.991764, bitrate: 36864 kb/s
        Stream #0.0: Video: rawvideo, yuyv422, 320x240, 36864 kb/s, 1000k    tbn, 30 tbc
    [libx264 @ 0x70a9e0] using cpu capabilities: none!
    [libx264 @ 0x70a9e0] profile High, level 1.2
    [libx264 @ 0x70a9e0] 264 - core 130 r2282 1db4621 - H.264/MPEG-4 AVC
    codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html -
    options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7
    psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1
    8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2
    threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1
    interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2
    b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250
    keyint_min=5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf
    mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.25
    aq=1:1.00
    Output #0, flv, to
    'rtmp:host/pass:
      Metadata:
        encoder         : Lavf54.20.4
        Stream #0.0: Video: libx264, yuv420p, 320x240, q=-1--1, 1k tbn, 5 tbc
    Stream mapping:
      Stream #0:0 -> #0:0 (rawvideo -> libx264)
    Press ctrl-c to stop encoding
    frame=   44 fps=  3 q=23.0 size=      26kB time=0.20
    bitrate=1071.8kbits/s    bits/s

可能是什么问题? 先谢谢你了

0 个答案:

没有答案