Writing profiles for DLNA devices

Thanks for the detailed reply; I think it will help many others.  What I am most concerned with today are those cases where the client does support the container/codecs and the media still wont play with the generic profile:

Unless there is some other problem with the video file, that should not happen.  If your device can play the media files then it can, if it can't play that file it can't.  It is the equivalent of double clicking your file to play it in windows. Having a profile isn't going to change that.  All a profile is going to do is change what the server thinks your device can play, and from that if your profile can't play it then the server will try and transcode it to something that can.  Adding a profile will not give your device extra capabilities, rather it is there to limit what gets sent to the device.

What about situations where a video plays in the Plex browser client, but does not play in the Plex native client, and it only plays on the DLNA TV from Serviio or Universal Media Server (not from PMS) ?  Should I presume that Plex needs custom profiles for the TV and the native Plex client, or should I conclude that the server is buggy and wait for an update?

This has a lot so I will try not to jump around too much in a response.

The web manager already has profiles setup for browsers and for the most part is pretty limited to what can actually be directplayed.

Which Plex native client are you referring to as that makes a big difference? The client on LG's is "supported" (I believe it hit EoL as they no longer use it on new models) by LG directly, the new LG app for newer models is developed by a forum user, the Samsung App was started by a forum user and is maintained by him (I believe it hit its last update for older models recently), And all of those will behave differently from clients on the Android or Plex Home Theater.  

Why it plays on one server vs another comes down to a lot.  The most common difference I have seen is subtitles.  Over DLNA the only way plex handles external srt files is by transcoding so if you try and enable the subtitles the server must transcode the file and if your on the generic profile the file gets sent without subtiles, if you have a custom profile the subtitles are sent burned into the video stream, if you have a custom profile that doesn't work correctly you get errors.  The only difference I have seen has been with transcoded streams and in those I found UMS/Serviio to have extra options in their profiles that let me create profile that would transcode.  Not that it was any easier, but the extra options did make it work.  I actually had both a Plex and UMS server running side by side just to play transcoded streams to my LG until I bought a FireTV.  After that I only run the Plex server because my PS3 works fine over DLNA, the FireTV uses the Android App, and on our PC's I use Plex Home Theater.  But more specifically, you would have to start looking at the logs to figure out if it is a bug in the server or something else causing faulty playback.  Just "It wont play" won't be enough for anyone to try and recreate or debug the issue.

If Plex has a bug, where should I report it?  (I cannot find the bug tracker system).
 

This is going to vary.  Since you keep mentioning the Native Plex App if it is a bug in the client (Which is more likely) it would be in the respective forum to that app, if it is in the server you can usually post in the server board for the OS you are using.  Plex Ninja's will normally read the posts try some troubleshooting with you/request logs before sending the information to the developers.  If you get a PlexPass there is also additional boards you could post on or check.

Why do software DLNA clients such as VLC and Windows Media Player not work with the Plex DLNA server, but do work with other media servers?  Is this a known issue?  Does it affect all Plex servers, or just some particular hardware & OS platforms?

Working with other media servers is relative.  When I tried using WMP with my Twonky server it just gave me a list of every single video file on the drive.  If I tried to select by folder it just called it a video folder and threw them all in there.  Trying to find a specific video file in a list of 8,000 isn't working well in my opinion.  I tried it with UMS and got the same thing as Plex "No files have been found on this remote library".  Personally, I believe that if you want to use Plex I would look at Plex Home Theater or XBMC with PleXBMC add-on over VLC/WMP for DLNA content playback.  Either option will give you full playback along with the all the artwork and structure that Plex provides.

If the generic profile causes the server to send everything, but media which my device can play is not being played, I am a little confused now about whether I should be trying to create a custom profile if it will not enable playback of media that already works on my clients when it comes from other media servers.  Is there a comprehensive guide to configuring other server settings which might explain how to resolve these client compatibility issues?

You are going to be more specific.  If you're using a Plex client (TV app or something) then it is already using it's own form of profile, most of which are built into the app itself.  If your just using a DLNA browser from a TV and it is not playing, I would look at what profile your TV is using on the other server and see if it is indeed remuxing audio/container or something else which should also be visible in the logs.

But the it works on one thing but not another is not enough to try and diagnose the problem.  If it is working on one server we would need to know what profile/settings/logs from the other server is using, the mediainfo for the file, how you are trying to play the file from plex (App/Dlna), and a log after trying to play the file from Plex where it isn't working.

I have tried to create a Sony XBR X850B profile, using a Sony 2013 profile as a starting point.  I'll say up front that's probably not such a great idea, but being unfamiliar with how all the parts of a profile interact, I hoped to get usable results.  What I got, was a mix.  Now my list of movies has the images intact, which is much appreciated!  But when I select any movie, i get video and sound, but the two aren't even within minutes of where they should be - and both make great leaps through the movie.

In general, the generic profile works with this lovely TV, but there are several formats that won't play (notably mkv) and they don't get transcoded (or not properly).  Instead, I get "Content not supported" displayed on the otherwise-blank screen.  And things like subtitles don't work, etc. etc.  (I've had a hard time finding other posts by people who have tried this sort of thing.)

I'm not sure where to look into what might be the issue with the transcoding - this is all mysterious to me so far.

Here is the profile . . .

<?xml version="1.0" encoding="utf-8"?>

  
  
  
    
    
      
      <ModelName regex=".*XBR-[4-9][0-9]X850B.*"
    
  
  
    Plex Media Server
    0.9.7.28
    http://www.plexapp.com/
    Plex, Inc.
    http://www.plexapp.com/
    Plex Media Server
    
    10
  
  
    
  
  
    
      
    
    
    
  
  
    
    
    
    
    
    
    
    
    
    
    
    
    
    
  
  
    
      
        
        
      
    
  
  
    
      
        
        
      
    
  
  
    
    
      
        
        
      
    
    
      
        
      
    
    
    
    
    
    
    
    
    
  

I have stored this in /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Profiles (which I did have to create) on my Ubuntu 12.014 LTS system.  I've obtained DLNA Test Ceritificat by searching at http://www.dlna.org/consumerhome/look-for-dlna/product-search.  To cut to the chase, that document is http://certification.dlna.org/certs/REG15684487.pdf.  And I have the specs for the TV from https://docs.sony.com/release/specs/XBR55X850B_mksp.pdf.

But to me, at present, it's like trying to drink from a firehose. . .  there is just too much information and (for me) too little understanding of how it fits together.

So I have come here to plea for help.  I would appreciate any pointers, and I will be happy to post bits of logs/configurations if given some idea of what to provide.  I have attached the complete Plex DLNA Server.log (16.7 KB)  and Plex Media Server.log (298 KB)

Thanks,

Dennis

I have tried to create a Sony XBR X850B profile, using a Sony 2013 profile as a starting point.  I'll say up front that's probably not such a great idea, but being unfamiliar with how all the parts of a profile interact, I hoped to get usable results.  What I got, was a mix.  Now my list of movies has the images intact, which is much appreciated!  But when I select any movie, i get video and sound, but the two aren't even within minutes of where they should be - and both make great leaps through the movie.

In general, the generic profile works with this lovely TV, but there are several formats that won't play (notably mkv) and they don't get transcoded (or not properly).  Instead, I get "Content not supported" displayed on the otherwise-blank screen.  And things like subtitles don't work, etc. etc.  (I've had a hard time finding other posts by people who have tried this sort of thing.)

I'm not sure where to look into what might be the issue with the transcoding - this is all mysterious to me so far.

Here is the profile . . .

snipped

I have stored this in /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Profiles (which I did have to create) on my Ubuntu 12.014 LTS system.  I've obtained DLNA Test Ceritificat by searching at http://www.dlna.org/consumerhome/look-for-dlna/product-search.  To cut to the chase, that document is http://certification.dlna.org/certs/REG15684487.pdf.  And I have the specs for the TV from https://docs.sony.com/release/specs/XBR55X850B_mksp.pdf.

But to me, at present, it's like trying to drink from a firehose. . .  there is just too much information and (for me) too little understanding of how it fits together.

So I have come here to plea for help.  I would appreciate any pointers, and I will be happy to post bits of logs/configurations if given some idea of what to provide.  I have attached the complete attachicon.gifPlex DLNA Server.log  and attachicon.gifPlex Media Server.log

Thanks,

Dennis

For audio sync you try adding the audiosync setting to your transcode targets by replacing:


     

with:

     
     

There are four options:

0 - No special syncing

1 - Sync on Start

2 - Sync on Resume

3 - Both

It sounds like you could just use a value of 1, but I am not aware of any issue that 3 would cause a problem over 1.

Wonderful!  Thanks so much for the tip!

I think I have the Bravia XBR-55X850B working to my satisfaction now (except that the next challenge is to play my eclectic music collection randomly).  It was solved with the AudioSyncFlags line, as you suggested.

I apologize that I had a few typos in my prior post; obviously that was not the file I had working.  For any who need it... here is my working profile.  After I've used it for a couple of weeks without problems (assuming ;) ) I'll post it to the appropriate board section.

Really appreciate the quick response!

So, it is a mix of great and mediocre now.  Many of the files I have now play with original resolution, no transcoding.  But it seems that anytime transcoding takes place, it's mapped to AVC, 300X240.  When I take my custom Profile out of the way so that generic is used, and play the same file, it is MP4 720X576.  Any idea what might cause that to happen?  Profile is as attached in prior post.

So, it is a mix of great and mediocre now.  Many of the files I have now play with original resolution, no transcoding.  But it seems that anytime transcoding takes place, it's mapped to AVC, 300X240.  When I take my custom Profile out of the way so that generic is used, and play the same file, it is MP4 720X576.  Any idea what might cause that to happen?  Profile is as attached in prior post.

Previously some Sony users had reported having problems with mpegts/h264 streams showing poor quality.  The solution for some was to switch the transcode targets to (I modified your transcode target so you can try pasting it in if you want):


     

Unfortunately, the only DLNA device I use is the PS3 but I haven't noticed any quality loss with its transcode targets set to mpegts/h264/mp3

Once again, thanks for the reply.  I copied the code above, and pasted it into my Profile, so that it read...


  
  
    
      
    
    
    
  
  

Then I restarted the plexmediaserver service.

Unfortunately, it would then show "No files available" (or similar wording) for each of my movie file sections, including Movies, Music Videos, and Home Movies.  I restored to prior values, and it worked (such as it is) again.

Regards,
Dennis

Once again, thanks for the reply.  I copied the code above, and pasted it into my Profile, so that it read...

  
  
    
      
    
    
    
  
  

Then I restarted the plexmediaserver service.

Unfortunately, it would then show "No files available" (or similar wording) for each of my movie file sections, including Movies, Music Videos, and Home Movies.  I restored to prior values, and it worked (such as it is) again.

Regards,
Dennis

Sorry, that was my fault I didn't check the directplay section where asf isn't listed as supporting those codecs.  And I honestly don't know if the audioCodec's would support surround sound. Looking at the Xbox 360 profile it should, but I don't know how the quality would be for that  (Or how/if it would work here)

That would end up looking like this:


     

Or you could try to AVI:


     

Sorry about the trial and error, but without having the TV myself I can only throw out some samples that might work for you.

There is no need for apologies!  I appreciate you working in the blind to help me out! Thanks so much for your help - you nailed it!  I used the asf container.  Everything that plays, plays with good resolution.

However, external subtitles do not work, and I am unable to play files that I've converted to MKV from DVD using MakeMKV 1.8.13.  The XML for one file is attached.  In short, it has an MKV container, with video codec mpeg2video and audio codec ac3.  I got the message "Video file cannot be played."  I noticed that there was no listing for mpeg2video in the MKV container for my Profile, so I added it:

    

Result was that when I played the file, I got a black screen and the TV seemed to lock up.  Only recourse was to unplug the power.

As for the subtitles, Plex does not seem interested in "burning them in," and the TV Subtitle button results in "Subtitles not available," even though they are.  I tried MKV with subs in the container, and plain external .SRT filles.

At the risk of wearing out my welcome, do you have other suggestions?

Also, in the spirit of this "Writing profiles for DLNA Devices" thread. . . where might I go to learn how to reconcile the codec terms used in the manual with the terms used by Plex?  What I mean is, few of the codec names referenced in the manual are the same as the names used in the Profile XML.  How do I learn how to reconcile that?  And what might be wrong with the subtitles?

However, external subtitles do not work, and I am unable to play files that I've converted to MKV from DVD using MakeMKV 1.8.13.  

What type of external subtitles are they?

https://support.plex.tv/hc/en-us/articles/200471133-Adding-Local-Subtitles-to-Your-Media  

If they are SRT's you need to make sure that they are named exactly like your movie file with the addition of a language code:

Frozen (2013).mkv

Frozen (2013).en.srt

After that you have to select the subtitle from the web manager to 'enable' it for use.  You can additionally set a default srt language from the server settings, but it will only work if you have the language codes enabled.

There is no need for apologies!  I appreciate you working in the blind to help me out! Thanks so much for your help - you nailed it!  I used the asf container.  Everything that plays, plays with good resolution.

In short, it has an MKV container, with video codec mpeg2video and audio codec ac3.  I got the message "Video file cannot be played."  I noticed that there was no listing for mpeg2video in the MKV container for my Profile, so I added it:

    

Result was that when I played the file, I got a black screen and the TV seemed to lock up.  Only recourse was to unplug the power.

This is normally a result of the file format not being compatible with your TV.  Now, normally if that is the case you should get the video file cannot be played message. Since you didn't get that message I would guess that your TV does support the formats, but there is a particular extra part it doesn't like.  Looking at the XML though I am unable to see anything that sticks out.

As for the subtitles, Plex does not seem interested in "burning them in," and the TV Subtitle button results in "Subtitles not available," even though they are.  I tried MKV with subs in the container, and plain external .SRT filles.

The subtitle button on the remote will only work if the file is directly played and the subtitles are external.  Hopefully, the other tips might help with how it burns the subtitles into the stream for you.

Also, in the spirit of this "Writing profiles for DLNA Devices" thread. . . where might I go to learn how to reconcile the codec terms used in the manual with the terms used by Plex?  What I mean is, few of the codec names referenced in the manual are the same as the names used in the Profile XML.  How do I learn how to reconcile that?  And what might be wrong with the subtitles?

In the first post there are a few codecs listed that are commonly seen.  There is no other full list.  Normally if you have a codec that you're not sure of, you can add the file to a library and view the XML like you posted and it will have exactly what plex is seeing the codec name as.  For the most part they follow common names, the only one that typically throws people off is DCA for DTS.

Thanks for your reply, and I apologize for taking so long to get back to you.

What type of external subtitles are they?

https://support.plex.tv/hc/en-us/articles/200471133-Adding-Local-Subtitles-to-Your-Media

If they are SRT's you need to make sure that they are named exactly like your movie file with the addition of a language code:

Frozen (2013).mkv

Frozen (2013).en.srt

After that you have to select the subtitle from the web manager to 'enable' it for use.  You can additionally set a default srt language from the server settings, but it will only work if you have the language codes enabled.

This is normally a result of the file format not being compatible with your TV.  Now, normally if that is the case you should get the video file cannot be played message. Since you didn't get that message I would guess that your TV does support the formats, but there is a particular extra part it doesn't like.  Looking at the XML though I am unable to see anything that sticks out.

The subtitle button on the remote will only work if the file is directly played and the subtitles are external.  Hopefully, the other tips might help with how it burns the subtitles into the stream for you.

They are mostly SRT, but as I (meant to?) say, there are some embedded into .MKV.  Where they are .SRT, they are the exact same as the movie, a la:

Nothing But the Truth (2008)/:
total 1824112
-rw-rwxrwx 1 dennis dennis 678764 Feb 8 2010 fanart-2.png
-rw-rwxrwx 1 dennis dennis 721593 Feb 8 2010 fanart.png
-rw-rwxrwx 1 dennis dennis 136272 Feb 7 2010 Nothing but the Truth (2008).ENG.srt
-rw-rwxrwx 1 dennis dennis 1866339938 Feb 8 2010 Nothing but the Truth (2008).mkv

PoTC:
total 5114952
-r–r–r-- 1 dennis dennis 97980 Oct 23 2011 Pirates of the Carribbean On Stranger Tides (2011).ENG.srt
-rw-rwxrwx 1 dennis dennis 689791840 Oct 22 2011 Pirates of the Carribbean On Stranger Tides (2011).m4v

Real Steel (2011)/:
total 5719428
-rwxrwxrwx 1 dennis dennis 115197 Jan 4 2012 Real Steel (2011).ENG.srt
-rwxrwxrwx 1 dennis dennis 5856569821 Jan 4 2012 Real Steel (2011).mkv

Sleepless in Seattle (1993)/:
total 960292
-rw-rwxrwx 1 dennis dennis 115559 Oct 5 2006 Sleepless in Seattle (1993).ENG.srt
-rw-rw-r-- 1 dennis dennis 983214783 Jan 23 2011 Sleepless in Seattle (1993).m4v

(I did try .eng instead of .ENG - with a full force refresh. . . but still no joy.)

I guess what I cannot wrap my head around, is why this would come into the picture:  "This is normally a result of the file format not being compatible with your TV.  Now, normally if that is the case you should get the video file cannot be played message."

What would I be missing that is preventing PLEX from transcoding the file to a format that *IS* compatible?  I'm not certain that I see any transcoding at all.... but I am certain I should not run into issues of no-playable-content-shown in the directories, et cetera... and all the other issues that come from files not being compatible.  Isn't that, in the end, the primary goal of these Profiles?  So what trigger am I missing?

What would I be missing that is preventing PLEX from transcoding the file to a format that *IS* compatible?  I'm not certain that I see any transcoding at all.... but I am certain I should not run into issues of no-playable-content-shown in the directories, et cetera... and all the other issues that come from files not being compatible.  Isn't that, in the end, the primary goal of these Profiles?  So what trigger am I missing?

Sorry about the delay, I thought I submitted a reply to this, but must have closed off the window instead.

The profile's goal is definitely to transcode non-playable content to a playable format. What could cause that could be a number of things.  On my LG it happened to be AC3 audio in a MP4 container (That was what I narrowed it down to, after that I remuxed to MKV and had no problem, could have been something else but I never checked)

On my PS3 I've had problems with videos with a bitDepth of 10 (Mostly Anime's are encoded like this), I also saw extra stuttering with Anamorphic and high refFrames.  Unfortunately, it could be almost anything.  Since the profile is for a newer Sony product, you could try looking at the other Bravia profiles/PS3 profile to try and see if there are any other "UpperBound","NotMatch", or "Match" sections in there as those will be what controls the limitations.  The reason why always just transcoding doesn't fix it right away is that when transcoding Plex will try and keep the stream as close to the original as possible unless you tell it what the limitations are.

Hi,

I am unable to find what to write in the profile, in order to make a (youtube) stream header to contain "transferMode.dlna.org: Streaming;" and not Interactive.

I found out, that I probably need this, since I had a default profile for the device, there was Streaming and video played on the tv, but when I wasnted to personnalise it more, there suddenly was Interactive, and the video file format was not supported. So what do I do, to have the Streaming there?

Thanks

Hi,

is there a way to suppress Content-Length header for music that is transcoded? I tried EstimateContentLength setting but it doesn't seem to be valid for MusicProfile element in TranscodeTargets.

Thanks,

Erik

I have tried to write my own profile for my Smart TV.

Device Spy info:

http://81.166.3.217/download/device_spy.jpg

XML file here:

http://81.166.3.217/download/TV-120.xml

DLNA log file:

http://81.166.3.217/download/Plex%20DLNA%20Server.log

Any suggestions on why this profile is not working?

Any suggestions on why this profile is not working?

According to your DLNA log your profile isn't being read at all, are you sure you have it in the correct directory?

If it is being read near the top after 'Reading system DLNA client profiles' you should see a line similar to:

Dec 16, 2014 14:20:54:174 [9380] DEBUG - Reading user client profile LG Blu-Ray LHB336

According to your DLNA log your profile isn't being read at all, are you sure you have it in the correct directory?

The XML file is in C:\Program Files (x86)\Plex\Plex Media Server\Resources\Profiles

Isn't this correct?

The XML file is in C:\Program Files (x86)\Plex\Plex Media Server\Resources\Profiles

Isn't this correct?

No that is only for Plex System profiles.

On windows user profiles go here:

%localappdata%\Plex Media Server\Profiles

also known as:

C:\Users\\AppData\Local\Plex Media Server\Profiles

You will need to create the profiles directory as if you haven't put any profiles there before the directory does not exist.  So goto %localappdata%\Plex Media Server\ create a profiles directory and place it there.

No that is only for Plex System profiles.

On windows user profiles go here:

%localappdata%\Plex Media Server\Profiles

also known as:

C:\Users\\AppData\Local\Plex Media Server\Profiles

You will need to create the profiles directory as if you haven't put any profiles there before the directory does not exist.  So goto %localappdata%\Plex Media Server\ create a profiles directory and place it there.

Now I have done that, but still the profile isn't read...  :(

EDIT: It is being read after all.  :) ,

However, the content is not read. What I want is to have the server transcode the content my TV is unable to read. This is MP4 and TTS files.

Now I have done that, but still the profile isn't read...  :(

EDIT: It is being read after all.  :) ,

However, the content is not read. What I want is to have the server transcode the content my TV is unable to read. This is MP4 and TTS files.

MP4's are listed in your directplay section so they should be directplaying unless they hit one of your limitations in the codec profiles section.  For TTS are you referring to mpegts?  

Without checking a new DLNA log, can't say for sure what is happening.  But on all your old log all of your files appeared to be "mpegts/h264/aac/" which is also listed in your directplay section which means the server won't be trying to transcode them as the profile says your TV can you play them.