Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Can Multi-channel wma pro be stored in mkv? (Read 4343 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Can Multi-channel wma pro be stored in mkv?

I've only tried in MKVToolNix, and it's not letting this unholy union happen.
Just wondering if this is something ffmepg can finagle, or it really is so unholy no one has ever fathomed it before?

The reason for my wanting to do this is simple. I have some movies I want to edit the sound in. I plan to serve them with Plex after. My surround sound system says it will play wma but not opus. Though that doesn't usually mean wma pro, I want to try it. (It's main function is to decode surround sound. If any hardware has a chance of decoding wma pro, this would be it.)

My next thought was to see if Plex will handle the oups support. Online it sounds like that depends on what you play if from. I have a Roku Premiere as the only thing I play my Plex from. Anyway, I found more people with issues than people praising how well it worked for them, and none of it was new within the last year.
Processed audio in java and python.


 

Re: Can Multi-channel wma pro be stored in mkv?

Reply #2
Here's the matroska codec mapping spec: https://datatracker.ietf.org/doc/draft-ietf-cellar-codec/

There's nothing about WMA in there. There's A_MS/ACM, I don't know whether WMA would fit in that? Documentation links seem to be dead.
Music: sounds arranged such that they construct feelings.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #3
ACM is not a codec but a framework for managing codecs. LAME bundles have historically included an ACM version that you can use with VirtualDub to encode audio to MP3, as one example. ACM is outdated and irrelevant now; it's from the days when everything was AVI and CBR.

The Matroska Codec Mappings page:

https://www.matroska.org/technical/codec_specs.html

doesn't mention WMA, either, so it appears to be unsupported.


Re: Can Multi-channel wma pro be stored in mkv?

Reply #5
AAC is probably the better choice, but MKV supports both AC3 and EAC3, as well.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #6
Okay. Thank you all for pitching in. MKV will not allow for a wma audio track.
I tried an opus version of the audio. It took longer than wma to convert, but was able to be stored in the mkv file just fine.
Playing it back with MPC-HC was less than okay though. The sound was very off and seemed buggy.

I've been seeing vague mentions of multi-channel AAC, but nothing about it actually working or even hard proof that it's real. Though I guess it could be in the realm of wma pro: Everything assumes it's normal 2 channel AAC and breaks when it's not.

I'm willing to give Aften a try, but it says it's based off of ffmpeg, and that doesn't have an amazing AC3 encoder.


Processed audio in java and python.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #7
Everything assumes it's normal 2 channel AAC and breaks when it's not.
I'm pretty sure that foobar2000 reads multi-channel and converts to multi-channel unless you tell it otherwise.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #8
I've been seeing vague mentions of multi-channel AAC, but nothing about it actually working or even hard proof that it's real.
It definitely real, considering I've encoded it before. ;)

You'll want qaac, which is a frontend for Apple's CoreAudio engine. It performs very well on stereo listening tests, and it supports 5.1, too. It's a little annoying to set up if you don't want iTunes installed, as you have to extract the relevant DLL files from the iTunes installer, but it's well worth the effort if you want flexible AAC encoding with the best quality. Apple doesn't update CoreAudio anymore, so you only have to do the setup process once.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #9
Indeed, the situation of multi-channel AAC was not good … in the past.
As is written here, channel model of AAC is rather complex and unnecessarily flexible.
http://spectralhole.blogspot.com/2010/08/aac-bistream-flaws-part-1-channel-model.html
In other words, it was difficult for decoder to handle it correctly.

Non-standard AAC channel layout requires special treatments (using PCE: program config element), which was not supported by ffmpeg until this patch on 2012:
https://lists.libav.org/pipermail/libav-devel/2012-February/020612.html
(This patch was written by the same very guy who written the blog above, by the way)

Now ffmpeg can correctly handle multichannel AAC files encoded by qaac, including strange ones such as 6.1ch or 7.0ch.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #10
That's good and encouraging to hear about AAC.
I'm not sure what was going on with opus. I tried it on another movie and it played back fine on MPC-HC.
Maybe it has something to do with my editing method. I use ffmpeg to chop it into clips, then join them with MKVToolNix. For each join, the audio seems to go off by half a second. Probably because the final mkv file has a separate audio file for each clip.

Anyway, I don't want to stray too from from the original question.
Processed audio in java and python.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #11
Quote
I'm willing to give Aften a try, but it says it's based off of ffmpeg, and that doesn't have an amazing AC3 encoder.
I've used wavtoac3cncoder which I believe is based on Aften and I didn't hear anything wrong with the audio.

Or, it should be quick-and-easy to try Audacity with the FFmpeg library to see if the AC-3 quality is acceptable before making an MKV.    (I don't think I've ever made an AC-3 file with Audacity but I'm pretty sure it can do it as long as it can open the original WMA file.)

Re: Can Multi-channel wma pro be stored in mkv?

Reply #12
There is a chance they have made improvements beyond ffmpeg. Who knows though. I think it says the last update was in 2008.

I did finally run a test on Plex and it converts opus to EAC3. I didn't notice any compression artifacts, but also didn't try very hard. I think it's passable.

The main issue left is I need to figure out a better way to cut sections out of my videos—since joining them with MKVToolNix seems to be the real source of sound inconsistencies.

Processed audio in java and python.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #13
You can use Avidemux to do simple cuts at keyframes, if your goal is to just cut out pieces of a longer video. You need more advanced processing in order to join the pieces together, so you can either spend lots of time messing with Avisynth, or you can pay for a commercial solution, e.g. VideoReDo. You can't cut and join pieces of an existing video without transcoding, so simply cutting and pasting MKV files together will never work.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #14
You cannot arbitrarily cut and paste, but cutting at keyframes should be lossless. Try https://github.com/mifi/lossless-cut .

Also if Plex converts to EAC3, try if it lets that codec pass through? If that is what it doesn't touch, then that is a case for using it.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #15
You cannot arbitrarily cut and paste, but cutting at keyframes should be lossless. Try https://github.com/mifi/lossless-cut .
Yes, but you cannot paste those chunks together into a new file, because the video frame and audio frame boundaries will not match. The audio usually must be delayed by a certain number of milliseconds at the start of the video in order to synchronise the audio with the video, and if you paste two videos together, the audio in the second half will either be too late or too early and will almost never be aligned properly.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #16
Yes, but you cannot paste those chunks together into a new file, because the video frame and audio frame boundaries will not match. The audio usually must be delayed by a certain number of milliseconds at the start of the video in order to synchronise the audio with the video, and if you paste two videos together, the audio in the second half will either be too late or too early and will almost never be aligned properly.
And that's where I'm at now. Since I'm running an AI upscaler, I'm transcoding already. I dumped all the frames as image files into one folder. But yes. After converting them back into a movie file, the sound is super off even after the first cut.

Try https://github.com/mifi/lossless-cut .
I think I tried that last year, but the key frames don't align with scene changes, somehow. I still have it, so I can try again.
Processed audio in java and python.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #17
Yup. The easiest way to fix it is to transcode the audio, too. Decode the entire soundtrack to WAV so you can make cuts at the appropriate millisecond boundaries, then stitch the WAV files back together and encode the new WAV to AAC or Opus.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #18
Are you making any changes to the movie aside from upscaling and re-encoding? If not, I see no reason why you would need to cut the audio into segments and stitch it back together in the first place - just transcode (if necessary) and multiplex with your final video.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #19
Yes I am. I am cutting out sections. For movies that I don't need to do that, that approach works awesome.
Processed audio in java and python.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #20
Ignorant question: Is there any provision in Matroska to set chapter marks so that sections are skipped upon playback?

Re: Can Multi-channel wma pro be stored in mkv?

Reply #21
No, but you can use the ordered chapters feature to cut the film into chunks and then build a "playlist" into the first MKV, which will auto load the other MKV files in the order you specify, as if they were a single contiguous movie. This is useful if you plan to view the files on a PC, but it's fairly useless for hardware players, as they generally don't support ordered chapters.

Re: Can Multi-channel wma pro be stored in mkv?

Reply #22
I've used wavtoac3cncoder which I believe is based on Aften and I didn't hear anything wrong with the audio.
Thanks for this. That was really easy to use and I also didn't notice anything bad. Okay, there are tons of options, but I just left them at the defaults.
Yup. The easiest way to fix it is to transcode the audio, too. Decode the entire soundtrack to WAV so you can make cuts at the appropriate millisecond boundaries, then stitch the WAV files back together and encode the new WAV to AAC or Opus.
That's what I ended up doing. I just had to figure out how many milliseconds to cut out at each cut point. There might be some programmatic way to do it, but just by ear, I think I got it good enough. Luckily, I don't plan on doing many more edits like this.
Processed audio in java and python.