Page 1 of 1

JPEG Transcoding errors

PostPosted: Sun Sep 02, 2012 5:40 pm
by veague
I've recently installed serviio 1.0.1 and am having problems transcoding large JPEG images with an LG-BD570.
The (attached) debug file shows the start of the transcoding process, but then receive "stream entity has length: -1" and then an I/O error when trying to deliver the file.
Files that don't require transcoding are sent natively and display correctly. I can't figure out how to tell if the transcoded file is bad, or what the underlying issue is.
The file being trancoded is a JPEG, 4320x2432, 180dpi. The host is 64bit Windows7 if that makes a difference.

Any suggestions / pointers on how to debug further are great appreciated!

Re: JPEG Transcoding errors

PostPosted: Thu Sep 06, 2012 11:43 am
by zip
Are you using the LG profile? The file is transcoded because it's bigger that 4096x4096 in at least one dimension, which DLNA restricts to. The device might support it though, you can disable the transcoding in profiles.xml by setting LimitImageResolution to false.

Re: JPEG Transcoding errors

PostPosted: Sat Sep 08, 2012 12:09 pm
by veague
Thanks for the reply.
I"ve found the LG BD-570 can display files up to 4MB (seemingly independent of resolution). I can turn off transcoding in the profile and files up to 4MB display correctly, files above 4MB do no (they are sent to the device and displayed as a "?"). So I need to have transcoding work.

Turning on transcoding results in a blank file (just a blank screen is displayed, no "?" indicating an unknown / unusable format). If you look at the DEBUG files (attached in original post), it indicates the resulting stream size after transcoding is "-1", which looks more like an error message returned from the transcoding process. Looking at the wikis, it would appear Directshow is used to do the transcoding? I can display the image on the server using media player (and any other image player) without problem.

I'm not sure if this is a bug in Serviio, or something not set up right on my server. EIther way, I can't figure out how to debug this process. Any pointers would be appreciated.

PS - I used the LG profile, but found the "viera2010" profile to work better; I was losing the audio on certain types of MOV files. I"ve made a new LG profile and will post it if I can get the image issue resolved.

Re: JPEG Transcoding errors

PostPosted: Sun Sep 09, 2012 9:57 pm
by zip
The -1 is correct. Java itself is used to resize the images. Not sure whether it's the player that doesn't like the file.

You could try to install Intel UPnP tools (see my signature), assign the LG profile to the IP of the PC running this sw, run AV Media controller, browse to the image and look at it's properties. There should be 1-3 resources, you can try them one by one - each has a URL, open that URL in a web browser and you shiuld see the (resized) image in different dimensions (small, medium, large)

Re: JPEG Transcoding errors

PostPosted: Thu Dec 20, 2012 6:43 pm
by Swehawk
Ok, since I have the same problem as Veague, I'll continue where he left ;)
I have a LG ST-600 Smart TV Enabler and confirm the +4MB limit using CIFS as well as dlna. Furthermore, the LG support confirmes that it's a known problem.
Thought that using dlna, transcoding could possibly solve the problem, but not so far...
I did the test that zip suggested, and it comes up with 4 resources:
#1: JPEG_LRG-0/ORIGINAL, 4000x3000, 7,3 MB
#2: COVER_IMAGE, 160x120
#3: JPEG_MED-0/MEDIUM, 1024x768
#4: JPEG_SM-0/LOW, 640x480
I can open each one in the browser and they all look ok.

Where do I go from now? Any more tests to do? Need sample image, logs or whatever?

Btw: the medium resource res. seems a bit outdated! Wouldn't 1920x1080 be more appropriate today!

Re: JPEG Transcoding errors

PostPosted: Thu Dec 20, 2012 9:37 pm
by zip
the 2 resources are there for the client to pick whatever it needs. It should know that if LARGE is not possible, get MEDIUM, etc. btw, all these types (lrg,med, sml) and their resolutions are a part of the DLNA spec.

I don't recall the spec to mention anything about a file size limitation, and it's hard to transcoode to a particular file size.

Re: JPEG Transcoding errors

PostPosted: Fri Dec 21, 2012 7:27 am
by Swehawk
Ok, so it's clearly a bad implementation by LG and unfortunenatly there is no chance of it getting fixed either since they stopped fw updates for this model now :(

Would there be any means to have Serviio resize the original image or to cheat the renderer to believe that the medium res is the original one?

Re: JPEG Transcoding errors

PostPosted: Sat Dec 29, 2012 12:47 pm
by Swehawk
Since the problem with LG devices (and possibly other brands too) not being able to show jpeg images > 4 MB due to bugs/incompliance with the dlna specs seems unsolvable, I had to come up with another solution to be able to show my photos on my LG TV. I just thought I should share this if anyone could make use of it.

The solution is basically about creating a mirrored image library where the images are resized to a height of 1080 pixels (to match the TVs resolution) and renamed to "<name>_s", and then adding the mirror library to Serviio. This enhances the loading speed when browsing images while not impairing quality noticabily. With jpg-quality = 95 I get filesizes 250-600 kB.

From the beginning I had to do this semi automatically using IrfanView, but during the holidays I spent some time figuring out a script that may be run from a remote client, that does all the work for me. So whenever I have added new images to the main library, I just run the script and the mirror is updated. IrfanView is required on the server, and to run the script remotly, psexec (google!) is required on the client. A limitation is that the you can't have more that two levels in the library's folder structure. I have:

<year 1>
----<folder 1>
----<folder n>

<year n>
----<folder 1>
etc.

No imagefiles allowed directly in the <year> folders, only in subfolders! The script runs for the current year only, and thus has to be updated for each new year.

This is the batchfile "resize.bat" placed in the "Bilder" folder on the server:
  Code:
chcp 1252

dir D:\Gemensamt\Bilder\Foto\2012 /A:-D-S-H /s /b | FIND /V "picasaoriginals" > D:\Gemensamt\Bilder\bilder.txt

"%ProgramFiles%\IrfanView\i_view32.exe" /filelist=D:\Gemensamt\Bilder\bilder.txt /advancedbatch /ini="D:\Gemensamt\Bilder" /jpgq=95 /convert=D:\Gemensamt\Foto\2012\$d\$N_s.jpg

chcp 850

rem pause


This is the target string in the shortcut on the client:
  Code:
C:\Windows\System32\cmd.exe /k psexec \\filur D:\Gemensamt\Bilder\resize.bat


and here's the i_view32.ini file I use:
  Code:
[Batch]
AdvCrop=0
AdvCropX=0
AdvCropY=0
AdvCropW=0
AdvCropH=0
AdvCropC=0
AdvResize=1
AdvResizeOpt=0
AdvResizeW=0.00
AdvResizeH=1080.00
AdvResizeL=0.00
AdvResizeS=0.00
AdvResample=1
AdvResizePerc=0
AdvResizePercW=0.00
AdvResizePercH=0.00
AdvDPI=0
AdvResizeUnit=0
AdvResizeRatio=1
AdvNoEnlarge=1
AdvResizeOnDpi=0
AdvCanvas=0
AdvAddText=0
AdvUseBPP=0
AdvBPP=0
AdvUseFSDither=1
AdvAutoRGB=0
AdvHFlip=0
AdvVFlip=0
AdvRLeft=0
AdvRRight=0
AdvGray=0
AdvInvert=0
AdvSharpen=0
AdvGamma=0
AdvContrast=0
AdvBrightness=0
AdvSaturation=0
AdvColR=0
AdvColG=0
AdvColB=0
AdvSharpenVal=1
AdvGammaVal=0.00
AdvContrastVal=0
AdvBrightnessVal=0
AdvSaturationVal=0
AdvColRVal=0
AdvColGVal=0
AdvColBVal=0
AdvDelOrg=0
AdvOverwrite=0
AdvSubdirs=1
AdvSaveOldDate=1
AdvAllPages=0
AdvFineR=0
AdvFineRVal=0.00
AdvBlur=0
AdvBlurVal=1
AdvMedian=0
AdvMedianVal=3
AdvRbg=0
AdvBgr=0
AdvBrg=0
AdvGrb=0
AdvGbr=0
AdvAutoCrop=0
[BatchText]
AddText=
TextCoord=0;0;100;100;
Corner=0
Orientation=0
TranspText=1
FontColor=65280
TxtBgkr=16777215
FontParam=-13|0|0|0|400|0|0|0|0|1|2|1|49|
Font=Courier
[Effects]
CanvL=10
CanvR=10
CanvT=10
CanvB=10
CanvInside=1
CanvColor=0
[Open]
OpenDir=B:\
[JPEG]
Save Quality=95



\\filur is the server with the main library "D:\Gemensamt\Bilder\Foto\", and the mirror library "D:\Gemensamt\Foto\".
If you don't use the same usn + pwd on both client and server, a username+password may be added like: "psexec -u <usn> -p <pwd>.
The script points at a folder where a saved IrfanView ini-file is (/ini="D:\Gem....).
The chcp entries are necessary since my foldernames contain "å,ä,ö".
Also note that any deletes or image edits in the main library after the script is run will not be reflected in the mirror library! You would have to delete the mirror files first to get a new copy!