Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#2089 closed enhancement (fixed)

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

Description

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 (3)

comment:1 Changed 7 years ago by ming

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

In 5734:

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

comment:2 follow-up: Changed 6 years 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.

comment:3 in reply to: ↑ 2 Changed 6 years ago by ming

Replying to 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.

The initialization of codec param (the second fix above) is reverted in r5831, since it will overwrite user's supplied codec param.

Last edited 6 years ago by ming (previous) (diff)
Note: See TracTickets for help on using tickets.