[FFmpeg-user] Live streams

undefined 670292548 at qq.com
Tue Aug 13 06:56:50 CEST 2013


Hi,
I have solved the problem of "Could not write header for output file" by changing the output format to flv with your last help. Thanks again. But I found an irregular error these days.


If I publish a live stream(in the format of H264 & AAC) to AMS 5, and start a ffmpeg to output another live stream, it works all the time. Here's the cmd(on windows 7):
C:\Users\Administrator>ffmpeg -re -y -i "rtmp://localhost/xolive/FDR3XTT7 live=1" -c:a libvo_aacenc -c:v libx264 -b:v 900k -b:a 96k -s 960*540 -f flv "rtmp://localhost/xolive/FDR3XTT7_540"


However, if I start another ffmpeg to convert the same input stream into another live stream, even if converting another live stream, it fails at times. And the output stream can not be play at times even though the outputting succeed. But, there're no much differences between these cmds.


Here's the uncut log:
C:\Users\Administrator>ffmpeg -re -y -i "rtmp://localhost/xolive/G0NKYAKZ live=1" -c:a libvo_aacenc -c:v libx264 -b:v 90
0k -b:a 96k -s 960*540 -f flv "rtmp://localhost/xolive/G0NKYAKZ_540"
ffmpeg version N-54857-gf9f7f4c Copyright (c) 2000-2013 the FFmpeg developers
  built on Jul 21 2013 20:04:40 with gcc 4.7.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfi
g --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopenco
re-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-lib
vpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 40.100 / 52. 40.100
  libavcodec     55. 18.102 / 55. 18.102
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 81.102 /  3. 81.102
  libswscale      2.  4.100 /  2.  4.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Received FLV packet before play()! Ignoring.
Received FLV packet before play()! Ignoring.
Received FLV packet before play()! Ignoring.
Received FLV packet before play()! Ignoring.
Received FLV packet before play()! Ignoring.
Received FLV packet before play()! Ignoring.
Received FLV packet before play()! Ignoring.
Received FLV packet before play()! Ignoring.
Received FLV packet before play()! Ignoring.
Received FLV packet before play()! Ignoring.
Metadata:
  duration              0.00
  fileSize              0.00
  width                 1280.00
  height                720.00
  videocodecid          avc1
  videodatarate         3600.00
  framerate             30.00
  audiocodecid          mp4a
  audiodatarate         256.00
  audiosamplerate       44100.00
  audiosamplesize       16.00
  audiochannels         2.00
  stereo                TRUE
  encoder               Open Broadcaster Software v0.542b
[flv @ 00000000025cdaa0] Stream discovered after head already parsed
[h264 @ 000000000265b640] no frame!
    Last message repeated 31 times
[h264 @ 000000000265b640] non-existing SPS 32 referenced in buffering period
[h264 @ 000000000265b640] no frame!
    Last message repeated 36 times
rtmp server sent error
[h264 @ 000000000265b640] no frame!
    Last message repeated 171 times
[h264 @ 000000000265b640] slice type too large (24) at 0 0
[h264 @ 000000000265b640] decode_slice_header error
[h264 @ 000000000265b640] no frame!
    Last message repeated 4 times
[flv @ 00000000025cdaa0] decoding for stream 1 failed
[flv @ 00000000025cdaa0] Could not find codec parameters for stream 1 (Video: h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, flv, from 'rtmp://localhost/xolive/G0NKYAKZ live=1':
  Metadata:
    fileSize        : 0
    audiochannels   : 2
    encoder         : Open Broadcaster Software v0.542b
  Duration: 00:00:00.00, start: 0.069000, bitrate: N/A
    Stream #0:0: Audio: aac, 44100 Hz, stereo, fltp, 262 kb/s
    Stream #0:1: Video: h264, 30 tbr, 1k tbn
Output #0, flv, to 'rtmp://localhost/xolive/G0NKYAKZ_540':
  Metadata:
    fileSize        : 0
    audiochannels   : 2
    encoder         : Lavf55.12.102
    Stream #0:0: Audio: aac (libvo_aacenc) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, s16, 96 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (aac -> libvo_aacenc)
Press [q] to stop, [?] for help
[flv @ 0000000004a766e0] Failed to update header with correct duration.
[flv @ 0000000004a766e0] Failed to update header with correct filesize.
size=      37kB time=00:00:03.06 bitrate=  99.4kbits/s
video:0kB audio:35kB subtitle:0 global headers:0kB muxing overhead 6.860684%


The log would still show the converted progress. But it's different from the normal one.
Normal: 
frame=17381 fps= 25 q=-1.0 Lsize=   35321kB time=00:11:36.19 bitrate= 415.6kbits
/s dup=0 drop=162

Error:
size=      63kB time=00:00:05.04 bitrate= 103.0kbits/s





Otherwise, I want to convert the live streams into two or more live streams.






Best Regards,
Lane


More information about the ffmpeg-user mailing list