Detect specific codec for format

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
DJX
Posts: 17
Joined: Mon May 26, 2014 3:35 pm

Detect specific codec for format

Post by DJX »

I have my entire audio library in WMA lossless which is actually not supported on most renderers that typically support WMA.
Because of that, I have to hack the renderer config for all my devices and comment out the supported audio format:

Code: Select all

#Supported = f:wma   m:audio/x-ms-wma
It would be nice if UMS would probe the file (ffprobe) and transcode the file if the specific codec inside the format is not supported.
User avatar
mik_s
Moderator
Posts: 1115
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: Detect specific codec for format

Post by mik_s »

UMS uses MediaInfo to get the the codec the file is encoded in, but the conf needs to have "MediaInfo = true" set to be used.

Also the conf file for your renderer needs to have the correct supported section so it knows whether to stream or transcode.

I have no idea what the difference in the codec for WMA and WMA lossless. In theory setting just the codec for WMA as just the lossy version should do it like

Code: Select all

Supported = f:wma	a:wma	m:audio/x-ms-wma
that is as long as the codec for lossless is different than WMA. If both use the same codec name I don't know if one or the other can be differentiated.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: Detect specific codec for format

Post by Nadahar »

I'm not sure about the current UMS code, but I think it's identical with the corresponding DMS code:

Code: Select all

	public static final String WMA = "wma";
	public static final String WMA10 = "wma10";
	public static final String WMALOSSLESS = "wmalossless";
	public static final String WMAPRO = "wmapro";
	public static final String WMAVOICE = "wmavoice";
If so, that means that "wma", "wma10", "wmalossless", "wmapro" and "wmavoice" are all different codecs that can be specified (just "wma" is probably the "base" version only). You must use the "a:" (audio codec) parameter to specify this though, the "f:" (format) only looks at the file/container format, which I believe is the same for all the WMA variants when stored as audio files. This means that specifying "a:wma" should mean that all the other variants, including wma lossless, would be transcoded.
DJX
Posts: 17
Joined: Mon May 26, 2014 3:35 pm

Re: Detect specific codec for format

Post by DJX »

My above example is for the Xbox 360.
It has:

Code: Select all

# Supported audio formats:
Supported = f:mp3   m:audio/mpeg
Supported = f:wma   m:audio/x-ms-wma
But I have to comment out the WMA line because it tries to send any WMA file without transcoding it.
I'll try switching that to

Code: Select all

Supported = a:wma   m:audio/x-ms-wma
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: Detect specific codec for format

Post by Nadahar »

Don't do that, you need to have the format specified as well. Use:

Code: Select all

Supported = f:wma a:wma  m:audio/x-ms-wma
Without the format parameter you're saying to UMS that the renderer can play ANY file, audio or video, as long as it has a WMA audio track it in. That's certainly not correct ;)
DJX
Posts: 17
Joined: Mon May 26, 2014 3:35 pm

Re: Detect specific codec for format

Post by DJX »

That works.
Thanks.
I would recommend adding this to all renderers that this project supports as most devices that say they support WMA do not support WMA lossless.
I'm sure some support WMA Pro or WMA10 but almost nothing out there supports lossless.
So I suppose more testing could be done to get a complete list.
User avatar
mik_s
Moderator
Posts: 1115
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: Detect specific codec for format

Post by mik_s »

Yeah it would be better to have better codec matching for audio formats, but I don't think there is much variety for that to be needed in the same way that it is needed for video.
also it is impossible to predict which codecs will become popular in the future so old confs just match the file extension assuming that only basic codec will be used.

I don't know how old WMA lossless is, I had only heard of FLAC for lossless audio before and I know that is quite common.

It would be possible to just add that change to all existing confs, but quite a few of them would be able to play any WMA codec so would break proper playback on those devices.
So it would take testing on all those devices to see which will play them which is not really possible to the devs as they will not have access to them all, so we rely on users to do the testing.

If you do some testing on the devices you have and post your updated confs for them, we can update them future versions of UMS.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
DJX
Posts: 17
Joined: Mon May 26, 2014 3:35 pm

Re: Detect specific codec for format

Post by DJX »

I understand.
WMA lossless came in just after WMA 9, so around 2003.
It's pretty old but adoption was low.
Current version is 9.2
You can start with the Xbox 360 profile for sure.
If I have time, I'll test more formats.
Post Reply