Thumbnails fail to generate (Samsung 2012 ES series solved)

For help and support with PS3 Media Server in general
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

Thumbnails fail to generate (Samsung 2012 ES series solved)

Postby dmitche3 » Thu Jan 24, 2013 3:29 pm

I'm receiving a message when trying to generate thumbnails that is:
Can't create thumbnail for E:\ISO\charmed\Charmed-(a Knight To Remember)-2005-01-03-0-1.mp4: No suitable ImageReader found for E:\ISO\charmed\Charmed-(a Knight To Remember)-2005-01-03-0-1.mp

I've put some debugging info in and the thumbnail is being generated but when the code hits the method "toFile() it is failing:

file: DLNAMediaInfo.java
In method: public void parse(InputFile inputFile, Format ext, int type, boolean thumbOnly) {
Line of code failing: thumbnail.toFile(thumbFilename);

I know that the thumbnails are being generated as I commented out their deletion. I know that the JPG files are being created as I removed the deletion of those files from the code. It appears that the "thumbnailator()" is failing to create the thumbnail. This is all new to me.
Can someone comment if this is a known issue? Perhaps I have beta code? POM.xml says that I'm using 0.4.2. I tried reverting to 0.4.1 but no difference.

Thanks.

Profile: Samsung AllShare on Windows 7
Last edited by dmitche3 on Mon Feb 18, 2013 8:17 pm, edited 2 times in total.
dmitche3
 
Posts: 30
Joined: Mon Jan 21, 2013 11:55 pm

Re: Thumbnails fail to generate:corrected

Postby dmitche3 » Thu Jan 24, 2013 4:46 pm

I'm wondering if this might be as I'm running Java 7. Looking over the Thumbnailator refers to Java 6. Perhaps there lays the problem? :(
dmitche3
 
Posts: 30
Joined: Mon Jan 21, 2013 11:55 pm

Re: Thumbnails fail to generate:corrected

Postby dmitche3 » Fri Feb 08, 2013 9:26 pm

After debugging through the code, cough cough... gasp. What a mess. lol i've been spending hours and hours refactoring and commenting as someone needs a proper class in programming. :) I wish that I was just kidding. :(

And doing a number of package captures it appears that the issue is one of two things as to why thumbnails are not working with 2012 Samsungs.

The TV is not requesting to fetch the images. That is a given. Why is the question. It is either,
1. Samsung didn't implement the feature in the current version of the software.
2. The programmers of PS3 put a nice bit of code to send back a 401 rather than to program the UPnP GetFeatureList function which the comment says that 2012 Samsung TVs use. Because of this is might be the cause.
3. I missed something analyzing the packets and there is something wrong.

How I tested this:
I noticed that if I connected the AllShare PC software to PMS that thumbnails worked. Therefore the code was working. Allshare PCSW is both a server and client. SO I captured packets from the AllShare PC software and compared them to what my Samsung EH TV was putting out. I didn't see anything of importance other than the code noted above being missing. :(
The code sending back a 401 error is below.

Now to find documentation (whitepapers) for UPnP GetFeatureList. Anyone know where I can get one for free?

Code: Select all
else if (soapaction != null && soapaction.indexOf("ContentDirectory:1#X_GetFeatureList") > -1) { // Added for Samsung 2012 TVs
            response.append(HTTPXMLHelper.XML_HEADER);
            response.append(CRLF);
            response.append(HTTPXMLHelper.SOAP_ENCODING_HEADER);
            response.append(CRLF);
            response.append(HTTPXMLHelper.UPNP_INVALID_ACTION);
            response.append(CRLF);
            response.append(HTTPXMLHelper.SOAP_ENCODING_FOOTER);
            response.append(CRLF);
Last edited by chocolateboy on Tue Jun 04, 2013 6:03 pm, edited 1 time in total.
Reason: reformatted
dmitche3
 
Posts: 30
Joined: Mon Jan 21, 2013 11:55 pm

Re: Thumbnails fail to generate:corrected

Postby dmitche3 » Sat Feb 09, 2013 7:14 pm

Well, after further thought I realized that the missing response posted before is nothing of real importance I have debugged and gotten thumbnails to work with my 2012 Samsung TV. The code isn't ready to be published but I'll post it in a more proper place when I have a more finalized version and I'll let someone else review it and merge it in. As this code isn't very good I'm not sure if I'll want to continue to contribute on a regular basis. Or perhaps I might volunteer to clean up, refactor, and advise on programming standards, as I'm a level 4 Lead Systems Analyst and I use to do this for a living before I retired. :)
dmitche3
 
Posts: 30
Joined: Mon Jan 21, 2013 11:55 pm

Re: Thumbnails fail to generate (Samsung 2012 ES series solv

Postby dmitche3 » Mon Feb 18, 2013 8:19 pm

Here are the changes that I made to the code to get thumbnails working. Sorry but the code that I have has been refactored so it will take someone to integrate. I'm experiencing health problems and I thought that I'd get this to some people sooner than latter.

Streaming from Windows 7 Ultimate, 8 GB memory,
Samsung 2012 ES6500 and EH5300 TVs.
Versions 1.72 and snapshot 1.80



Here is my problem and a solution to thumbnails not working on Samsung 2012 (ES &EH) models.

I noticed that the Samsung was not requesting the thumbnails. By running Samsung's AllShare software
which works as both a client and server I was able to determine the changes needed to get thumbnails
to work.

I'm posting my findings here to allow someone else to merge them into PMS because
1.) I'm new to the
opensource world and I don't know exactly how this process is to work. I.E. Code reviews? System and
unit test plan creation? Do they even exist?
2. I've refactored and cleaned up the original code too much to be able to implment it with the given
snapshot (1.80).


Finally, since I do not have my hands on DLNA standards I do not know if what I'm doing is proper. What
I mean is, even though what I've done is simple and works, there may be additional requirements that I
haven' implement. Specifically, for the <res> element, there may be a requirment to send the item's SIZE and
other attributes. My Samsung ignored them so I removed them as they were not necessary to get thumbnails to work.

The problem: Samsung doesn't recognize the <albumArt> element. It wants to see <res> for the video/music as
well as the thumbnail. Basically I added a switch to the Renderer.conf file. When selected the <res> element
would be used in the thumbnail rather than the <albumArt>. That a little bit else changed.

Changes:

SamsungAllShare.conf: added the following with the default as false so as not to change current user's functionality.

Code: Select all
#Created ThumbnailAsResource for Samsung 2012 TVs to render thumbnails using the <res>
#element versus <albumArt> used by other devices.
ThumbnailAsResource=false


PMS.conf: Define the variable thumbnail_as_resource.

Code: Select all
# --------------
# Samsung 2012+ TV require thumbnails to be sent as a resource
# Choose whether or not to send thumbnails as res or albumArt
# Default: false (for albumArt)
thumbnail_as_resource =


RendereConfiguration.java: 2 changes.

1. Added the following constant string

Code: Select all
private static final String THUMBNAIL_AS_RESOURCE = "ThumbnailAsResource";


2. Added getter

Code: Select all
  /*
 * getThumbNailAsResource()  Samsung 2012 require the thumbnail response to be sent as a <res> element
 * and not as <albumart>.
 */
   public boolean getThumbNailAsResource() {
      return getBoolean(THUMBNAIL_AS_RESOURCE, false);
   }


And finally, the following is my refactored method between the "====".
The original

=================================================

Code: Select all
   /**
    * appendThumbNail() Generate and append the response for the thumbnail
    * DM 2/9/13 refactored this code
    *
    * @param mediaRenderer
    * @param sb
    */
   private void appendThumbNail(RendererConfiguration mediaRenderer, StringBuilder sb) {
      String thumbURL = getThumbnailURL();
      boolean isThumbnail = (!isFolder() && (getFormat() == null || (getFormat() != null && thumbURL != null)));
//
      String elementToUse="upnp:albumArtURI";

      if (isThumbnail) {
         if (mediaRenderer.getThumbNailAsResource()) { // Generated thumbnail response as <albumArt> or <res>
            elementToUse="res";
            
            openTag(sb, elementToUse);
            addAttribute(sb, "resolution", getMedia().getResolution());
         } else {
            openTag(sb, elementToUse);
            addAttribute(sb, "xmlns:dlna", "urn:schemas-dlna-org:metadata-1-0/");
         }

         if (getThumbnailContentType().equals(PNG_TYPEMIME) && !mediaRenderer.isForceJPGThumbnails()) {
            addAttribute(sb, "protocolInfo", "http-get:*:image/png:DLNA.ORG_PN=PNG_TN");
         } else {
            addAttribute(sb, "protocolInfo", "http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN");
         }
         
         endTag(sb); 
         sb.append(thumbURL);
         closeTag(sb, elementToUse);
      }

      if ((isFolder() || mediaRenderer.isForceJPGThumbnails()) && thumbURL != null) {
         openTag(sb, "res");
         if (getThumbnailContentType().equals(PNG_TYPEMIME) && !mediaRenderer.isForceJPGThumbnails()) {
            addAttribute(sb, "protocolInfo", "http-get:*:image/png:DLNA.ORG_PN=PNG_TN");
         } else {
            addAttribute(sb, "protocolInfo", "http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN");
         }

         endTag(sb);
         sb.append(thumbURL);
         closeTag(sb, "res");
      }
   }
Last edited by chocolateboy on Tue Jun 04, 2013 6:01 pm, edited 2 times in total.
Reason: reformatted
dmitche3
 
Posts: 30
Joined: Mon Jan 21, 2013 11:55 pm

Re: Thumbnails fail to generate (Samsung 2012 ES series solv

Postby wensveen » Tue Jun 04, 2013 5:55 pm

Hi,
Thanks for posting all this. I hope someone will find the time to integrate your changes into the source tree.

I have the same problem (which is why I found this thread, of course). I too had decided not to touch the PMS code, but maybe I'll reconsider.

Cheers,
Matthijs

PS. Good luck with your health.
wensveen
 
Posts: 3
Joined: Mon May 09, 2011 11:34 pm

Re: Thumbnails fail to generate (Samsung 2012 ES series solv

Postby Raptor399 » Tue Jun 04, 2013 9:20 pm

dmitche3 wrote:I'm posting my findings here to allow someone else to merge them into PMS because
1.) I'm new to the
opensource world and I don't know exactly how this process is to work. I.E. Code reviews? System and
unit test plan creation? Do they even exist?
2. I've refactored and cleaned up the original code too much to be able to implment it with the given
snapshot (1.80).


Thanks for sharing your findings!

The best way to share code with the developers is to clone the repository on GitHub and create a pull request.

Once you made the pull request, developers will automatically be notified of it and they will review the request. Sometimes there will be little discussion, sometimes a lot. Sometimes things will be merged, sometimes not. It really differs per request.

The main thing is: don't be afraid to submit your code. Your ideas are very valuable. 8-)
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: Thumbnails fail to generate (Samsung 2012 ES series solv

Postby Raptor399 » Tue Jun 04, 2013 10:31 pm

In this case, I created a pull request for you. :mrgreen:
Again, thanks for the submission.
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: Thumbnails fail to generate (Samsung 2012 ES series solv

Postby happy.neko » Fri Jun 07, 2013 9:36 am

Please test if this issue is resolved in latest snapshot build
viewtopic.php?f=14&t=14753
happy.neko
Project Member
 
Posts: 478
Joined: Fri Sep 23, 2011 5:38 pm

Re: Thumbnails fail to generate (Samsung 2012 ES series solv

Postby gelo » Tue Jun 11, 2013 4:02 am

happy.neko wrote:Please test if this issue is resolved in latest snapshot build
viewtopic.php?f=14&t=14753


Hi, I tested using PMS 1.82 and a Samsung UN40ES6500G and nothing.
Then, I tried with 1.90 and nothing again. The debug is at http://pastebin.com/2Xiz6s1x
I'm waiting for a now release with this code integrated.

Thx guys
Image
Image
Image
gelo
 
Posts: 5
Joined: Thu Jul 29, 2010 12:36 am

Next

Return to General Help and Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 16 guests