[FFmpeg-trac] #5156(avformat:new): Multiple instances of ffplay to stream different rtp streams on same port fail

FFmpeg trac at avcodec.org
Wed Jan 13 09:04:54 CET 2016


#5156: Multiple instances of ffplay to stream different rtp streams on same port
fail
-------------------------------------+-------------------------------------
             Reporter:  jeroenz      |                     Type:  defect
               Status:  new          |                 Priority:  important
            Component:  avformat     |                  Version:  2.8.3
             Keywords:  udp sdp      |               Blocked By:
  multicast                          |  Reproduced by developer:  0
             Blocking:               |
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 There are multiple rtp video streams in the system, each multicasted on
 different addresses but same port number. For each stream, there is a sdp
 file (a.sdp, b.sdp). When I start 'ffplay a.sdp', 'stream a' is shown.
 Then, when I start a second instance (ffplay b.sdp), both instances show
 'stream b' and start to generate a lot of errors like these:

 [h264 @ 0x7f049c008c00] RTP: missed -44310 packetssq=    0B f=0/0
 [h264 @ 0x7f049c008c00] RTP: PT=60: bad cseq 1476 expected=c18c
 [h264 @ 0x7f049c008c00] RTP: missed -44310 packetssq=    0B f=0/0
 [h264 @ 0x7f049c008c00] RTP: dropping old packet received too late
 [h264 @ 0x7f049c008c00] RTP: dropping old packet received too late

 It turned out that both instances receive 'all streams' to that port
 number, because the binding is not/incorrectly done.
 See libavformat/udp.c (function udp_open, line 734 in 2.8.4):

     if (s->is_multicast && !(h->flags & AVIO_FLAG_WRITE)) {
         bind_ret = bind(udp_fd,(struct sockaddr *)&s->dest_addr, len);
 }

 The bind is only done when the socket is opened in read-only mode, and
 apparently that is not the case with ffplay. When I remove the check for
 the AVIO_FLAG_WRITE and rebuild ffplay, all is working fine!

 Also see http://ffmpeg.gusari.org/viewtopic.php?f=14&t=2587

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5156>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list