Ticket #2089 (closed enhancement: fixed)

Opened 5 months ago

Last modified 7 weeks ago

Support receiving Opus packets with various frame lengths

Reported by: ming Owned by: nanang
Priority: normal Milestone: release-2.8
Component: pjmedia Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no


From the RFC 7587:

The Opus encoder can output encoded frames representing 2.5, 5, 10,
   20, 40, or 60 ms of speech or audio data.  Further, an arbitrary
   number of frames can be combined into a packet, up to a maximum
   packet duration representing 120 ms of speech or audio data.

For example, for a packet duration of 40ms, we can receive 1 frame of 40ms, 2x20ms, 4x10ms, etc. However, currently pjmedia only expects constant frame length to be specified during stream creation.

Thank you to Marcus Froeschl for the suggestion and patch testing.

Change History

comment:1 Changed 5 months ago by ming

  • Status changed from new to closed
  • Resolution set to fixed

In 5734:

Fixed #2089: Support receiving Opus packets with various frame lengths

comment:2 Changed 7 weeks ago by nanang

In 5799:

Re #2089:

  • Set default max Opus RX frame length, i.e: param.info.max_rx_frame_size, to 1275. This is to avoid issue of truncated frame in jitter buffer when incoming frame length gets increased (after remote Opus encoder changes Opus params on the fly, e.g: ptime, VBR/CBR, sampling rate). Thanks Marcus Froeschl for the report, the investigation, and the solution.
  • Fixed pjmedia_codec_opus_set_default_param() to initiate codec param with current default settings.
  • Fixed some compile warnings.
Note: See TracTickets for help on using tickets.