Opened 4 years ago

Last modified 3 years ago

#8474 open defect

rtcpport param doesn't add a=rtcp to SDP

Reported by: Juan Navarro 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 Juan Navarro 4 years ago.
Full, uncut console output

Download all attachments as: .zip

Change History (9)

by Juan Navarro, 4 years ago

Attachment: ffmpeg-20200115-193654.log added

Full, uncut console output

comment:1 by Juan Navarro, 4 years ago

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

comment:2 by Juan Navarro, 4 years ago

Cc: oneorjuan@gmail.com added

comment:3 by Juan Navarro, 4 years ago

Cc: oneorjuan@gmail.com removed

comment:4 by Carl Eugen Hoyos, 4 years ago

Component: ffmpegundetermined
Version: 4.2unspecified

Is this issue not reproducible with current FFmpeg?

comment:5 by Carl Eugen Hoyos, 4 years ago

Component: undeterminedavformat
Version: unspecifiedgit-master

in reply to:  4 comment:6 by Juan Navarro, 3 years ago

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 by Balling, 3 years ago

Status: newopen

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

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

comment:8 by Juan Navarro, 3 years ago

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.