[FFmpeg-trac] #10838(undetermined:new): RTMP protocol, ffmpeg to ffmpeg, always ends with a connection reset (broken pipe)

FFmpeg trac at avcodec.org
Thu Feb 1 14:11:00 EET 2024


#10838: RTMP protocol, ffmpeg to ffmpeg, always ends with a connection reset
(broken pipe)
-------------------------------------+-------------------------------------
             Reporter:  Momtchil     |                    Owner:  (none)
  Momtchev                           |
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  git-master   |               Resolution:
             Keywords:  RTMP         |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Comment (by Momtchil Momtchev):

 I found the reason and it is a design problem:
 https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/fftools/ffmpeg_mux.c#l407

 In the main loop of {{{muxer_thread()}}}, after {{{sch_mux_receive()}}}
 has reported that the input stream is finished, the loop exits, ending the
 pipeline. This is simply how the pipeline works, fixing it here would
 require a major redesign.

 A proper solution would be to implement ACK handling in the RTMP protocol
 and do not return from {{{rtmp_write()}}} until the remote has actually
 acknowledged - taking into account the window. It should buffer the
 window, handle retransmits and block when the remote is lagging.

 An easy fix would be to simply delay the closing in {{{avio_closep()}}} /
 {{{rtmp_close()}}} with a timeout. I wonder if this would have any
 consequences?
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10838#comment:3>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list