Buggy thymbnail generation

Developers forum for Univeral Media Server-related development (only for programmers)
Post Reply
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Buggy thymbnail generation

Post by ExSport »

It seems thumbnail genereation code is total mess.
  • When you will enable "Image Thumbnails", UMS will allocate whole heap size and 100% CPU is used for javaw.exe process for quite long time.
  • When you will disable "Generate thumbnails", MPLAYER generation is still initiated including FFMPEG for parsing media info
For speeding things up, FFMPEG should be used only when MediaInfo will fail or when thumbnail is generated. What about to use MediaInfo all the time and not only when MediaInfo=true? FFMPEG is quite slow and obsolete for this purpose...
I tested it on Android and two folders with 200 .JPG and 200 .MTS files from video camera.
First problem I fixed by disabling it. CPU is idle and memory usage is not growing up.
The second one I temporarily tested/fixed with changing DLNAMediaInfo.java:
933: if (PMS.getConfiguration().isThumbnailGenerationEnabled() && PMS.getConfiguration().isUseMplayerForVideoThumbs() && type == Format.VIDEO && !dvrms) {
Still FFMPEG is used for file parsing when "thumbnail generation" is disabled. Can we replace slow FFMPEG with faster MediaInfo? Some cons, pros? 8-)
I spotted when UMS was generating thumbs and at the same time UMS tried to read info about video files, sometimes file was badly parsed so AVI was displayed with MPEG mime etc. Maybe it is due to overloaded UMS so sometimes some files were incorrectly parsed? I already spotted it sometimes in past that e.g. AVI was parsed as non-streamable [mime:MPEG] so MEncoder was used by default or file was totally unplayable. I had to delete CACHE and restart the UMS.
I think it will be great to check this code for any bugs present and to decide if we can replace ffmpeg parsing with MediaInfo and using FFMPEG as failback only 8-)
Post Reply