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

Ability to decode Ogg/Opus multiple streams #12

Open
mihui opened this issue Jan 18, 2017 · 5 comments
Open

Ability to decode Ogg/Opus multiple streams #12

mihui opened this issue Jan 18, 2017 · 5 comments

Comments

@mihui
Copy link

mihui commented Jan 18, 2017

Is it possible to decode the multi-stream of ogg/opus instead of a single stream or file? Thanks.

@lostromb
Copy link
Owner

Do you mean 5.1 channel audio, or playing an Ogg file that has more than 1 elementary stream?
If there is more than 1 elementary stream, are they interleaved, or does one start after the other ends?

@mihui
Copy link
Author

mihui commented Jan 20, 2017

Thanks for your quick response, I meant "more than 1 elementary stream" with interleaved data if I understood it right, which means if I have a big size of ogg/opus data streaming back to the application, the decoder may have the ability to decode the a part of it, piece by piece, so that the application (client) will play the buffer instead of waiting for downloading the full size of the data.

@lostromb
Copy link
Owner

lostromb commented Feb 6, 2017

So, the logic that is implemented right now is really dumb - the ogg container code just looks for elementary stream [0] in the file, assumes it is opus, and creates an output using only that stream. Obviously it could be much better, but it would require the API to change something like this:

  • Instead of choosing index [0], inspect every elementary stream, make sure it is opus, and make it available to be played using syntax like "OpusStream[1].Open"
  • Parse OPUSTAGS before committing stream selection so the user/client could choose one based on tags
  • Support playback of streams that are joined end-to-end ( rare, but it can happen). This should be as simple as opening the new stream as it comes
  • Support playback of streams that have multiple interleaved streams. This is easy if we only play one at once, but becomes really difficult if we want to play both at once. I don't have a solution for this yet

@mauriciogracia
Copy link

I am interested in helping to solve this issue, what concepts are needed and what programming techcnices or good practices are recommended before getting involved ? I am a Advanced JAVA Developer with intermdiate Sound related concepts knowledge and very new to the Opus/Concentus arena

@lostromb
Copy link
Owner

Well, awesome. First things first though, I want to move this issue to the Concentus.Oggfile repository since this is a feature relating to ogg files exclusively. It will also require a total redesign of the API because of the way ogg files work. I'll dump my ideas over in that repository. Some questions for you though:

  • Do you plan on working in Java or C#? The Oggfile repository is exclusive to C#, since for Java ogg file management I planned to use the existing gagravarr/VorbisJava project (though that never actually gained any traction). The C# code is the one that requires all the fixes though
  • Now that I mention it, would you like to take up that work so that native Java users can have an OggOpus interface? It seems like a fairly easy fix (a few lines of code, honestly) to get VorbisJava to start encoding / decoding Opus packets, and that would be a pretty good contribution to the Java side of Concentus.
  • Honestly, the simplest thing that I actually really need right now is just to push the Concentus jar to Maven. I know the Java language but I am 100% clueless about its infrastructure, so I never got around to actually making this package easily available in that ecosystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants