Opened 8 months ago

Last modified 3 days ago

#8479 open enhancement

ffplay ignores a=rtcp SDP attribute for RTP streams

Reported by: juannm Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: rtp
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

When sending RTP with ffmpeg, it is possible to specify an RTCP port that is not the default RTP + 1. For this, we just have to add the parameter "rtcpport" to the output URL. For example:

ffmpeg -re -i video.mp4 -an -c:v copy -f rtp -sdp_file video.sdp \
    "rtp://192.168.1.109:5004?rtcpport=54321"

To play back this stream, ffplay can be used with an SDP file. The equivalent of "rtcpport=54321" in SDP format is an attribute such as "a=rtcp:54321", like in this example SDP (generated by ffmpeg and edited by hand to work around related bugs https://trac.ffmpeg.org/ticket/7068 and https://trac.ffmpeg.org/ticket/8474):

v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 192.168.1.109
t=0 0
a=tool:libavformat 58.29.100
m=video 5004 RTP/AVP 96
a=rtcp:54321
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z0LAH9kAUAW7ARAAAD6QAAu4CPGDJIA=,aMuMsg==; profile-level-id=42C01F

However, ffplay ignores the "a=rtcp" attribute, thus it listens for RTCP packets in the default port 5005 (RTP + 1), and packets sent by ffmpeg don't arrive correctly to their destination.

Example playback command:

ffplay \
    -protocol_whitelist file,rtp,udp \
    -i video.sdp

This renders the usage of "rtcpport" URL parameter not viable if all we use is FFmpeg itself for both sending and receiving.

Full, uncut console outputs from ffmpeg and ffplay generated with '-report' and provided in the attached files.

Related bugs:

Attachments (2)

ffmpeg-20200117-123120.log (140.6 KB) - added by juannm 8 months ago.
ffmpeg comand (RTP sender)
ffplay-20200117-123209.log (33.4 KB) - added by juannm 8 months ago.
ffplay comand (RTP receiver)

Download all attachments as: .zip

Change History (6)

Changed 8 months ago by juannm

ffmpeg comand (RTP sender)

Changed 8 months ago by juannm

ffplay comand (RTP receiver)

comment:1 Changed 8 months ago by cehoyos

  • Component changed from ffplay to undetermined

Is this issue reproducible with current FFmpeg git head?

comment:2 Changed 8 months ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords rtp added
  • Priority changed from normal to wish
  • Type changed from defect to enhancement
  • Version changed from unspecified to git-master

comment:4 Changed 3 days ago by xiaofeng

The patch does not work with the multicast case.

Note: See TracTickets for help on using tickets.