FAQ  •  Register  •  Login

Transcode DTS-ES (and DTS-HD?), but not DTS

<<

QT007

Serviio newbie

Posts: 9

Joined: Sun Jul 28, 2019 7:39 pm

Post Sun Jul 28, 2019 7:59 pm

Transcode DTS-ES (and DTS-HD?), but not DTS

Hello, newbie to forum, but long time serviio user ;.)
I have recently got some videos with DTS-ES.
I have 2 serviio installations - on the PC and on my synology NAS.
My BlueRay-Player (LG BP420) is pretty old, but can play most stuff, including DTS, but not DTS-ES (not sure about DTS-HD).

I've got made my first transcoding profile adjustment working like this after reading many threads in the forum.
  Code:
         <Video targetContainer="mpegts" targetACodec="ac3" aBitrate="512"  maxWidth="1920" maxHeight="1080">
            <Matches container="*" aCodec="dca" />   
            <Matches container="*" aCodec="dts-hd" />   
            <Matches container="*" aCodec="truehd" />   
         </Video>

But this transcodes DTS too and takes several minutes to transcode (copy 10+GB over network, then rewrite) and also several minutes to seek. I think, the dts-hd is not used. Of course I'd like to trnascode only when I have to, mostly for performance reasons.

So, is there a way to distinguish between the DTS formats?

Is there diference between container types as far as seeking is concerned or any way to improve that?

Can serviio still only transcode the first audio track? (I am german, watch mostly english but I want both tracks). The BP can switsch audio tracks just fine for DLNA.
<<

atc98092

User avatar

DLNA master

Posts: 3279

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Sun Jul 28, 2019 9:56 pm

Re: Transcode DTS-ES (and DTS-HD?), but not DTS

Your line that says "<Matches container="*" aCodec="dca" /> " is what is capturing standard DTS. Remove that line and your BD player can handle it. I think the dts-hd line is capturing both DTS-ES and DTS Master Audio, but can't say for sure. I've never seen a file with ES, so I don't know how it's identified by FFMPEG.

I searched for a manual online for your player, and it came back from an Australia LG site. I don't know if that's where you are, but according to the manual it supports via DLNA the following containers:
“.avi”, “.divx”, “.mpg”, “.mpeg”, “.mkv”, “.mp4”, “.asf”, “.wmv”, “.m4v” (DRM free)
the following video codecs:
DIVX3.xx, DIVX4.xx, DIVX5.xx, DIVX6.xx (standard playback only), XVID, MPEG1 SS, H.264/MPEG-4 AVC, MPEG2 PS, MPEG2 TS, VC-1 SM (WMV3)
and the following audio codecs:
Dolby Digital, DTS, MP3, WMA, AAC, AC3 (AC3 and Dolby Digital are the same thing)

For your player, the MKV container appears to be the best fit, as it can hold any codec. For using trick play (FF/rewind/Resume) the HLS (applehttp) transcoding format works the best, but your player doesn't appear to support it. Usually trick play doesn't work for any transcoded files unless using HLS, so your best bet is to recode your videos into supported containers with supported codecs. Then transcoding isn't needed and you can use trick play and select from multiple audio tracks to your hearts content.
Dan

Panasonic ST30 Plasma, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku 4, Ultra and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 8 gig ram, Windows 10 Pro, 18 TB hard drive space | Test server Windows 10 Home, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

QT007

Serviio newbie

Posts: 9

Joined: Sun Jul 28, 2019 7:39 pm

Post Mon Jul 29, 2019 7:06 pm

Re: Transcode DTS-ES (and DTS-HD?), but not DTS

Hey, thanks!
After trying your suggestion to remove dca I was first weirded out then found I overlooked GenericTranscoing tag whch appears to got in the way. Saw that when I found transcoded video was mpeg2.
I'll have to try and fiddle a little more before I bug you again with better info.

ffmpg sax this about the codecs - obviously, two diffrent codecs in one file
Metadata:
creation_time : 2016-12-11T06:35:47.000000Z
handler_name : VideoHandler
Stream #0:1(deu): Audio: dts (DTS-HD MA) (mp4a / 0x6134706D), 48000 Hz, 6.1, s16p (default)
Metadata:
creation_time : 2016-12-11T06:35:47.000000Z
handler_name : Surround
Stream #0:2(eng): Audio: dts (DTS-ES) (mp4a / 0x6134706D), 48000 Hz, 6.1, fltp, 1536 kb/s
----------- other fike, DTS:
Stream #0:1(ger): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 896 kb/s (default) (forced)
Metadata:
<<

atc98092

User avatar

DLNA master

Posts: 3279

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Mon Jul 29, 2019 10:10 pm

Re: Transcode DTS-ES (and DTS-HD?), but not DTS

@Zip will have to respond if Serviio can recognize DTS-ES separately from DTS-HD, but my guess is that any device that needs one transcoded will need the other as well. Many devices can handle standard DTS, but nothing higher (Roku players, Amazon Fire TV, etc.), so it might be a moot point to capture them separately.
Dan

Panasonic ST30 Plasma, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku 4, Ultra and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 8 gig ram, Windows 10 Pro, 18 TB hard drive space | Test server Windows 10 Home, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

QT007

Serviio newbie

Posts: 9

Joined: Sun Jul 28, 2019 7:39 pm

Post Sat Aug 03, 2019 6:18 pm

Re: Transcode DTS-ES (and DTS-HD?), but not DTS

Soory, it took me a whike, but the 'fidding' takes more than a few minutes.
So I ran a litte test setup, wrote everything down and now I am partially wiser and partially more confused.
Test done on AMD Ryzen Eight Core, 32GB, three 10GB video-files on a SSD , one has 1 DTS + 2 AC3; 2 has one DTS-ES; three has DTS-ES + DTS-HD (DTS-HD maybe ffmpg says so, but mediainfo says "DTS ES XXCH XLL (DTS-HD Master Audio" which I find confusing).
First:
  Code:
<MultipleAudioTrackAware>true</MultipleAudioTrackAware>

allows me to have two audio streams for transcoded files, but funnyhow not three. (No detailed test)

Second: transcoding and files/containers/codecs
I figured out that if serviiio does not trancode codecs, it will remux containers on the fly - no tmp/file created. But on my files it takes minutes until video event starts - once over 10 minutes. After that, it can ff and seek well.
If a codec is transcoded, a tmp/file is created. This way, video starts within about 10-15 seconds. FastForward works, but seeking (jumping to a certain time) takes very long, the further I seek, the longer, but just a few minutes will already take almost as long as just watching it.
Either way is unsatisfactory, one takes forever to start, the other forever to seek - not sure which is worse. Any way to speed one or another up? (transcoding video to mpeg2 doesn't make much difference)

Thirdly, the weird part: DTS, DTS-ES, DTS-HD transcoding
  Code:
      <Transcoding>
         <Video targetContainer="mpegts" targetACodec="ac3" aBitrate="512" >
         <!-- dca commented out!
            <Matches container="*" aCodec="dca" />  -->
            <Matches container="*" aCodec="dts-hd" />   
            <Matches container="*" aCodec="truehd" />   
         </Video>
      </Transcoding>
( I have another rule to transcode h265, but that should'nt interfere)
Documentation implies, that this would not transcode DTS, but DTS-HD. DTS-ES is not mentioned in documentation, so not sure.
However, this transcodes none of my audio codecs from above! So video one plays DTS, the others have no audio, since LG BP420 can't play them.
Now If I remove the comments thus including 'dca', DTS is still not transcoded, but both DTS-ES and DTS-HD are! (Both LG BP and the AVR say it's DTS for DTS and ac3 for DTS-ES/HD.
This is what I want but it goes against documentation. Is DTS really 'dca' ? Did I find a bug?

I am perfectly fine if someone tells me I got something totally wrong - I make mistakes. But so far, I can't see what.
I can supply more info like serviio.log in DEBUG or whatever.
Edit: Honouring your comment: Thanks, but there is no way I can recode all my library. Evens so - mkv is the container for file one with DTS, still takes forever to start.
<<

atc98092

User avatar

DLNA master

Posts: 3279

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Sat Aug 03, 2019 9:27 pm

Re: Transcode DTS-ES (and DTS-HD?), but not DTS

One thing to remember is that it makes a difference where in your profile your matches line is. Serviio uses the first matches line that works, starting from the top. So if a higher line was capturing your DTS-HD files but didn't include an audio transcode, that would explain why it appears the matches line isn't working. I had all sorts of problems with that when I designed the Roku profiles until I sorted out what line was making the capture and putting the necessary one above it.
Dan

Panasonic ST30 Plasma, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku 4, Ultra and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 8 gig ram, Windows 10 Pro, 18 TB hard drive space | Test server Windows 10 Home, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

QT007

Serviio newbie

Posts: 9

Joined: Sun Jul 28, 2019 7:39 pm

Post Sun Aug 04, 2019 11:37 am

Re: Transcode DTS-ES (and DTS-HD?), but not DTS

atc98092 wrote:One thing to remember is that it makes a difference where in your profile your matches line is. Serviio uses the first matches line that works, starting from the top.

I am aware of this since I had first messed it up in my first comment, where a GeneralTranscoding Tag was the actually used rule
  Code:
<Video targetContainer="mpegts" targetVCodec="mpeg2video">
      <Matches container="*" vCodec="h265" />   
</Video>

Thats my only other rule. Inherited GenericEncoding from profile 1 left aside, wether that does anything or not...
<<

atc98092

User avatar

DLNA master

Posts: 3279

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Sun Aug 04, 2019 11:32 pm

Re: Transcode DTS-ES (and DTS-HD?), but not DTS

I guess I'd have to see the complete profile, rather than these separate pieces. Inheriting from profile 1 just provides a lot of media type recognition. There is no transcoding in that profile, so it should't be picking anything up from there. But something is obviously tripping you up. I know one error I made once was when I was editing a profile but the box I was testing it with wasn't using that specific profile. I wasted a lot of time before I realized my mistake. Easy to do... :lol:
Dan

Panasonic ST30 Plasma, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku 4, Ultra and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 8 gig ram, Windows 10 Pro, 18 TB hard drive space | Test server Windows 10 Home, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

QT007

Serviio newbie

Posts: 9

Joined: Sun Jul 28, 2019 7:39 pm

Post Mon Aug 05, 2019 8:51 pm

Re: Transcode DTS-ES (and DTS-HD?), but not DTS

ok, here ist the full profile, I kept the comments, part of which are from testing out stuff.
  Code:
   <Profile id="lgbp420" name="LG BP420 BlueRay" extendsProfileId="1">
      <Detection>
         <HttpHeaders>
            <friendlyName.dlna.org>LG.*</friendlyName.dlna.org>
         </HttpHeaders>
      </Detection>
      <!-- ResourceTransportProtocolHandler>org.serviio.upnp.protocol.http.transport.LGProtocolHandler</ResourceTransportProtocolHandler -->
      <MediaFormatProfiles>
         <MediaFormatProfile mime-type="video/mp4" name="">AVI</MediaFormatProfile>
      </MediaFormatProfiles>      
      <Transcoding>
         <!-- transcode h265, any container,just the video, mpeg2video seems fast to start ??
         <Video targetContainer="mpegts" targetVCodec="mpeg2video"> -->
         <Video targetContainer="mpegts" targetVCodec="h264">
            <Matches container="*" vCodec="h265" />   
         </Video>
         <!-- transcode dts-es/hd, any container, just the audio -->
         <!-- we dont have have h265 + dts-hd, so ignore it for now -->
         <!-- <Video targetContainer="mpegts" targetACodec="ac3" aBitrate="512"  maxWidth="1920" maxHeight="1080">  -->
         <Video targetContainer="mpegts" targetACodec="ac3" aBitrate="512" maxWidth="1920" maxHeight="1080">
         <!-- -->
            <Matches container="*" aCodec="dca" />  <!-- docu say DTS, but for me its DTS-ES/HD -->
            <Matches container="*" aCodec="dts-hd" />   
            <Matches container="*" aCodec="truehd" />   
         </Video>
         <!-- Matroska is slow ? mpeg2video on the fly?
         <Video targetContainer="mpegts" targetVCodec="mpeg2video">
            <Matches container="matroska" />   
         </Video> -->
      </Transcoding>
      <GenericTranscoding>
      <!-- disable generic
        <Video targetContainer="mpegts" targetVCodec="mpeg2video" targetACodec="ac3" />       -->
      </GenericTranscoding>
      <MultipleAudioTrackAware>true</MultipleAudioTrackAware>
   </Profile>
<<

atc98092

User avatar

DLNA master

Posts: 3279

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Mon Aug 05, 2019 11:49 pm

Re: Transcode DTS-ES (and DTS-HD?), but not DTS

OK, that particular code you copied here does not have DTS commented out. I know you did in the snippet you copied earlier, but this one is still matching DCA, which transcodes the audio to AC3. I've commented it out again, so give it another try. I'm going on your original statement that you don't need DTS audio transcoded.

I don't think you need the MediaFormatProfile line, as Profile 1 captures almost everything already and your profile inherits everything there. But I didn't remove it, just to minimize the changes. One change at a time when you're testing... :D
Attachments
problem.xml
(1.9 KiB) Downloaded 4 times
Dan

Panasonic ST30 Plasma, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku 4, Ultra and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 8 gig ram, Windows 10 Pro, 18 TB hard drive space | Test server Windows 10 Home, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

QT007

Serviio newbie

Posts: 9

Joined: Sun Jul 28, 2019 7:39 pm

Post Tue Aug 06, 2019 5:52 pm

Re: Transcode DTS-ES (and DTS-HD?), but not DTS

atc98092 wrote:OK, that particular code you copied here does not have DTS commented out. I know you did in the snippet you copied earlier, but this one is still matching DCA, which transcodes the audio to AC3. I've commented it out again, so give it another try.

Thanks, Dan.
I can try that ... again. (Will do later, debug info included, hopefully)
As stated in a previous comment, commenting dca in and out was part of my test setup. For every file I wrote down start time, wether trick play worked and all audio streams reported by ma player/client. Once with, once without dca - one test at a time.
Thing is, for me, dca in catches DTS-ES/HD, but not DTS - which is what I want. Meaning audio works fine for me ... but it should'nt.
Only thing not working great is startup speed and/or trick play - may even be my client.

Still -I could have somethin wrong, just can't see it.

So maybe someone could try wether dca really catches (only) DTS. I only tried that in V2, not previous versions of Serviio.

Kai
<<

QT007

Serviio newbie

Posts: 9

Joined: Sun Jul 28, 2019 7:39 pm

Post Tue Aug 06, 2019 7:35 pm

Re: Transcode DTS-ES (and DTS-HD?), but not DTS

Oh Boy....

I wrote a long answer but I am not sending it.
On a hunch (after playing a demo dts-d file which always got transcoded matching dts-hd), I simply remuxed file 3 from mp4 to mkv.
Funnyhow, no match, so it got delivered in native format. But now my player played both DTS-ES and DTS-HD!! WTF???

To me this means something like this: Serviio may trip over certain container quirks, which keeps it from recognizing a codec properly (just like my player) - which I could see in the debug log.

I feel weird - did I mess up or step on something?


ffmpeg -i for file before/after remuxing
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '333333333333333333333333333333333333333.mp4':
Stream #0:1(deu): Audio: dts (DTS-HD MA) (mp4a / 0x6134706D), 48000 Hz, 6.1, s16p (default)
Stream #0:2(eng): Audio: dts (DTS-ES) (mp4a / 0x6134706D), 48000 Hz, 6.1, fltp, 1536 kb/s

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '333333333333333333333333333333333333333.mkv':
Stream #0:1(ger): Audio: dts (DTS-HD MA), 48000 Hz, 6.1, s16p (default)
Stream #0:2(eng): Audio: dts (DTS-ES), 48000 Hz, 6.1, fltp, 1536 kb/s





As for the big delays on start:
In the debug log, I see a bunch of calls to ffmpeg for the same file - as if each stream (video, audio, subtitles, chapters) is extracted seperately. Lots of stream, big delay.
<<

atc98092

User avatar

DLNA master

Posts: 3279

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Wed Aug 07, 2019 12:31 am

Re: Transcode DTS-ES (and DTS-HD?), but not DTS

Well, there is a slight difference in the the primary audio track between the two, but I don't know what difference they might make. The before listing labeling it as mp4a is puzzling to me. Also, I didn't think DTS-MA was supported in the MP4 container. I wonder if that has something to do with it? @Zip will have to weigh in on this. I've pretty much reached my limits here.
Dan

Panasonic ST30 Plasma, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku 4, Ultra and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 8 gig ram, Windows 10 Pro, 18 TB hard drive space | Test server Windows 10 Home, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

QT007

Serviio newbie

Posts: 9

Joined: Sun Jul 28, 2019 7:39 pm

Post Sun Aug 11, 2019 7:13 am

Re: Transcode DTS-ES (and DTS-HD?), but not DTS

atc98092 wrote:Well, there is a slight difference in the the primary audio track between the two, but I don't know what difference they might make. The before listing labeling it as mp4a is puzzling to me. Also, I didn't think DTS-MA was supported in the MP4 container. I wonder if that has something to do with it? @Zip will have to weigh in on this. I've pretty much reached my limits here.

Yes, it appears to have something to do with it. mp4 does not 'officially' support any DTS. I looked that up. But it can obviously be muxed in. It appears both serviio/ffmpeg and my player stumble over it. I remuxed all mp4's with DTS to mkv and now most everything is playing natively. I discovered my player/avr combo can play much more than I thought - if presented correctly. just true hd and prob atmos won't work.
A rule to transmux just mp4 with dts* as a backup for newer or overlooked files.
The above was tested on the PC.
The ffmeg on the diskstation however seems too old and doesn't handle true hd.

Audioclips for truehd taken from here:
https://kodi.wiki/view/Samples

Return to Transcoding

Who is online

Users browsing this forum: No registered users and 5 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.