Gagravarr / VorbisJava

A library for working with Ogg Vorbis files
Apache License 2.0
126 stars 26 forks source link

OpusStatistics implemented #12

Closed andrm closed 9 years ago

andrm commented 9 years ago

I needed access to the OggPacket in the inner logic,as well as the initial info from OpusFile, so I introduced some package level accessors for the needed data. in addition I did a cast from OggStreamAudioData to OpusAudioData. I don't know if this is the way it is supposed to work, please review this and let me know what you think.

I also left the base OggAudioStatistics untouched in OpusStatistics, but they seem to be a bit off.

andrm commented 9 years ago

Regarding the ogg vs opus audio length discrepancy: Maybe preSkip wasn't taken into account. Apparently the granule position isn't the definitive timestamp information. There was a big discussion about it a while ago. Monty responded here: http://people.xiph.org/~xiphmont/lj-pseudocut/o-response-1.html I didn't read it all, but maybe the base statistics should be revised.

Gagravarr commented 9 years ago

I think we're almost there!

One thing - I'm still not sure about exposing the page through the packet. I've had a go at having the packet expose the page's overhead, taking into account of how a packet might share the page with others

If you're happy with the logic in that, I think we can apply the rest and get the overhead that way!

andrm commented 9 years ago

I removed the page usage from the packet.

The overhead and total byte calculation is less than opusinfo. That's something I don't like, but I can't really spot the problem right now.

Gagravarr commented 9 years ago

I ended up re-working quite a bit of this, in part to get more of the logic into things like OggAudioStatistcs. A lot of the overhead and bitrate stuff is now there, amongst others. Please review if you can, and let me know if you spot any issues / see a better way to do things!

There are still a few differences between what opusinfo reports and what OpusInfoTool now does, I think we might be calculating some different things, and maybe need to tweak / display our current stats and some others

Granule wise, for opus at least our logic is fine, having re-read the spec. I think what Monty mentions in that post may applied to some of the other formats

Nearly there though! :)

andrm commented 9 years ago

Looks great to me now. I may work on multibitstream files in the future.