MKV remux.. how to enable DTS->AC3

Questions regarding media streaming across varied protocols, including UPnP/DLNA/CIFS can be placed here.

MKV remux.. how to enable DTS->AC3

Postby Educated Pork » Mon Dec 05, 2011 7:10 pm

Currently on my DS212 (with DSM 3.2), MKV remuxing seems to always convert multichannel audio to 2 channel. In my case, I've tried streaming to a PS3 (with the PS3-specific DMA profile, and also the Generic Profile), and to an Xbox 360. Same behaviour for both.

If I use PS3 Media Server on my PC, and stream (with remux only, no video transcoding) to a receiver (eg: my PS3), then MKVs with DTS play back 5.1 channel AC3. MKVs with AC3 stream without transcoding.

From this and other posts in this group, I know that ffmpeg (used as part of the Media Server package) can downconvert DTS audio to AC3 (and pass through AC3), and that PS3 can handle a stream with H264 video and AC3 audio.

If there's no way of getting this to work with the current implementation, then I'd like to request that the Media Server component of DSM 3.x be enhanced to allow for DTS->AC3 and AC3 passthrough. Is there a process for requesting additional features for the Media Server component?

Thanks,
Dean
Educated Pork
Trainee
Trainee
 
Posts: 15
Joined: Mon Dec 05, 2011 7:01 pm

Re: MKV remux.. how to enable DTS->AC3

Postby Taxman » Wed Dec 07, 2011 11:06 am

Have you tried using Serviio instead of the built in DLNA server.
Taxman
Guru
Guru
 
Posts: 1423
Joined: Sun Mar 23, 2008 1:45 pm

Re: MKV remux.. how to enable DTS->AC3

Postby Educated Pork » Thu Dec 08, 2011 7:01 pm

Hi Taxman,

Thanks for the reply. At this moment, I'm wanting to just use the stock firmware on the DS212. I've only just got the unit, and am still getting to grips with it, so will likely hold off on installing other non-Synology apps on it for the time being. I'll definitely bear this option in mind should Synology not offer any response (or offer a response that's not what I'm looking for).

Cheers,
Dean
Educated Pork
Trainee
Trainee
 
Posts: 15
Joined: Mon Dec 05, 2011 7:01 pm

Re: MKV remux.. how to enable DTS->AC3

Postby Educated Pork » Thu Dec 08, 2011 11:18 pm

Hello,

I reckon this looks to involve a minor(ish) change to /usr/syno/mediaserver/transcoder/genericoder.cgi executable. A cursory glance at the executable seems to indicate that the MKV remuxing path ends up calling ffmpeg with a fixed set of audio parameters (-acodec ac3 -ab 192k -ac 2). This would explain why I'm seeing 2-channel DD audio regardless of the input in the MKV.

I reckon the media server library already knows what the format of the input audio is (and the number of channels) is as part of the indexing process. So I would suggest a UI option to allow for multi-channel audio, and then - if set - override the number of audio channels ('-ac 2') to be the number of input channels. If the input format is already AC3, then this could probably just be a case of doing '-acodec copy' to save the unnecessary transcode of audio). The same may also apply to AVI files (XviD/DivX) that contain AC3 audio tracks - they should optionally be shoved over to the renderer without further modification (should it support it).

No source available for genericoder.cgi, unfortunately - I downloaded the 140MB GPL source .tar.gz to no avail) - but if Synology wanted to send it my way, I'd be happy to have a look in my spare time (note: I'm a programmer on embedded systems by day).

Any thoughts, Synology staff?

Dean
Educated Pork
Trainee
Trainee
 
Posts: 15
Joined: Mon Dec 05, 2011 7:01 pm

Re: MKV remux.. how to enable DTS->AC3

Postby Educated Pork » Fri Dec 09, 2011 11:52 am

While I wait in hope for a response from Synology support (or development staff), I just made a local modification to /usr/syno/mediaserver/transcoder/genericoder.cgi to not force downmixing to 2 channels.

Based on DSM3.2-1955 on my DS212, if you modify a single byte in genericoder.cgi at offset 0x3920 from 0x20 to 0x00, this ends up dropping the '-ac 2' option from the parameters being passed to ffmpeg. Make sure you take a backup of the original genericoder.cgi file, just in case!

I've just tested with a number of MKVs with both 5.1 DTS and 5.1 AC3, and I now have multichannel audio coming from my PS3 when I play them back.

With luck a more official way of selecting that I want multichannel audio to be passed through (along the lines of a UI choice that enables the omission of the '-ac 2' override I described above to genericoder.cgi) will be forthcoming.

Anyway, I hope this helps some people out there..

Cheers,
Dean

p.s. Goes without saying that if you make this modification, it's at your own risk. Warranty void where prohibited by law, etc etc..
Educated Pork
Trainee
Trainee
 
Posts: 15
Joined: Mon Dec 05, 2011 7:01 pm

Re: MKV remux.. how to enable DTS->AC3

Postby tommyhj » Sun Feb 05, 2012 12:43 am

Mighty interresting... I just upgraded my old syno 109 box to dsm3.2 hoping once and for all they made a remuxing engine for 1080p DTS mkv's to play on the PS3. reading this doesn't get my hopes up...

It's been years since the DTS-PCM trick was discovered to allow the ps3 to play DTS from streamed sources by remuxing it into a 2ch pcm track. So naturally I thought the syno devs would have incorporated that in their mkv remuxing engine - tsmuxer is opensource anyway. Seems they didn't, since they use ffmpeg that can't do the dts-pcm trick.

Why is this taking so long to implement?
tommyhj
Novice
Novice
 
Posts: 54
Joined: Sun Jun 07, 2009 8:01 pm

Re: MKV remux.. how to enable DTS->AC3

Postby moneytoo » Sat Mar 10, 2012 12:46 am

Thank you so much for the suggested workaround.

Anyone knows what's the situation with current DSM 4.0?
moneytoo
Trainee
Trainee
 
Posts: 11
Joined: Sat Mar 10, 2012 12:31 am

Re: MKV remux.. how to enable DTS->AC3

Postby Educated Pork » Sat Mar 10, 2012 3:11 pm

Hi moneytoo,

moneytoo wrote:Anyone knows what's the situation with current DSM 4.0?


I installed DSM 4.0 yesterday on my DS212 (after reverting the change I described in my initial post), and I'm happy to report that everything seems to be working without any modifications when testing on my PS3. I've had success playing back MKV+DTS (where the DTS is transcoded to AC3 on streaming), and also MP4+AAC (where the 5.1 AAC audio track is passed through directly).

Really happy with DSM 4.0 so far.. If Synology members are reading this, then thanks ever so much!

Regards,
Dean
Educated Pork
Trainee
Trainee
 
Posts: 15
Joined: Mon Dec 05, 2011 7:01 pm

Re: MKV remux.. how to enable DTS->AC3

Postby AngeloTS » Wed Apr 11, 2012 12:50 am

Educated Pork wrote:Currently on my DS212 (with DSM 3.2), MKV remuxing seems to always convert multichannel audio to 2 channel. In my case, I've tried streaming to a PS3 (with the PS3-specific DMA profile, and also the Generic Profile), and to an Xbox 360. Same behaviour for both.

If I use PS3 Media Server on my PC, and stream (with remux only, no video transcoding) to a receiver (eg: my PS3), then MKVs with DTS play back 5.1 channel AC3. MKVs with AC3 stream without transcoding.

From this and other posts in this group, I know that ffmpeg (used as part of the Media Server package) can downconvert DTS audio to AC3 (and pass through AC3), and that PS3 can handle a stream with H264 video and AC3 audio.

If there's no way of getting this to work with the current implementation, then I'd like to request that the Media Server component of DSM 3.x be enhanced to allow for DTS->AC3 and AC3 passthrough. Is there a process for requesting additional features for the Media Server component?

Thanks,
Dean


Could you please help me with this, because I don't have the slightest clue what you mean by "modify 1byte " ...could you explain this please and also how I can do the same...?

Thanks in advance. :)
AngeloTS
I'm New!
I'm New!
 
Posts: 3
Joined: Wed Apr 11, 2012 12:45 am

Re: MKV remux.. how to enable DTS->AC3

Postby Taxman » Wed Apr 11, 2012 11:07 am

AngeloTS wrote:Could you please help me with this, because I don't have the slightest clue what you mean by "modify 1byte " ...could you explain this please and also how I can do the same...?

Thanks in advance. :)


If you want to remux manually and preserve the AC3 5.1 audio track which is a more reliable system use MKV2MP4.
Taxman
Guru
Guru
 
Posts: 1423
Joined: Sun Mar 23, 2008 1:45 pm

Re: MKV remux.. how to enable DTS->AC3

Postby AngeloTS » Wed Apr 11, 2012 1:21 pm

Taxman wrote:
AngeloTS wrote:Could you please help me with this, because I don't have the slightest clue what you mean by "modify 1byte " ...could you explain this please and also how I can do the same...?

Thanks in advance. :)


If you want to remux manually and preserve the AC3 5.1 audio track which is a more reliable system use MKV2MP4.


I understand I can use or do this, but thats just the point, I dont want to use a pc to change anything, I just want to use the Nas with my ps3 with the ability to change audio streams so that I can listen to some other languages that I do understand. This is all temporarily (I hope) till I can jailbreak my Apple tv3.

So it has to be on the Nas...I tried Serviio, but it lacks on the some ability.
AngeloTS
I'm New!
I'm New!
 
Posts: 3
Joined: Wed Apr 11, 2012 12:45 am

Re: MKV remux.. how to enable DTS->AC3

Postby AngeloTS » Wed Apr 11, 2012 11:35 pm

Educated Pork wrote:While I wait in hope for a response from Synology support (or development staff), I just made a local modification to /usr/syno/mediaserver/transcoder/genericoder.cgi to not force downmixing to 2 channels.

Based on DSM3.2-1955 on my DS212, if you modify a single byte in genericoder.cgi at offset 0x3920 from 0x20 to 0x00, this ends up dropping the '-ac 2' option from the parameters being passed to ffmpeg. Make sure you take a backup of the original genericoder.cgi file, just in case!

I've just tested with a number of MKVs with both 5.1 DTS and 5.1 AC3, and I now have multichannel audio coming from my PS3 when I play them back.

With luck a more official way of selecting that I want multichannel audio to be passed through (along the lines of a UI choice that enables the omission of the '-ac 2' override I described above to genericoder.cgi) will be forthcoming.

Anyway, I hope this helps some people out there..

Cheers,
Dean

p.s. Goes without saying that if you make this modification, it's at your own risk. Warranty void where prohibited by law, etc etc..



Could you explain this to me please How I can modify this myself
AngeloTS
I'm New!
I'm New!
 
Posts: 3
Joined: Wed Apr 11, 2012 12:45 am

Re: MKV remux.. how to enable DTS->AC3

Postby Pier » Tue Jul 24, 2012 6:34 pm

Educated Pork wrote:While I wait in hope for a response from Synology support (or development staff), I just made a local modification to /usr/syno/mediaserver/transcoder/genericoder.cgi to not force downmixing to 2 channels.

Based on DSM3.2-1955 on my DS212, if you modify a single byte in genericoder.cgi at offset 0x3920 from 0x20 to 0x00, this ends up dropping the '-ac 2' option from the parameters being passed to ffmpeg. Make sure you take a backup of the original genericoder.cgi file, just in case!

I've just tested with a number of MKVs with both 5.1 DTS and 5.1 AC3, and I now have multichannel audio coming from my PS3 when I play them back.

With luck a more official way of selecting that I want multichannel audio to be passed through (along the lines of a UI choice that enables the omission of the '-ac 2' override I described above to genericoder.cgi) will be forthcoming.

Anyway, I hope this helps some people out there..

Cheers,
Dean

p.s. Goes without saying that if you make this modification, it's at your own risk. Warranty void where prohibited by law, etc etc..


Hi Dean,

I'm also experiencing the very same issue (running DSM 4.0): I can play an mkv file only with audio2 and not audio1 on the PS3.

Please, can you post a short step by step guide on how to manually modify the genericoder.cgi file to select the audio stream to play? This would be veeeery helpful! :D

Many thanks!
Pier
User avatar
Pier
I'm New!
I'm New!
 
Posts: 5
Joined: Fri Dec 04, 2009 2:46 pm
Location: Milan, Italy

Re: MKV remux.. how to enable DTS->AC3

Postby Blackcloak » Mon Oct 15, 2012 12:46 am

I have the same problem as the one above, so I'd like to know how you modified the .cgi too.
(and it seems, that there is no mediaserver-dir in usr/syno/ on my station)
Blackcloak
I'm New!
I'm New!
 
Posts: 1
Joined: Mon Oct 15, 2012 12:42 am


Return to Media Server

Who is online

Users browsing this forum: Vocoder and 2 guests