Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about DRED #326

Closed
dmpriso opened this issue Mar 23, 2024 · 4 comments
Closed

Question about DRED #326

dmpriso opened this issue Mar 23, 2024 · 4 comments

Comments

@dmpriso
Copy link

dmpriso commented Mar 23, 2024

I just tried out DRED in a live audio application I am working on and it's working great.

However, a few questions came up:

  • DRED data only seems available for parsing if OPUS_SET_PACKET_LOSS_PERC is set to a nonzero value. Is that expected behaviour?
  • If yes, does the actual value passed to OPUS_SET_PACKET_LOSS_PERC matter, and how does it correlate to the amount and quality of DRED data?
  • Are DRED frames always 10ms frames, no matter what the actual frame size used by the application?
@jmvalin
Copy link
Member

jmvalin commented Mar 24, 2024

Opus is trying to optimize for whatever packet loss rate you set with OPUS_SET_PACKET_LOSS_PERC. If you tell it to optimize for the no-loss (0%) case, then there's no point in wasting bits for DRED. The exact loss you specify will influence the amount of DRED used. If in doubt, you can always try with 20% and see from there.
As for your third question, I don't understand it.

@dmpriso
Copy link
Author

dmpriso commented Mar 24, 2024

Thanks a lot, that explains it. From my previous understanding, OPUS_SET_PACKET_LOSS_PERC was only relevant for LBRR, so that hadn‘t been obvious for me from the documentation.

Regarding my third question. The docs state: „ OPUS_SET_DRED_DURATION: If non-zero, enables Deep Redundancy (DRED) and use the specified maximum number of 10-ms redundant frames.“

Do I interpret it correctly that if I set this value to 50, I get 500ms of DRED data per frame, even if I choose to encode frames of 20ms or 5ms length?

I also noticed from experimenting that the amount of DRED data (in milliseconds) available is limited by bitrate, is that correct?

@jmvalin
Copy link
Member

jmvalin commented Mar 24, 2024

OPUS_SET_DRED_DURATION is always in units of 10 ms, but things are more complicated underneath anyway. And it specifies the maximum the application allows. There may be less than that due to available bitrate.

@dmpriso
Copy link
Author

dmpriso commented Mar 24, 2024

Thanks, that's all I needed to know!

@dmpriso dmpriso closed this as completed Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants