UniversalMediaServer / UniversalMediaServer

A DLNA, UPnP and HTTP(S) Media Server.
https://www.universalmediaserver.com
GNU General Public License v2.0
2.34k stars 456 forks source link

Buggy MediaInfo #432

Closed ExSport closed 8 years ago

ExSport commented 9 years ago

Using latest code of v5 ( https://github.com/UniversalMediaServer/UniversalMediaServer/commit/3a4c9a73b0b12f4e943eb43b9b1c11292bf7d07e ) and found problems. One of them is about MediaInfo. https://copy.com/RCmRfMtaSGlQnFz9 MediaInfo with this file detects incorrect bitrate as 15GBits or similar wrong values. Last working one is MediaInfo v0.7.68. Duplicate this file 400x to one folder to see the same behavior. Another problem is that parsing similar files (from my Panasonic camcorder) took 2secs for one file. Imagine folder with 700 files ==> server disconnects. In this case ffmpeg was much faster. Is it possible to speed it up somehow so renderer will not disconnect? Thx

valib commented 9 years ago

@SubJunk I cannot confirm that the version 0.7.69 is making that problem but the latest version 0.7.71 works well so we can go to that version.

ExSport commented 9 years ago

@valib Did you tested attached file? It makes exception because the bitrate can't be parsed, the value is too big. I retested also all older GUI versions with same problem. In my case, on Windows it is buggy also in latest version and first working older one was v0.7.68. Same wrong value detects newer MPC-HC Player which includes Mediainfo library. I can't imagine the case it worked for you. Maybe you talked about your files only and didn't tested linked one? Don't have logs right now...

ExSport commented 9 years ago

Mentioning duplicating file 400x was to see the slow progress of file detection, many exceptions with wrong bitrate and due to slow detection that my PanTV disconnected from server because UMS parsed 50th file from 400 but renderer already disconnected much sooner :-(

valib commented 9 years ago

I tested it with the latest UMS 5.0.0 version and the bitrate is 10919347 so the Mediainfo version v0.7.69 for me works correctly.

ExSport commented 9 years ago

32bit or 64bit? Don't expect difference but who knows. I got much higher number, about 15Gbit if I remember right and also same wrong value I got from MediaInfo GUI itself. Tested 64bit version only. Tomorrow will test 32bit MediaInfo. Thanks @valib for your testing and report that it works for you.

valib commented 9 years ago

I have 32bit WIN 7.

ExSport commented 9 years ago
TRACE 00:55:20.038 [New I/O worker #4] Matched format MPG to "K:\_Bitcasa\2012\AVCHD\BDMV\STREAM\00349.MTS"
TRACE 00:55:20.171 [New I/O worker #4] Could not parse bitrate from: 14523089254
TRACE 00:55:20.171 [New I/O worker #4] The full error was: java.lang.NumberFormatException: For input string: "14523089254"
TRACE 00:55:20.173 [New I/O worker #4] Parsing results for file "00349.MTS": container: mpegts, bitrate: 0, size: 1892352, video codec: und, duration: 00:00:26.00, width: 1920, height: 1080, frame rate: 25.000, muxing mode: , mime type: video/mpeg
    Audio track id: 4352, lang: und, flavor: , audio codec: AC3, sample frequency:48000, number of channels: 6, bits per sample: 16, artist: , album: , song name: , year: 0, track: 0
TRACE 00:55:20.173 [New I/O worker #4] Adding new child "00349.MTS" with class "net.pms.dlna.RealFile"
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:avi|divx        v:divx|mjpeg|mp4         a:ac3|lpcm|mp3|mpa   m:video/divx       qpel:yes|no   gmc:0
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:mpegps          v:h264|mp4|mpeg1|mpeg2   a:aac|ac3|lpcm       m:video/mpeg
TRACE 00:55:20.173 [New I/O worker #4] Video codec "und" failed to match support line f:mpegts          v:h264|mp4|mpeg1|mpeg2   a:aac|ac3|lpcm|mpa   m:video/mpeg
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wmv             v:vc1|wmv                a:wma                m:video/x-ms-wmv                         n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:aac     m:audio/x-m4a      n:2   a:(?!alac).+
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:atrac   m:audio/x-oma      n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:mp3     m:audio/mpeg       n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wav     m:audio/wav        n:2                s:48000
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wav     m:audio/wav        n:6   a:dts|lpcm   s:48000
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wma     m:audio/x-ms-wma   n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:jpg    m:image/jpeg
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:png    m:image/png
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:gif    m:image/gif
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:tiff   m:image/tiff
TRACE 00:55:20.173 [New I/O worker #4] File "00349.MTS" can be transcoded
TRACE 00:55:20.173 [New I/O worker #4] Getting player for resource "00349.MTS"
TRACE 00:55:20.173 [New I/O worker #4] Returning compatible player "FFmpeg"
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:avi|divx        v:divx|mjpeg|mp4         a:ac3|lpcm|mp3|mpa   m:video/divx       qpel:yes|no   gmc:0
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:mpegps          v:h264|mp4|mpeg1|mpeg2   a:aac|ac3|lpcm       m:video/mpeg
TRACE 00:55:20.173 [New I/O worker #4] Video codec "und" failed to match support line f:mpegts          v:h264|mp4|mpeg1|mpeg2   a:aac|ac3|lpcm|mpa   m:video/mpeg
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wmv             v:vc1|wmv                a:wma                m:video/x-ms-wmv                         n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:aac     m:audio/x-m4a      n:2   a:(?!alac).+
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:atrac   m:audio/x-oma      n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:mp3     m:audio/mpeg       n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wav     m:audio/wav        n:2                s:48000
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wav     m:audio/wav        n:6   a:dts|lpcm   s:48000
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wma     m:audio/x-ms-wma   n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:jpg    m:image/jpeg
TRACE 00:55:20.174 [New I/O worker #4] Format "mpegts" failed to match supported line f:png    m:image/png
TRACE 00:55:20.174 [New I/O worker #4] Format "mpegts" failed to match supported line f:gif    m:image/gif
TRACE 00:55:20.174 [New I/O worker #4] Format "mpegts" failed to match supported line f:tiff   m:image/tiff
TRACE 00:55:20.174 [New I/O worker #4] File "00349.MTS" will not be streamed because it is not supported by the renderer
TRACE 00:55:20.174 [New I/O worker #4] Final verdict: "00349.MTS" will be transcoded with player "FFmpeg" with mime type "video/mpeg"
TRACE 00:55:20.174 [New I/O worker #4] Adding "00349.MTS" to transcode folder for player: "FFmpeg"
TRACE 00:55:20.174 [New I/O worker #4] Adding new child "00349" with class "net.pms.dlna.FileTranscodeVirtualFolder"```TRACE 00:55:20.038 [New I/O worker #4] Matched format MPG to "K:\_Bitcasa\2012-Barcelona-Recko-Porsche-Narozky-Vyroci Slusovic\AVCHD\BDMV\STREAM\00349.MTS"
TRACE 00:55:20.171 [New I/O worker #4] Could not parse bitrate from: 14523089254
TRACE 00:55:20.171 [New I/O worker #4] The full error was: java.lang.NumberFormatException: For input string: "14523089254"
TRACE 00:55:20.173 [New I/O worker #4] Parsing results for file "00349.MTS": container: mpegts, bitrate: 0, size: 1892352, video codec: und, duration: 00:00:26.00, width: 1920, height: 1080, frame rate: 25.000, muxing mode: , mime type: video/mpeg
    Audio track id: 4352, lang: und, flavor: , audio codec: AC3, sample frequency:48000, number of channels: 6, bits per sample: 16, artist: , album: , song name: , year: 0, track: 0
TRACE 00:55:20.173 [New I/O worker #4] Adding new child "00349.MTS" with class "net.pms.dlna.RealFile"
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:avi|divx        v:divx|mjpeg|mp4         a:ac3|lpcm|mp3|mpa   m:video/divx       qpel:yes|no   gmc:0
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:mpegps          v:h264|mp4|mpeg1|mpeg2   a:aac|ac3|lpcm       m:video/mpeg
TRACE 00:55:20.173 [New I/O worker #4] Video codec "und" failed to match support line f:mpegts          v:h264|mp4|mpeg1|mpeg2   a:aac|ac3|lpcm|mpa   m:video/mpeg
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wmv             v:vc1|wmv                a:wma                m:video/x-ms-wmv                         n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:aac     m:audio/x-m4a      n:2   a:(?!alac).+
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:atrac   m:audio/x-oma      n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:mp3     m:audio/mpeg       n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wav     m:audio/wav        n:2                s:48000
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wav     m:audio/wav        n:6   a:dts|lpcm   s:48000
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wma     m:audio/x-ms-wma   n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:jpg    m:image/jpeg
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:png    m:image/png
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:gif    m:image/gif
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:tiff   m:image/tiff
TRACE 00:55:20.173 [New I/O worker #4] File "00349.MTS" can be transcoded
TRACE 00:55:20.173 [New I/O worker #4] Getting player for resource "00349.MTS"
TRACE 00:55:20.173 [New I/O worker #4] Returning compatible player "FFmpeg"
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:avi|divx        v:divx|mjpeg|mp4         a:ac3|lpcm|mp3|mpa   m:video/divx       qpel:yes|no   gmc:0
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:mpegps          v:h264|mp4|mpeg1|mpeg2   a:aac|ac3|lpcm       m:video/mpeg
TRACE 00:55:20.173 [New I/O worker #4] Video codec "und" failed to match support line f:mpegts          v:h264|mp4|mpeg1|mpeg2   a:aac|ac3|lpcm|mpa   m:video/mpeg
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wmv             v:vc1|wmv                a:wma                m:video/x-ms-wmv                         n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:aac     m:audio/x-m4a      n:2   a:(?!alac).+
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:atrac   m:audio/x-oma      n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:mp3     m:audio/mpeg       n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wav     m:audio/wav        n:2                s:48000
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wav     m:audio/wav        n:6   a:dts|lpcm   s:48000
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:wma     m:audio/x-ms-wma   n:2
TRACE 00:55:20.173 [New I/O worker #4] Format "mpegts" failed to match supported line f:jpg    m:image/jpeg
TRACE 00:55:20.174 [New I/O worker #4] Format "mpegts" failed to match supported line f:png    m:image/png
TRACE 00:55:20.174 [New I/O worker #4] Format "mpegts" failed to match supported line f:gif    m:image/gif
TRACE 00:55:20.174 [New I/O worker #4] Format "mpegts" failed to match supported line f:tiff   m:image/tiff
TRACE 00:55:20.174 [New I/O worker #4] File "00349.MTS" will not be streamed because it is not supported by the renderer
TRACE 00:55:20.174 [New I/O worker #4] Final verdict: "00349.MTS" will be transcoded with player "FFmpeg" with mime type "video/mpeg"
TRACE 00:55:20.174 [New I/O worker #4] Adding "00349.MTS" to transcode folder for player: "FFmpeg"
TRACE 00:55:20.174 [New I/O worker #4] Adding new child "00349" with class "net.pms.dlna.FileTranscodeVirtualFolder"

Tested on Android with forced renderer as PanasonicTV (renderer must be MediaInfo enabled). Edit: it is 64bit log. 32bit log tomorrow...

SubJunk commented 9 years ago

@valib I've been testing MediaInfo versions as they're released and the newer ones are slower to process my folders with common files (MKV and MP4)

ExSport commented 9 years ago

@valib : I am almost sure you are not using full v5b1 package where also tools are updated. I tested 00349.mts file on different PC, outside UMS, in 32bit and got same buggy results. Installed 32bit MediaInfo v0.7.71 GUI on Windows 7 64bit. GUI shows bitrate 14.5 Gbps so it is impossible you get correct bitrate. It must be bug in MediaInfo itself because I reproduced it on two different computers, three different programs and same buggy behavior (MediaInfoGUI, UMS using latest dll and MediaPlayerClassic - HomeCinema with MediaInfo incorporated) @SubJunk : do you see same behavior as me? Wrong bitrate for provided file and very very slow parsing (1.5 - 2 sec for every file = benchmarked files similar to provided sample MTS file) I am almost sure you will reproduce also buggy bitrates. Thx

valib commented 9 years ago

@ExSport I use the latest Mediainfo version 0.7.71 and the result is: mediainfo Also here is the info from the UMS itself

12-14 13:12:16  UMS must be run as administrator in order to access the PID file
12-14 13:12:16  Starting Universal Media Server 5.0.0-b1
12-14 13:12:16  Based on PS3 Media Server by shagrath, copyright 2008-2014
12-14 13:12:16  http://www.universalmediaserver.com
12-14 13:12:16  
12-14 13:12:16  Build: 3a4c9a73b (2014-12-13)
12-14 13:12:16  Java: Java HotSpot(TM) Client VM 1.8.0_25 32-bit by Oracle Corporation
12-14 13:12:16  OS: Windows 7 32-bit 6.1
12-14 13:12:16  Encoding: UTF-8
12-14 13:12:16  Memory: 742 MB
12-14 13:12:16  Language: cz
12-14 13:12:16  
12-14 13:12:16  Working directory: C:\Program Files\Universal Media Server
12-14 13:12:16  Temp directory: E:\Temp\universalmediaserver
12-14 13:12:16  Logging config file: C:\Program Files\Universal Media Server\logback.xml
12-14 13:12:16  debug.log: C:\ProgramData\UMS\debug.log
12-14 13:12:16  
12-14 13:12:16  Profile directory: C:\ProgramData\UMS
12-14 13:12:16  Profile directory permissions: rw
12-14 13:12:16  Profile path: C:\ProgramData\UMS\UMS.conf
12-14 13:12:16  Profile permissions: rw
12-14 13:12:16  Profile name: VAIO
12-14 13:12:16  
12-14 13:12:16  Web conf path: C:\ProgramData\UMS\WEB.conf
12-14 13:12:16  Web conf permissions: rw
12-14 13:12:16  
12-14 13:12:16  Loading renderer names from C:\Program Files\Universal Media Server\renderers
12-14 13:12:16  Loading MediaInfo library
12-14 13:12:16  Loaded MediaInfoLib - v0.7.69

and here is the result

TRACE 13:23:01.421 [pool-4-thread-28] Matched format MPG to "E:\Filmy\00349.MTS"
TRACE 13:23:01.715 [pool-4-thread-28] Parsing results for file "00349.MTS": container: mpegts, bitrate: 10919347, size: 1892352, video codec: und, duration: 00:00:01.00, width: 1920, height: 1080, frame rate: 25.000, muxing mode: , mime type: video/mpeg
    Audio track id: 4352, lang: und, flavor: , audio codec: AC3, sample frequency:48000, number of channels: 6, bits per sample: 16, artist: , album: , song name: , year: 0, track: 0
TRACE 13:23:01.726 [pool-4-thread-28] Adding new child "00349.MTS" with class "net.pms.dlna.RealFile"
TRACE 13:23:01.726 [pool-4-thread-28] Format "mpegts" failed to match supported line f:flv v:h264|hls a:aac m:video/flash
TRACE 13:23:01.726 [pool-4-thread-28] Format "mpegts" failed to match supported line f:mp4 m:video/mp4
TRACE 13:23:01.726 [pool-4-thread-28] Format "mpegts" failed to match supported line f:mp3 n:2 m:audio/mpeg
TRACE 13:23:01.726 [pool-4-thread-28] File "00349.MTS" can be transcoded
ExSport commented 9 years ago

@valib Thanks for your test, helped :+1: Problem is more files in the same folder. MediaInfo starts at some point count overall bitrate not for pasred file only but for all in a folder. So 00323.MTS up to 00345.MTS is OK but if any other file is present in folder like 00346.MTS, MediaInfo will start return different bitrate for 00323.MTS (23 files in a row is ok but not 24th). More files I duplicated, more different bitrate you will get. You can test TEST_BUG.7Z archive (2MB) or TEST_BUG.ZIP (42MB if you don't have 7-ZIP). https://copy.com/RCmRfMtaSGlQnFz9 Instead of 10.9 Mbps for 00323.MTS you will get 263 Mbps. Add duplicated 00347.MTS, you will get 274 Mbps (263+11) and so on. Not sure if MediaInfo is used for parsing JPG but I spotted similar spamming to the log for pictures from digital camera with similar naming convention. Quite annoying bug :-1:

valib commented 9 years ago

@ExSport I tested it and must confirm that it is definitelly funny MediaInfo's bug

ExSport commented 9 years ago

Thanks for reproduction. Incident created: http://sourceforge.net/p/mediainfo/bugs/884/

ExSport commented 9 years ago

OK, seems it is not bug but new feature...from 0.7.69 log:

+ Sequences of files: optimization of the detection of sequences with 200k+ files
+ Sequences of files: File_IgnoreSequenceFilesCount option for speeding up the detection of sequences (con: no detection of the latest file in the sequence)
+ Sequences of files: File_IgnoreSequenceFileSize option for speeding up the detection of sequences (con: no detection of total size of the sequence)
+ Sequences of files: detection when there is additional characters after the numbers (e.g. "filename[000001].png")
+ MPEG-TS: detecting sequences of files
+ ADTS: detecting sequences of files
+ MediaInfoList: removing files detected as part of a sequence
ExSport commented 9 years ago

@SubJunk : Seems new versions are slower due to the detection of sequences. Didn't found the way how this behavior can be disabled so returned values are correct and with faster speeds.

valib commented 9 years ago

@ExSport I think that this is a bug because counting files or file size has nothing to do with the wrong bitrate. So this should be ticketed at the MediaInfo bugs as the Incorrect_result not as the Usability.

ExSport commented 9 years ago

@valib I ticked it as Incorrect_Result but it seems Jerome Martinez changed it. It seems this behavior is on the request of the sponsor so maybe including summing bitrate. Btw. I found out yesterday that this behavior was introduced from v0.7.69 release notes, after that I found your email about the same but I can't find this post anywhere on github. Seems you deleted it? :)

ExSport commented 9 years ago

@valib Found in the source code it can be disabled as Jerome also mentioned. It should speed up things and fix problem with removing in our case unneccessary sequence detection.

//***************************************************************************
// File test continuous file names
//***************************************************************************

//---------------------------------------------------------------------------
void MediaInfo_Config_MediaInfo::File_TestContinuousFileNames_Set (bool NewValue)
{
    CriticalSectionLocker CSL(CS);
    FileTestContinuousFileNames=NewValue;
}

bool MediaInfo_Config_MediaInfo::File_TestContinuousFileNames_Get ()
{
    CriticalSectionLocker CSL(CS);
    return FileTestContinuousFileNames;
}
valib commented 9 years ago

@ExSport I commited a fix https://github.com/UniversalMediaServer/UniversalMediaServer/commit/ea386cae11ec3d5ace96ab4528684195e0f80c51 can you test it if it works?

ExSport commented 9 years ago

@valib Still no time to test it but some tips from opened incident linked above about getting better parsing speeds.

MediaInfo::Option("ParseSpeed", "0"), maybe it fits your needs (some items like GOP size will be missing)

And as I already mentioned in your commit, it seems correct property is without "_":

MediaInfo::Option("FileTestContinuousFileNames", "0")

@SubJunk maybe it will fix your slower parsing speed with newer versions :-) EDIT: It seems default value in source code for ParseSpeed is 0.5 and some hints in history:

+ MPEG-TS: option (--ParseSpeed=0.8) for testing the stream until all advertised streams are detected
+ MPEG-TS: average, minimum, maximum PCR distance (hidden by default and you must parse the whole file with --ParseSpeed=1 option)

Should be tested if lower than 0.5 value returns all properties we need/use :-) EDIT2: From posts I found the value means percents so 0.5 means scanning 50% of file to determine all properties (VBR etc. can't be determined exactly without parsing whole file)

ExSport commented 9 years ago

@valib @SubJunk : Didn't tested if all required info is returned with value 0 but my short test returned same property values as for default 0.5 but with much faster speed :+1: More info posted here: https://github.com/UniversalMediaServer/UniversalMediaServer/commit/776d2d600c2856762c43d1c47d3ca1759aeb346c

Sami32 commented 8 years ago

@ExSport @SubJunk @valib Did the latest MediaInfo version solved this issue ? I don't have that free space on my little HDD to test it myself ;-)

SubJunk commented 8 years ago

Yeah we are passing a few parameters to it for this now