VoidXH / Cavern

Object-based audio engine and codec pack with Dolby Atmos rendering, room correction, HRTF, one-click Unity audio takeover, and much more.
http://cavern.sbence.hu
Other
307 stars 14 forks source link

Cavern/Cavernrize tools for mpeg-h audio? some ideas #124

Closed papayyyegg closed 11 months ago

papayyyegg commented 11 months ago

If im correct caverns headphone virtualizer can visualize 7.1.4 channels and ive found out there's mpegh decoder which outputs mpegh to wav in chosen format. Implementing it to cavernrize will be easy as there's ready documentation and support for different mpegh levels is better than in mpegh v player. using tool : Original release https://github.com/ittiam-systems/libmpegh and fork by [ThreeDeeJay] https://github.com/ThreeDeeJay/libmpegh/commits?author=ThreeDeeJay with compiled exe for windows. the playback performance of this tool is high 3-4 min track on quadcore takes 30 seconds so i wonder if its possible to implement it also to cavernrize? (obviously like with mmh atmos helper file with metadata will be replaced by chosen output format so there will be no way to visualize if there's no program that at the same time reads metadata, it will be only cosmetic feature and i know it will be hard because it's new format and little documentation (at least better than ac4). Playback of libmpegh outputted 7.1.4 mix i think should be accepted by cavern visualizer. it's not something i crave for Couse i have mpegh authoring suite but will be wonderful thing for others :3.

papayyyegg commented 11 months ago

https://sharemania.us/threads/tutorial-how-to-decode-360ra-into-7-1-4-22-2-wav-lc-l3-mhm1-lc-l4-only.221516/ here is tutorial how it can be used :3

VoidXH commented 11 months ago

For a direct implementation, 2 things are needed:

  1. Standard documentation with low-level bitstream description. Using someone else's code is not viable for licensing reasons. I'm not even allowed to look at how others do it.
  2. There has to be an existing market that needs it. To my knowledge, MPEG-H has no commercial use yet, every service is using E-AC-3.

Regarding WAV import: there is a WAV channel reorderer under CavernSamples, and it's suitable to convert the outputs of the linked tutorial to standard layouts which Cavern knows.

papayyyegg commented 11 months ago

It's not needed that much. at the end of my comment i explained what i meant by integrating, regarding licence on GitHub. Decoder wise you can use theirs decoder with mentioning them with ease and their documentation is well made and more documentation you can find there: https://www.mpeg.org/standards/MPEG-H/3/ , https://prdatsc.wpenginepowered.com/wp-content/uploads/2023/04/A342-3-2023-03-MPEG-System.pdf , https://www.iis.fraunhofer.de/content/dam/iis/en/doc/ame/Conference-Paper/BleidtR-IEEE-2017-Development-of-MPEG-H-TV-Audio-System-for-ATSC-3-0.pdf , and bottom part of this page at box named papers: https://www.iis.fraunhofer.de/en/ff/amm/broadcast-streaming/mpegh.html here is another less capable decoder you can use https://github.com/Fraunhofer-IIS/mpeghdec .

if we're talking about format popularity it's not that popular but it grows as mpegh was chosen as main broadcast codec in many countries and right now 360RA is streamed by tidal and amazons' music, it will gain popularity as many companies supports it or are involved in creation of this format. for ex. Samsung, Sony, LG, Qualcomm, MediaTek and many more. about content availability for first there is 360 ra which is supported by this decoder (files are gathered from streaming sites) and community made my peoples like for ex me. in few years we will see increased content encoded with this format as it's easier to licence and implement than atmos. there's option to get mpegh authoring suite with vst plugin for making mixes in any daw ... you can get for free if you want to experiment just need to request https://www.iis.fraunhofer.de/en/ff/amm/broadcast-streaming/mpegh.html) and about using their code as im aware that decoder uses BSD 3-Clause-Clear licence that means you can without any problem put their decoder into any soft with just mentioning the decoder provider and without marketing your software without their approval by this feature solely. i had today found out that already Music media helper tool (the one made by quadrophonicquad forum user HomerJAU already uses it to decode 360 ra and mpegh audio into wavs and even playback it, he mentioned whose decoder it is and its in his music media helper tool in split mkv/mka audio or create audio track tab it uses the decoder i send you. the documentation is on that GitHub release page. so, i found tool which can make what i want but cavern approach with possibility of playing back without converting will be better but harder.

VoidXH commented 11 months ago

I've looked into this thoroughly. As much as I hate Fraunhofer IIS for their disgusting licencing, the reference decoder is a breeze as it's both free and fully compatible with my licence. They have to do it this way, because standards can be implemented by anyone anyway. This is where the problems start. The standard is called ISO/IEC 23008-3, and ISO is very greedy when it comes to distributing standards, the 800 page document I'd need for this is $200. While this is still less pages than E-AC-3 + JOC (around 1000), the codec itself is way more complicated and will probably reference further documents. Dolby also provides a complete reference implementation in their standard papers which I bet Fraunhofer doesn't. Just the LoC count of the reference decoder is twice as much as the entirety of Cavern, and E-AC-3 was half a year to code and correct the edge cases. While the MPEG container can already be read by Cavern, that is a very minor part of the whole picture.

While I see that some platforms use MPEG-H through 360RA, 99% of the market is still E-AC-3, waiting for an AC-4 transition. When that happens, DTS-UHD will also be strategically important. For a single Sony (known for killing products as hastily as Google) technology, this would be too much work. If movies or larger platforms start using it, I have to start working on the implementation, but until that, this will be a "good to have". Some compatibility can quickly be achieved, for example, you could use the EnhancedAC3Merger project from CavernSamples, it converts any WAV export in any channel order to a channel-based E-AC-3 file that can be both rendered by Cavern and played by HT systems. Another possibility - since the MPEG-H renderers have weird channel counts - is simply using WAVChannelReorderer. If its feature set is lacking for packing WAV files correctly or just a re-renderer is needed, I can add it quickly.