ffmpeg实时rtmp流长时间未开始处理

ffmpeg实时rtmp流长时间未开始处理,ffmpeg,Ffmpeg,我在h264中使用flash player创建了rtmp流,但当我使用ffmpeg将其转换为视频或tumbnail时,它有时会在很长时间后工作,有时不工作,但如果我在同一台FMS服务器上使用flash Media live encoder创建流,则下面的命令工作正常。同时,如果我在播放器中尝试流,它工作得很好 我使用的IP,所以DNS解决问题是不可能的,我想 ffmpeg-irtmp://xxx.xxx.xx.xx/live/bdeef2c065509361e78fa8cac90aac741cc

我在h264中使用flash player创建了rtmp流,但当我使用ffmpeg将其转换为视频或tumbnail时,它有时会在很长时间后工作,有时不工作,但如果我在同一台FMS服务器上使用flash Media live encoder创建流,则下面的命令工作正常。同时,如果我在播放器中尝试流,它工作得很好

我使用的IP,所以DNS解决问题是不可能的,我想

ffmpeg-irtmp://xxx.xxx.xx.xx/live/bdeef2c065509361e78fa8cac90aac741cc5ee29 -r1-an-updatefirst 1-y thumbnail.jpg

Following is when it worked aftre 15 - 20 minutes 

ffmpeg -i "rtmp://xxx.xxx.xx.xx/live/bdeef2c065509361e78fa8cac90aac741cc5ee29 live=1" -r 1 -an -updatefirst 1 -y thumb.jpg
[root@test ~]# ffmpeg -i rtmp://38.125.41.20/live/bdeef2c065509361e78fa8cac90aac741cc5ee29 -r 1 -an -updatefirst 1 -y thumbnail.jpg
ffmpeg version N-49953-g7d0e3b1-syslint Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb 14 2013 15:29:40 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
  configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-libopencore-amrnb --enable-decoder=liba52 --enable-libopencore-amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-version3 --extra-version=syslint
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.103 / 54. 91.103
  libavformat    54. 63.100 / 54. 63.100
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 37.101 /  3. 37.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[flv @ 0x14c0100] Stream #1: not enough frames to estimate rate; consider increasing probesize
[flv @ 0x14c0100] Could not find codec parameters for stream 1 (Audio: none, 0 channels): unspecified sample format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[flv @ 0x14c0100] Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from 'rtmp://xxx.xxx.xx.xx/bdeef2c065509361e78fa8cac90aac741cc5ee29':
  Metadata:
    keyFrameInterval: 15
    quality         : 90
    level           : 3.1
    bandwith        : 0
    codec           : H264Avc
    fps             : 15
    profile         : baseline
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 15 tbr, 1k tbn, 30 tbc
    Stream #0:1: Audio: none, 0 channels
Output #0, image2, to 'thumbnail.jpg':
  Metadata:
    keyFrameInterval: 15
    quality         : 90
    level           : 3.1
    bandwith        : 0
    codec           : H264Avc
    fps             : 15
    profile         : baseline
    encoder         : Lavf54.63.100
    Stream #0:0: Video: mjpeg, yuvj420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 1 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mjpeg)
Press [q] to stop, [?] for help
frame= 2723 fps=1.3 q=1.6 size=N/A time=00:45:23.00 bitrate=N/A dup=8 drop=12044
通过关闭运行flash player的浏览器来停止流,flash player正在发布视频,我得到以下信息

[flv @ 0x23684e0] Could not find codec parameters for stream 1 (Audio: none, 0 channels): unspecified sample format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[flv @ 0x23684e0] Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from 'rtmp://xxx.xxx.xx.xx/live/bdeef2c065509361e78fa8cac90aac741cc5ee29':
  Metadata:
    keyFrameInterval: 15
    quality         : 90
    bandwith        : 0
    level           : 3.1
    codec           : H264Avc
    fps             : 15
    profile         : baseline
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 15 tbr, 1k tbn, 30 tbc
    Stream #0:1: Audio: none, 0 channels

当我停止流时,它会快速创建一个缩略图文件,其中运行流是一个问题。

我找到了原因和原因,如果由flash not no Mirror selected创建的流,则rtmp发布流中的音频通道为0,因此rtmp的音频编解码器部分进入某种循环,不会返回并继续。我已经找到了原因。但是寻找一种方法来摆脱这种循环,如果没有音频通道。可能需要修改rtmp的源代码并重新编译

见: