Opened 11 months ago

Last modified 3 days ago

#8474 open defect

rtcpport param doesn't add a=rtcp to SDP

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

Description

Summary of the bug:
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:

rtp://127.0.0.1:5004?rtcpport=54321

However, FFmpeg is not adding the corresponding media-level attribute "a=rtcp:54321" to the generated SDP file.

This seems like a bug to me instead of a missing feature, because in SDP, the omission of the "a=rtcp" attribute is nominally equivalent to an implicit presence of that attribute, where the value is RTP + 1.

So, in short, FFmpeg is generating an SDP where the RTCP port is wrong.

How to reproduce:

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

generates an SDP file, "video.sdp", with these contents:

SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 127.0.0.1
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

Expected SDP would NOT have the invalid first line "SDP:" (that's a different bug: #7068), and also it would have the "a=rtcp" line:

v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 127.0.0.1
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

Full, uncut console output generated with '-report' and provided in the attached file.

Attachments (1)

ffmpeg-20200115-193654.log (10.0 KB) - added by juannm 11 months ago.
Full, uncut console output

Download all attachments as: .zip

Change History (9)

Changed 11 months ago by juannm

Full, uncut console output

comment:1 Changed 11 months ago by juannm

Ticket syntax failed when linking to the related bug report:
https://trac.ffmpeg.org/ticket/7068 - "ffmpeg SDP file generation : incorrect header"

comment:2 Changed 11 months ago by juannm

  • Cc oneorjuan@gmail.com added

comment:3 Changed 11 months ago by juannm

  • Cc oneorjuan@gmail.com removed

comment:4 follow-up: Changed 11 months ago by cehoyos

  • Component changed from ffmpeg to undetermined
  • Version changed from 4.2 to unspecified

Is this issue not reproducible with current FFmpeg?

comment:5 Changed 10 months ago by cehoyos

  • Component changed from undetermined to avformat
  • Version changed from unspecified to git-master

comment:6 in reply to: ↑ 4 Changed 3 days ago by juannm

Replying to cehoyos:

Is this issue not reproducible with current FFmpeg?

This is reproducible as of today with latest development code:
ffmpeg version git-2020-11-25-3de3d2f

comment:7 Changed 3 days ago by Balling

  • Status changed from new to open

Correct, that is https://tools.ietf.org/html/rfc3605

"Real Time Control Protocol (RTCP) attribute in Session Description Protocol (SDP)"

comment:8 Changed 3 days ago by juannm

Yes, the a=rtcp attribute is defined in RFC 3605. Technically it is optional when the RTCP port is just RTP + 1, but it should be included otherwise, or else consumers of the SDP file will wrongly assume that they should use RTP + 1 for the RTCP port.

By the way this bug report goes hand to hand with the related one: https://trac.ffmpeg.org/ticket/8479
which is about FFmpeg ignoring the a=rtcp attribute in input SDP files.

Note: See TracTickets for help on using tickets.