Opened 4 years ago

Last modified 3 years ago

#8479 open enhancement

ffplay ignores a=rtcp SDP attribute for RTP streams

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


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 \

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 and

o=- 0 0 IN IP4
s=No Name
c=IN IP4
t=0 0
a=tool:libavformat 58.29.100
m=video 5004 RTP/AVP 96
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 Juan Navarro 4 years ago.
ffmpeg comand (RTP sender)
ffplay-20200117-123209.log (33.4 KB ) - added by Juan Navarro 4 years ago.
ffplay comand (RTP receiver)

Download all attachments as: .zip

Change History (6)

by Juan Navarro, 4 years ago

Attachment: ffmpeg-20200117-123120.log added

ffmpeg comand (RTP sender)

by Juan Navarro, 4 years ago

Attachment: ffplay-20200117-123209.log added

ffplay comand (RTP receiver)

comment:1 by Carl Eugen Hoyos, 4 years ago

Component: ffplayundetermined

Is this issue reproducible with current FFmpeg git head?

comment:2 by Carl Eugen Hoyos, 4 years ago

Component: undeterminedavformat
Keywords: rtp added
Priority: normalwish
Type: defectenhancement
Version: unspecifiedgit-master

comment:4 by xiaofeng, 3 years ago

The patch does not work with the multicast case.

Note: See TracTickets for help on using tickets.