[FFmpeg-trac] #8436(undetermined:new): ffmpeg sets opus audio to stereo in SDP even though it is mono

FFmpeg trac at avcodec.org
Thu Dec 19 13:37:19 EET 2019


#8436: ffmpeg sets opus audio to stereo in SDP even though it is mono
-------------------------------------+-------------------------------------
             Reporter:               |                     Type:  defect
  rudolfs.bundulis                   |
               Status:  new          |                 Priority:  minor
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:  opus rtsp    |               Blocked By:
  sdp                                |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:

 ffmpeg sets a=rtpmap:98 opus/48000/2 indicating a stereo track
 in RTSP SDP when the source is actually mono.

 How to reproduce:

 The input file has been attached (Big buck bunny with a mono audio track
 that has silence).

 {{{
 % fmpeg -i mono_opus_sample.mp4 -c:v h264 -c:a opus -strict -2
 -rtsp_transport tcp -f rtsp rtsp://localhost:554/app/live

 ffmpeg version 4.2.1
 built on macOS 10.15
 }}}

 Here is the output from ffmpeg with -loglevel panic, which shows the
 invalid SDP:

 {{{
 [rtsp @ 0x7fb9ea805800] 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 0 RTP/AVP 96
 a=rtpmap:96 H264/90000
 a=fmtp:96 packetization-mode=1; sprop-parameter-
 sets=Z2QADazZQUH7DhAAAAMAEAAAAwPA8UKZYA==,aOvjyyLA; profile-level-
 id=64000D
 a=control:streamid=0
 m=audio 0 RTP/AVP 97
 b=AS:48
 a=rtpmap:97 opus/48000/2 # This track should be mono
 a=control:streamid=1
 }}}

 If not forcing opus (and defaulting to aac), the entry seems correct:

 {{{
 ffmpeg -i mono_opus_sample.mp4 -c:v h264  -rtsp_transport tcp -f rtsp
 rtsp://localhost:554/app/live
 }}}

 The SDP then is:
 {{{
 [rtsp @ 0x7fd58c013800] 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 0 RTP/AVP 96
 a=rtpmap:96 H264/90000
 a=fmtp:96 packetization-mode=1; sprop-parameter-
 sets=Z2QADazZQUH7DhAAAAMAEAAAAwPA8UKZYA==,aOvjyyLA; profile-level-
 id=64000D
 a=control:streamid=0
 m=audio 0 RTP/AVP 97
 b=AS:69
 a=rtpmap:97 MPEG4-GENERIC/48000/1 # Mono, as it should be
 a=fmtp:97 profile-level-id=1;mode=AAC-
 hbr;sizelength=13;indexlength=3;indexdeltalength=3; config=118856E500
 a=control:streamid=1
 }}}

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


More information about the FFmpeg-trac mailing list