RTMP output - "Past duration too large"
I'm trying to use ffmpeg to livestream to an online service such as ustream. This is the command I am using - ffmpeg -i rtsp://RTSPStreamUrl -an -f avi rtmp://RTMPStreamUrl It keeps returning a long list of errors all saying "Past duration X.XXXXXX too large", the number is changing however, increasing the longer I leave the stream running. Is this because the frames in my stream are too large? What can I do to stop this from happening. Here is a screenshot of the output. [image: Inline image 1]
On 2/23/2015 4:26 PM, Matt Conway wrote:
I'm trying to use ffmpeg to livestream to an online service such as ustream.
This is the command I am using -
ffmpeg -i rtsp://RTSPStreamUrl -an -f avi rtmp://RTMPStreamUrl
-f avi is wrong. use -f flv.
Here is a screenshot of the output.
firstly, for any other issues, you *must* always provide full console/error output of your command by copy/paste here. sending a screenshot is not very helpful. secondly, that's *not* the output of your above command. you use a different command in the picture. if you want help, please help people on this mailing list by being consistent. -- Claudiu
On Mon, Feb 23, 2015 at 2:44 PM, Claudiu Rad <jazzman@misalpina.net> wrote: "-f avi is wrong. use -f flv." Yes sorry, you're correct I am using two very similar commands in different scripts and I copied the wrong one. "firstly, for any other issues, you *must* always provide full console/error output of your command by copy/paste here. sending a screenshot is not very helpful. secondly, that's *not* the output of your above command. you use a different command in the picture. if you want help, please help people on this mailing list by being consistent."
Unfortunately I only have the console output for this particular error in that screenshot and I can't replicate it now for some reason. I have the console output for the same command on a Raspberry Pi, which is returning a different error in a similar fashion. I have put this code below. pi@raspberrypi ~ $ ./piustream.sh ffmpeg version N-69945-g2280552 Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.6 (Debian 4.6.3-14+rpi1) configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree libavutil 54. 18.100 / 54. 18.100 libavcodec 56. 22.100 / 56. 22.100 libavformat 56. 22.100 / 56. 22.100 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 11.100 / 5. 11.100 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 3.100 / 53. 3.100 Input #0, rtsp, from 'rtsp:// root:FishAxisFood12@192.168.0.4/axis-media/media.amp': Metadata: title : Media Presentation Duration: N/A, start: 0.033333, bitrate: N/A Stream #0:0: Video: h264 (Baseline), yuvj420p(pc, bt709), 800x450 [SAR 1:1 DAR 16:9], 30 tbr, 90k tbn, 180k tbc [swscaler @ 0x2b98bb0] deprecated pixel format used, make sure you did set range correctly Output #0, flv, to 'rtmp:// 1.20006911.fme.ustream.tv/ustreamVideo/20006911/9gjxU2DxvaUJDQZ9Yc6eGweKwV6Y2E7a ': Metadata: title : Media Presentation encoder : Lavf56.22.100 Stream #0:0: Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p, 800x450 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 1k tbn, 30 tbc Metadata: encoder : Lavc56.22.100 flv Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> flv1 (flv)) Press [q] to stop, [?] for help [NULL @ 0x2ba2b10] RTP: missed 2 packetskB time=00:00:04.56 bitrate= 871.9kbits/s [NULL @ 0x2ba2b10] RTP: missed 1 packets Last message repeated 3 times [NULL @ 0x2ba2b10] RTP: missed 1 packetskB time=00:00:04.96 bitrate= 832.1kbits/s Last message repeated 1 times [NULL @ 0x2ba2b10] RTP: missed 24 packets [h264 @ 0x2cdde50] concealing 1434 DC, 1434 AC, 1434 MV errors in I frame [NULL @ 0x2ba2b10] RTP: missed 1 packets Last message repeated 4 times [NULL @ 0x2ba2b10] RTP: missed 1 packetskB time=00:00:05.63 bitrate= 736.1kbits/s [NULL @ 0x2ba2b10] RTP: missed 3 packets [NULL @ 0x2ba2b10] RTP: missed 1 packets [NULL @ 0x2ba2b10] RTP: missed 1 packetskB time=00:00:06.23 bitrate= 689.1kbits/s Last message repeated 3 times [NULL @ 0x2ba2b10] RTP: missed 2 packets [NULL @ 0x2ba2b10] RTP: missed 1 packets Last message repeated 1 times [NULL @ 0x2ba2b10] RTP: missed 1 packetskB time=00:00:06.60 bitrate= 670.5kbits/s Last message repeated 2 times [NULL @ 0x2ba2b10] RTP: missed 2 packets [NULL @ 0x2ba2b10] RTP: missed 1 packets [NULL @ 0x2ba2b10] RTP: missed 1 packetskB time=00:00:07.13 bitrate= 622.3kbits/s [NULL @ 0x2ba2b10] RTP: missed 22 packets [h264 @ 0x2cde4d0] concealing 1434 DC, 1434 AC, 1434 MV errors in I frame [NULL @ 0x2ba2b10] RTP: missed 1 packets [NULL @ 0x2ba2b10] RTP: missed 3 packets [NULL @ 0x2ba2b10] RTP: missed 2 packets [NULL @ 0x2ba2b10] RTP: missed 1 packets [NULL @ 0x2ba2b10] RTP: missed 1 packetskB time=00:00:07.76 bitrate= 589.0kbits/s Last message repeated 3 times [NULL @ 0x2ba2b10] RTP: missed 1 packetskB time=00:00:08.33 bitrate= 565.7kbits/s [NULL @ 0x2ba2b10] RTP: missed 4 packets [NULL @ 0x2ba2b10] RTP: missed 1 packets Last message repeated 2 times [NULL @ 0x2ba2b10] RTP: missed 1 packetskB time=00:00:08.66 bitrate= 545.7kbits/s Last message repeated 2 times [NULL @ 0x2ba2b10] RTP: missed 2 packets [NULL @ 0x2ba2b10] RTP: missed 1 packetskB time=00:00:09.20 bitrate= 528.6kbits/s [NULL @ 0x2ba2b10] RTP: missed 22 packets [h264 @ 0x2cdd870] concealing 1431 DC, 1431 AC, 1431 MV errors in I frame [NULL @ 0x2ba2b10] RTP: missed 1 packets Last message repeated 1 times [NULL @ 0x2ba2b10] RTP: missed 3 packets [NULL @ 0x2ba2b10] RTP: missed 1 packets [NULL @ 0x2ba2b10] RTP: missed 1 packetskB time=00:00:09.83 bitrate= 508.2kbits/s Last message repeated 1 times [NULL @ 0x2ba2b10] RTP: missed 2 packetskB time=00:00:10.36 bitrate= 483.4kbits/s [NULL @ 0x2ba2b10] RTP: missed 1 packets [NULL @ 0x2ba2b10] RTP: missed 2 packets [NULL @ 0x2ba2b10] RTP: missed 1 packetskB time=00:00:10.63 bitrate= 484.0kbits/s Last message repeated 3 times [NULL @ 0x2ba2b10] RTP: missed 23 packetsB time=00:00:11.50 bitrate= 460.1kbits/s [h264 @ 0x2cdde50] concealing 1433 DC, 1433 AC, 1433 MV errors in I frame [NULL @ 0x2ba2b10] RTP: missed 14 packetsB time=00:00:12.00 bitrate= 451.8kbits/s [NULL @ 0x2ba2b10] RTP: missed 1 packets [NULL @ 0x2ba2b10] RTP: missed 16 packets [h264 @ 0x2cdde50] concealing 1433 DC, 1433 AC, 1433 MV errors in I frame [NULL @ 0x2ba2b10] RTP: missed 19 packetsB time=00:00:13.60 bitrate= 427.5kbits/s [h264 @ 0x2cdeba0] concealing 302 DC, 302 AC, 302 MV errors in I frame [NULL @ 0x2ba2b10] RTP: missed 15 packetsB time=00:00:14.70 bitrate= 404.6kbits/s [h264 @ 0x2c5e3a0] corrupted macroblock 41 2 (total_coeff=-1) [h264 @ 0x2c5e3a0] error while decoding MB 41 2 [h264 @ 0x2c5e3a0] concealing 1358 DC, 1358 AC, 1358 MV errors in I frame [NULL @ 0x2ba2b10] RTP: missed 21 packetsB time=00:00:15.83 bitrate= 399.0kbits/s [h264 @ 0x2cdde50] concealing 556 DC, 556 AC, 556 MV errors in I frame [NULL @ 0x2ba2b10] RTP: missed 28 packetsB time=00:00:16.63 bitrate= 386.6kbits/s [NULL @ 0x2ba2b10] RTP: missed 3 packetskB time=00:00:17.93 bitrate= 359.3kbits/s [h264 @ 0x2cdeba0] corrupted macroblock 0 24 (total_coeff=-1) [h264 @ 0x2cdeba0] error while decoding MB 0 24 [h264 @ 0x2cdeba0] concealing 299 DC, 299 AC, 299 MV errors in I frame [NULL @ 0x2ba2b10] RTP: missed 4 packets [NULL @ 0x2ba2b10] RTP: missed 3 packets [NULL @ 0x2ba2b10] RTP: missed 1 packets [flv @ 0x2bc3bb0] Failed to update header with correct duration. [flv @ 0x2bc3bb0] Failed to update header with correct filesize. frame= 366 fps= 15 q=18.0 Lsize= 801kB time=00:00:18.13 bitrate= 361.7kbits/s video:795kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.749128% Cheers, Matt On Mon, Feb 23, 2015 at 3:16 PM, Matt Conway <conwayxd@gmail.com> wrote:
On Mon, Feb 23, 2015 at 2:44 PM, Claudiu Rad <jazzman@misalpina.net> wrote:
"-f avi is wrong. use -f flv."
Yes sorry, you're correct I am using two very similar commands in different scripts and I copied the wrong one.
"firstly, for any other issues, you *must* always provide full console/error output of your command by copy/paste here. sending a screenshot is not very helpful.
secondly, that's *not* the output of your above command. you use a different command in the picture. if you want help, please help people on this mailing list by being consistent."
On Mon, Feb 23, 2015 at 14:26:22 +0000, Matt Conway wrote:
Here is a screenshot of the output.
Wow. You're supposed to copy the text, not send images.
It keeps returning a long list of errors all saying "Past duration X.XXXXXX too large", the number is changing however, increasing the longer I leave the stream running. Is this because the frames in my stream are too large? What can I do to stop this from happening.
I have NO idea whatsoever what the code is checking there, and whether it has anything to do with your issue. That said, as far as I can tell from the code, those messages won't come if you choose "-vsync passthrough" or "-vsync drop". (That's just a suggestion to try, by no means meant as a solution. Sorry.) As questioned before: Have you tried stream-copyig instead of recoding to flv1? Moritz
On Mon, Feb 23, 2015 at 3:20 PM, Moritz Barsnick <barsnick@gmx.net> wrote: Wow. You're supposed to copy the text, not send images.
Yep, my mistake!
I have NO idea whatsoever what the code is checking there, and whether it has anything to do with your issue.
That said, as far as I can tell from the code, those messages won't come if you choose "-vsync passthrough" or "-vsync drop". (That's just a suggestion to try, by no means meant as a solution. Sorry.)
As questioned before: Have you tried stream-copyig instead of recoding to flv1?
I'll check out the vsync stuff Moritz thanks for that. I did try to copy the stream but ustream needs to receive in the flv format, it does not pick it up otherwise.
On Mon, Feb 23, 2015 at 15:23:54 +0000, Matt Conway wrote:
I did try to copy the stream but ustream needs to receive in the flv format, it does not pick it up otherwise.
FLV is a format, H.264 is a codec. The FLV container can hold H.264 video, and ffmpeg's multiplexer does support that. And I'm sure ustream's FAQs recommend H.264 as a codec. So if it must be FLV _format_: -c:v libx264 -f flv or in your case: -c:v copy -f flv That _should_ work, at least from ffmpeg's perspective, and probably from ustream's as well. Moritz
On Mon, Feb 23, 2015 at 3:57 PM, Moritz Barsnick <barsnick@gmx.net> wrote:
FLV is a format, H.264 is a codec. The FLV container can hold H.264 video, and ffmpeg's multiplexer does support that.
And I'm sure ustream's FAQs recommend H.264 as a codec.
So if it must be FLV _format_: -c:v libx264 -f flv or in your case: -c:v copy -f flv
That _should_ work, at least from ffmpeg's perspective, and probably from ustream's as well.
Ok I must have been using an older version when I tried before. I recompiled and it appears to be working when specifying to copy the codec now. (I was using -vcodec copy, not -c:v copy. Could this have been an issue?) Thanks again Moritz. Always coming to my rescue!
With reference to this post: http://stackoverflow.com/questions/30782771/what-does-past-duration-x-xxx- too-large-mean The problem seems to disappear if you set the input frame rate, i.e. use the -r flag before your input definition, e.g. ffmpeg -r 25 -i /dev/video0 ....
participants (4)
-
Charl Wentzel -
Claudiu Rad -
Matt Conway -
Moritz Barsnick