[FFmpeg-user] streaming to Youtube - error message after some time

Dennis Mungai dmngaie at gmail.com
Fri Aug 5 14:14:28 EEST 2022


On Fri, 5 Aug 2022 at 13:55, Christian <christian9486 at gmx.de> wrote:

> Hello,
>
> sorry, I wasn't specific enough with my last mails. I try again and be
> more specific:
>
> I like to stream to Youtube. The source is my Outdoor-Camera which is
> connected via an antenna to my Router. The camera sends an h.264 encoded
> RTSP-Stream. FFmpeg v4.1.9 runs on a Raspberry Pi4 with Raspbian, which
> receives the stream and converts it to rtmp for Youtube. Here is the
> ffmpeg command for doing so:
>
> ffmpeg -f lavfi -fflags +genpts -i anullsrc -rtsp_transport udp -i
> "rtsp://user:password@192.168.1.124:554/Streaming/Channels/101" -bufsize
> 5M -tune zerolatency -vcodec copy -pix_fmt + -strict experimental
> -flvflags no_duration_filesize -f flv rtmp://a.rtmp.youtube.com/live2/----
>
> Randomly after some/many hours/days I get the following error message:
>
> ...
> frame=961817 fps= 25 q=-1.0 size=33431623k8 time=10:41:17.90
> bitrate=7117.6kbits
> frame=961830 fps= 25 q=-1.0 size=33432111k8 time=10:11:18.40
> bitrate=7117.7kbits
> frame=961843 fps= 25 q=-1.0 size=33432385k8 time=10:41:18.92
> bitrate=7117.6kbits
> av_interleaved_write_frame(): Connection timed out
> Error writing trailer of rtmp://a.rtmp.youtube.com/live2/---- :
> Connection timed out
> frame=961849 fps= 24 q=-1.0 Lsize=33432752kB time=10:41:19.20
> bitrate=7117.6kbit s/s speed=0.975x video:33376660kB audio: 9817kB
> subtitle: 0kB other streams: 0kB global headers: 0kB muxing overhead:
> 0.138601% [aac @ 0x20ae080] Qavg: 65536.000 Conversion failed!
>
> Googling "av_interleaved_write_frame(): Connection timed out" I couldn't
> find something. What does that mean? Does it mean that ffmpeg has no
> connection to the camera anymore?
>
> Thanks in advance.
> Chris
>
> Am 03.08.22 um 22:44 schrieb Christian:
> > Ups. The Link was not intended... -.-
> > Anyway, I would be grateful for an explanation. Thanks in advance.
> > Chris
> >
> > Am 03.08.22 um 21:11 schrieb Christian:
> >> Hello,
> >>
> >> after a while streaming to youtube I randomly get the following error
> >> message from ffmpeg:
> >>
> >> "...
> >> av_interleaved_write_frame(): Connection timed out
> >> Error writing trailer of rtmp://a.rtmp.youtube.com/live2/
> >> <https://a.rtmp.youtube.com/live2/tpbb-cuze-34cj-bqyp-bvc>-------
> >> 0: Connection timed out
> >> ..."
> >> abort
> >>
> >> Could anybody explain me what that means, please? Does it mean the
> >> camera is not accessible?
> >>
> >> Thanks in advance.
> >> Chris
>

Hey there,

Please add these flags for the flv muxer:  "-flvflags +*no_sequence_end*
+no_metadata+no_duration_filesize

In your example, test with:

ffmpeg -f lavfi -fflags +genpts -i anullsrc -rtsp_transport udp -i
"rtsp://user:password@192.168.1.124:554/Streaming/Channels/101" -bufsize
5M -tune zerolatency -vcodec copy -bsf:v dump_extra
-flvflags  +*no_sequence_end*+no_metadata+no_duration_filesize -f flv
"rtmp://$URL"

And report back.
<http://a.rtmp.youtube.com/live2/---->


More information about the ffmpeg-user mailing list