FAQ  •  Register  •  Login

Convert DTS indipendent to Container or Video Codec

<<

herby88

Serviio newbie

Posts: 10

Joined: Sun Jan 08, 2017 2:33 pm

Post Tue Feb 07, 2017 8:58 am

Convert DTS indipendent to Container or Video Codec

Hi,

could someone please help me editing Profile to always convert DTS?
Generic Profile would do pretty well for me. (The Panasonic Profiles Change Aspect, or try to convert Video, which isnt needed...)
Would be great, to get some Feedback :)

thanks in advance
Herby
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Tue Feb 07, 2017 11:35 am

Re: Convert DTS indipendent to Container or Video Codec

Create your own profile, by adding the following example into your config\profiles.xml file just before the last line (just before the line containing containing </Profiles>):

  Code:
<Profile id="myProfile" name="My Profile" extendsProfileId="1">
   <Transcoding>
      <Video targetContainer="mpegts" targetACodec="ac3" aBitrate="384">
         <Matches container="*" aCodec="dca" />
         <Matches container="*" aCodec="dts-hd" />
      </Video>
   </Transcoding>
</Profile>
After saving and closing the file, you must restart your PC (or the Serviio Service if you know how to do that).

Once done you will need to assign your device to this profile. In Serviio Console, find your device on the Status page, edit it and select your new profile from the drop down list in the Profile text box (it should be the last one). Press OK and then Save.

Or... you may want to try my Panasonic 2015 Profile as your starting point (I have modified to support transcoding of DTS. If your TV supports any of the formats below simply remove the line - eg. if it supports H265 remove the line <Matches container="*" vCodec="h265" />):

  Code:
<Profile id="viera2015" name="Panasonic Viera (2015)" extendsProfileId="1">
   <!-- Panasonic Viera 2015 Models:
      LED/LCD's: CS610, CS650
   Supports native streaming of mainstream MP4, MKV and XVid files -->
   <Detection>
      <UPnPSearch>
         <FriendlyName>.*CS6(1|5)0_Series.*</FriendlyName>
         <Manufacturer>Panasonic</Manufacturer>
      </UPnPSearch>
   </Detection>
   <ContentDirectoryMessageBuilder>org.serviio.upnp.service.contentdirectory.PacketVideoDLNAMessageBuilder</ContentDirectoryMessageBuilder>
   <Transcoding>
      <!-- Transcode h265 videos and a few others to mpegts with ac3 audio -->
      <Video targetContainer="mpegts" targetVCodec="mpeg2video" DAR="16:9" targetACodec="ac3" aBitrate="384" forceInheritance="true">
         <Matches container="*" vCodec="h265" />
         <Matches container="*" vCodec="h264" profile="high_10" />
         <Matches container="mp4" vCodec="mjpeg" />
         <Matches container="mpeg" vCodec="mpeg1video" />
         <Matches container="matroska" vCodec="vp8" />      
         <Matches container="matroska" vCodec="vp9" />
         <Matches container="ogg" />
         <Matches container="rm" />
      </Video>
      <!-- remux DTS/TrueHD in MKV/MP4 to AC3 -->
      <Video targetContainer="mpegts" targetACodec="ac3" aBitrate="384" forceInheritance="true">
         <Matches container="*" vCodec="h264" aCodec="dca" />
         <Matches container="*" vCodec="h264" aCodec="dts-hd" />
         <Matches container="*" vCodec="h264" aCodec="truehd" />
      </Video>
      <!-- Transcode DivX (XVid is supported) -->
      <Video targetContainer="mpegts" targetVCodec="mpeg2video" targetACodec="ac3" aBitrate="384">
         <Matches container="avi" vCodec="mpeg4" vFourCC="div3,div4,div5,divx,dm4v,dx50" />
         <Matches container="avi" vCodec="msmpeg4" vFourCC="div3,div4,div5,divx,dm4v,dx50" />
         <Matches container="avi" vCodec="dvvideo" />
      </Video>
      <!-- unsupported audio will be transcoded into lpcm audio -->
      <Audio targetContainer="lpcm" forceInheritance="true">
         <Matches container="ogg" />
         <Matches container="asf" />
         <Matches container="adts" />
         <Matches container="wv" />
         <Matches container="mpc" />
         <Matches container="ape" />
         <Matches container="dsf" />
      </Audio>
   </Transcoding>
   <AudioTrackRemux>
      <Video targetContainer="mpegts" targetACodec="ac3" aBitrate="384">
         <Matches container="*" vCodec="h264" />
         <Matches container="*" vCodec="mpeg2video" />
         <Matches container="*" vCodec="mpeg1video" />
         <Matches container="*" vCodec="mpeg4" />
         <Matches container="*" vCodec="msmpeg4" />
      </Video>
   </AudioTrackRemux>
   <GenericTranscoding>
      <Video targetContainer="mpegts" targetVCodec="mpeg2video" DAR="16:9" targetACodec="ac3" aBitrate="384" />
   </GenericTranscoding>
   <Subtitles>
      <SoftSubs mime-type="text/srt" character-encoding="utf-8" />
   </Subtitles>   
   <ThumbnailsResolution>HD</ThumbnailsResolution>
</Profile>
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

herby88

Serviio newbie

Posts: 10

Joined: Sun Jan 08, 2017 2:33 pm

Post Tue Feb 07, 2017 11:48 am

Re: Convert DTS indipendent to Container or Video Codec

Hey,

thanks for the fast Reply!
i tried the Pana2015, but also with the Basic Profile you provided me, i'm always crashing the Service after editing :(

already tried XML Editors with checks if ist valid. i'm using Notepad++ editing.

Profile should be:
  Code:
</Profile>

<Profile>
.....Code....
</Profile>

</Profiles>


Right?

this is my log:

  Code:
2017-02-07 12:41:39,306 ERROR [XmlUtils] XML Profiles.xsd didn't pass validation, reason: cvc-complex-type.2.3: Element 'Video' darf keine Zeichen [untergeordnete Elemente] haben, da der Contenttyp des Typs 'element-only' ist.
2017-02-07 12:41:39,306 ERROR [MediaServer] An unexpected error occured. Ending the application. Message: org.serviio.profile.ProfilesDefinitionException: Profiles XML file is not valid (according to the schema). Check the log.
java.lang.RuntimeException: org.serviio.profile.ProfilesDefinitionException: Profiles XML file is not valid (according to the schema). Check the log.
   at org.serviio.profile.ProfileManager.parseProfilesFromFile(ProfileManager.java:183)
   at org.serviio.profile.ProfileManager.loadProfiles(ProfileManager.java:156)
   at org.serviio.MediaServer.main(MediaServer.java:134)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:498)
   at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:62)
   at com.exe4j.runtime.WinLauncher$2.run(WinLauncher.java:96)
Caused by: org.serviio.profile.ProfilesDefinitionException: Profiles XML file is not valid (according to the schema). Check the log.
   at org.serviio.profile.ProfilesDefinitionParser.validateXML(ProfilesDefinitionParser.java:1036)
   at org.serviio.profile.ProfilesDefinitionParser.parseDefinition(ProfilesDefinitionParser.java:162)
   at org.serviio.profile.ProfileManager.parseProfilesFromFile(ProfileManager.java:181)
   ... 8 more
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Tue Feb 07, 2017 12:04 pm

Re: Convert DTS indipendent to Container or Video Codec

Perhaps just post (as an attachment) your modified profiles.xml file (you are just adding to the existing one, not creating a fresh one?). Also, what version of Serviio are you using (profile is for version 1.8)

Profile should be:
  Code:
<?xml version="1.0" encoding="UTF-8"?>
<Profiles version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.serviio.org/xsd/profiles/v/1.8/Profiles.xsd">

... Existing Profiles....

<Profile>
.....Code....
</Profile>

</Profiles>
I may have had something wrong in the small profile above - have edited it.
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

herby88

Serviio newbie

Posts: 10

Joined: Sun Jan 08, 2017 2:33 pm

Post Tue Feb 07, 2017 1:02 pm

Re: Convert DTS indipendent to Container or Video Codec

Hey there,

i'm editing the existing one. i'm pretty sure, it's some stupid Little mistake :?

this is my profiles.XML

Kind regards
Attachments
profiles.xml
(160.37 KiB) Downloaded 739 times
<<

atc98092

User avatar

DLNA master

Posts: 5205

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Tue Feb 07, 2017 1:59 pm

Re: Convert DTS indipendent to Container or Video Codec

I don't see any errors in your profile. Any chance you accidentally altered something elsewhere in the file? I suggest completely removing your two additions and see if the file still causes an error. Once you have a functioning profile file again, then just add your new profile and test it, then add the Panasonic 2015 profile and test again. One step at a time.

Any chance you saved a copy of the file before you began editing? Yeah, I never do either. And it's burned me occasion. :lol:
Dan

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

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

herby88

Serviio newbie

Posts: 10

Joined: Sun Jan 08, 2017 2:33 pm

Post Tue Feb 07, 2017 2:14 pm

Re: Convert DTS indipendent to Container or Video Codec

well, i've already done so...several times :( undoing my changes always fix the starting issue.
i think, i cant Change anything in the profiles.xml, even remove "unneeded" profiles will Crash the Service.

the only part which i was able to edit, was uncommenting the transcode DTS part in the Pana2013 Profile. This fixed Basic serviio usage, like on my old Pana ETW60 TV (but, well, paid for shiny 4k :lol: )

To avoid some Keyboard/Format/Encoding/stuff error, could you send me an Default+pana2015 profiles.xml?
so i could try to simply replace it?

regards,
herby
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Tue Feb 07, 2017 9:59 pm

Re: Convert DTS indipendent to Container or Video Codec

Wierd. It must be something happening when copying and pasting to or from the forum.

I replaced all the spaces at the front of any line in your two added profiles with the appropriate amount of tabs and it fixes your profile. Not sure wtf is happening there. Attached.
Attachments
profiles.xml
(159.85 KiB) Downloaded 658 times
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

herby88

Serviio newbie

Posts: 10

Joined: Sun Jan 08, 2017 2:33 pm

Post Wed Feb 08, 2017 8:50 am

Re: Convert DTS indipendent to Container or Video Codec

Hi there,

indeed! copied over your file, and Service started easily :roll:
after some testing i'm only missing one Thing. Some HEVC/h265 files still got converted. in the 2015 Profile is a line for it, but maybe the combination Audio/video causes this.

added a screenshot of mkvtoolnix/mkvinfo - hope this helps.

but really, really thank you guys :D

regards
Attachments
mkvinfo.PNG
mkvinfo.PNG (67.71 KiB) Viewed 12687 times
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Wed Feb 08, 2017 9:00 am

Re: Convert DTS indipendent to Container or Video Codec

The line in the profile is what tells serviio to transcode (do the conversion), so if your TV supports H.265 natively then remove the line <Matches container="*" vCodec="h265" /> from the Panasonic 2015 profile. Make sure you restart after saving.
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

herby88

Serviio newbie

Posts: 10

Joined: Sun Jan 08, 2017 2:33 pm

Post Wed Feb 08, 2017 9:16 am

Re: Convert DTS indipendent to Container or Video Codec

Removing the line stops converting Video, but also skips dts(-hd) convert. (-Audio Format is not supported-)
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Wed Feb 08, 2017 12:37 pm

Re: Convert DTS indipendent to Container or Video Codec

OK - I see what is happening. Change:

  Code:
<Matches container="*" vCodec="h264" aCodec="dca" />
<Matches container="*" vCodec="h264" aCodec="dts-hd" />
<Matches container="*" vCodec="h264" aCodec="truehd" />
to
  Code:
<Matches container="*" aCodec="dca" />
<Matches container="*" aCodec="dts-hd" />
<Matches container="*" aCodec="truehd" />
That should do it (assuming your TV will support H.265 inside an MPEG-TS container).
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

herby88

Serviio newbie

Posts: 10

Joined: Sun Jan 08, 2017 2:33 pm

Post Thu Feb 09, 2017 9:28 am

Re: Convert DTS indipendent to Container or Video Codec

Well, i dont get it :cry:
Removing <Matches container="*" vCodec="h265" /> --> Video flawless, no Audio
changing
<Matches container="*" aCodec="dca" />
<Matches container="*" aCodec="dts-hd" />
<Matches container="*" aCodec="truehd" />
causes file not supported.
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Thu Feb 09, 2017 10:34 am

Re: Convert DTS indipendent to Container or Video Codec

Well it's like I said... "assuming your TV will support H.265 inside an MPEG-TS container"

I assume the offending file has H.265 video and DTS audio. In which case the changes above will cause the audio to be transcoded (which you require) and then the H265 video and (now) AC-3 audio to be packaged inside an MPEG-TS container. It's the last part that your TV doesn't like (either H265 inside mpeg-ts or UHD video inside mpeg-ts).

You could either:

  • try changing the container you're transcoding to HLS: ie. change <Video targetContainer="mpegts" targetACodec="ac3" aBitrate="384" forceInheritance="true"> to <Video targetContainer="applehttp" targetACodec="ac3" aBitrate="384" forceInheritance="true">. This requires that your TV can support this container, video and audio combination.
  • transcode the H265 video in just these cases. Where the <Matches container="*" vCodec="h265" /> was previously located add the following:
    <Matches container="*" vCodec="h265" aCodec="dca" />
    <Matches container="*" vCodec="h265" aCodec="dts-hd" />
    <Matches container="*" vCodec="h265" aCodec="truehd" />
  • Use a tool such as mkvmerge to re-order the audio tracks so that DTS is not the first track (assumes that there is more than one audio track). This will allow the file to be played natively which is always better than transcoding
  • Where a suitable second audio track doesn't exist, use a tool such as XMediaRecode to create an AC-3 audio track from the DTS one, ensuring the AC-3 track is first. This will allow the file to be played natively which is always better than transcoding
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

herby88

Serviio newbie

Posts: 10

Joined: Sun Jan 08, 2017 2:33 pm

Post Wed Feb 15, 2017 8:33 pm

Re: Convert DTS indipendent to Container or Video Codec

Hi again,
did some testing with xEncode. Works pretty good so far. Just for understanding, live encode back to an mkv isnt possible with ffmpeg? is this a Media/Streaming behavior? Simply changing the Audio codec isnt that much work (for cpu) and runs for an 60gb 4k less than a hour.
As i'm looking for a Streaming device for my Needs i dont wont to remove the good truehd lines ;)
Thanks alot for your Support!
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Wed Feb 15, 2017 10:48 pm

Re: Convert DTS indipendent to Container or Video Codec

live encode back to an mkv isn't possible with ffmpeg
It is possible to encode to MKV with ffmpeg, but that's not the problem. MKV is not a suitable format for on-the-fly transcoding and streaming - the problem is for an MKV file to be streamed the whole file must exist (critical information cannot be added to the MKV header until after the file is fully encoded). It's not a Serviio limitation, it's a streaming one.

Appreciate what you say about audio transcoding being CPU friendly, but it is still too slow (the request from your TV would time out before the encode was complete even for smaller files).

ps. If you are using XMediaRecode the trick is to copy streams wherever possible (rather than encode, as copying results in no loss of quality). So copy the video stream, encode the DTS audio stream to AC-3 as the first audio stream, and then copy the DTS audio to the second audio stream (so as to retain it) and copy all other streams (subtitles etc).
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.

Return to Transcoding

Who is online

Users browsing this forum: No registered users and 12 guests

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