pion/opus

Roadmap

Sean-Der opened this issue · 7 comments

This is a covering ticket for the Pion Opus roadmap. If you have any requests feel free to leave them here/vote on others.

0.0.1

  • SILK Decoder
  • CELT Decoder

0.0.2

  • SILK Encoder
  • CELT Encoder

Hello Sean.
My name is Vitaly. My program needs an Opus decoder and I would like my entire program to be in pure Go. That's why I found your Pion/Opus library. However, I can’t even check its performance, since the description does not indicate anywhere with what parameters the input.opus file must be encoded so that your decoder can decode it and turn it into output.pcm.
I have tried many different compression options, but every time I get an error: unsupported frame code: 3.
For this reason, I ask you to give me the exact encoding parameters that your decoder already supports, so that I can test its functionality.
If it works, I'm willing to try adding some missing compression options that my program needs and share them with the community (you can also include them in the Pion/Opus code).
Thank you in advance.
Sincerely,
Vitaly Monastyrskiy.

Hi @flamehowk

Thank you so much for reaching out! I would love to see you use this library, it has a long way to go though.

Currently it only supports CELT (The low bandwidth codec in Opus). To test that you can encode it by doing ffmpeg -i $INPUT_FILE -c:a libopus -ac 1 -b:a 10K output.ogg

My goal is to have both encoders working in ~3 months. I would love to work together on this if you are interested!

Hello Sean.

  1. I do not need an encoder, but a decoder.
  2. I need a library that I can connect to my Golang project, and not an executable codec that I will need to access through the API or in the console, because I can take a ready-made codec that is written in C ++.
  3. Since your library does not have any description of the code structure, while the code is very confusing, with a superficial search, I could not understand the chain of functions that provide work with opus files. And since you did not answer for a very long time, I did just that - I just connected a codec that was compiled from source codes in C. Therefore, at the moment my problem is solved, although not in the most convenient way.

Therefore, if you send a description of the structure of this library and the algorithm of its work, so that I can understand it, then perhaps I can find the time and help you finish this codec.
However, if you do not have any descriptions of the structure of this library, then I will not spend a month of my time studying someone else's code, just to understand how it works.
Also, I will not be able to help you if, in the course of our cooperation, you will respond to my requests 2 weeks after I sent them.

I hope for your understanding.
Of good.

1.) Great!

2.) Great!

3.) Were you able to run decode or playback?

For the API we provide a Decoder and you call Decode. That processes the Opus bitstream, and then calls into the SILK or CELT codecs.

I will make sure to respond faster. I am also available on the Pion Slack and you can email me sean@pion.ly anytime.

If you are interested in contributing I am currently just comparing this decoder to ffmpegs output. You could also look at implementing the CELT decoder. It is a pretty time intensive/tedious process though :)

diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c
index 8523b55ada..e0ec754cdf 100644
--- a/libavcodec/opus_silk.c
+++ b/libavcodec/opus_silk.c
@@ -29,6 +29,7 @@
 #include "opus.h"
 #include "opustab.h"

+FILE *fp = NULL;
 typedef struct SilkFrame {
     int coded;
     int log_gain;
@@ -728,6 +729,11 @@ static void silk_decode_frame(SilkContext *s, OpusRangeCoder *rc,
         }
     }

+    if (fp == NULL) {
+        fp = fopen("/Users/duboisea/workspace/opus/ffmpeg-raw", "w");
+    }
+    fwrite(frame->output + SILK_HISTORY, 1, 1280, fp);
+
     frame->prev_voiced = voiced;
     memmove(frame->lpc_history, frame->lpc_history + s->flength, SILK_HISTORY * sizeof(float));
     memmove(frame->output,      frame->output      + s->flength, SILK_HISTORY * sizeof(float));

Can't wait for encoder

thanks for the amazing package. Would love to see CELT decoder released!

Can't wait for encoder

hi, have you find other ways to resolve encoder ?