Kodi Community Forum
MediaInfo from XML - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+---- Forum: TinyMediaManager (https://forum.kodi.tv/forumdisplay.php?fid=204)
---- Thread: MediaInfo from XML (/showthread.php?tid=285402)

Pages: 1 2


MediaInfo from XML - hawikoeln - 2016-08-02

I do have 99% ISOs BD and DVD - even 3D BDs. I did issue the following command to all of them - after mounting them:

mediainfo D: -f --Output=XML

I do have that output on my servers side by side with the NFOs where I did patch the calculated duration etc for.

Would it be of any help to send you some of these NFOs with mediainfo output as collections? If yes, how?


RE: MediaInfo from XML - myron - 2016-08-03

Splittet this to its own thread, to better discuss...

Unfortunately, this is not so easy as it sounds...
MediaInfo uses internally other names than written to the XML.
(XML also has duplicate values - which is kinda suboptimal/invalid)

So we cannot use our already existing getMediaInfos() method.
We would need to traverse this XML tag by tag to the recognized format,
or implement an own parser for that XML (where we have to deal with duplicate values on our own)
[...]


RE: MediaInfo from XML - myron - 2016-08-16

Had some spare time to try this.
You may wanna try latest nightly with this.

For
<filename>.iso
name your XML file like:
<filename>-mediainfo.xml

Let me know, how it works Smile

PS:
The file itself is not supported (yet) by TMM.
So after using the renamer, you have to take care of correct naming again...


RE: MediaInfo from XML - hawikoeln - 2016-08-17

Yes! Did rename two of my mediainfo files. 1.) BD ISO series episode 2.) DVD iso video. Both worked perfect. For the first time durationsinseconds is correctly filled.

However, there's one small thing with DVD ISO:

The audio language of the DVD ISO is not filled. The audio language of the BD ISO is correct.

Here's part of that xml:

Code:
<track type="Audio">
<Count>272</Count>
<Count_of_stream_of_this_kind>1</Count_of_stream_of_this_kind>
<Kind_of_stream>Audio</Kind_of_stream>
<Kind_of_stream>Audio</Kind_of_stream>
<Stream_identifier>0</Stream_identifier>
<ID>129 (0x81)</ID>
<ID>129 (0x81)</ID>
<Format>AC-3</Format>
<Format_Info>Audio Coding 3</Format_Info>
<Commercial_name>AC-3</Commercial_name>
<Codec>AC3</Codec>
<Codec>AC3</Codec>
<Duration>5612040</Duration>
<Duration>1h 33mn</Duration>
<Duration>1h 33mn 32s 40ms</Duration>
<Duration>1h 33mn</Duration>
<Duration>01:33:32.040</Duration>
<Duration>01:33:32.040</Duration>
<Channel_s_>6</Channel_s_>
<Channel_s_>6 channels</Channel_s_>
<Sampling_rate>48000</Sampling_rate>
<Sampling_rate>48.0 KHz</Sampling_rate>
<Samples_count>269377920</Samples_count>
<Compression_mode>Lossy</Compression_mode>
<Compression_mode>Lossy</Compression_mode>
<Language>de</Language>
<Language>German</Language>
<Language>German</Language>
<Language>de</Language>
<Language>deu</Language>
<Language>de</Language>
</track>



RE: MediaInfo from XML - hawikoeln - 2016-08-18

I highly appreciate your work. I didn't expect that you will Code something like this because I doubt that there are many Users doing that (create mediainfo in seperate XML files). If it fits into your view of your application everythings fine. Else I can live with my own Workaround (patch mediainfo into NFOs with my own Perl script).

However, Thanks for your good work. With your help my HTPC with Kodi shines ..


RE: MediaInfo from XML - myron - 2016-08-18

Hmm.. works for me.
Can you send me the complete xml?


RE: MediaInfo from XML - hawikoeln - 2016-08-18

Sure:

BD ISO mediainfo with missing durationinseconds within streamdetails/video: https://ufile.io/6cef7
DVD ISO mediainfo with missing language within streamdetails/audio: https://ufile.io/ccf84

Thanks for looking into it.


RE: MediaInfo from XML - myron - 2016-08-18

Both uploads are the same Wink

The DVD has multiple files inside, and so in XML.
So we take the biggest file (which is hopefully the main video file), and parse all the information
(only duration is accumulated for all files)
In this case, the audiotrack starting at line 476 has no language set, thus we cannot parse it.
For DVDs you could try to remove the XML, so we parse that with our internally mediainfo - maybe this makes a difference?

If the bluray has no duration set, it might be the case af a kinda copy protected iso.
You could check that easily extracting it.
Eg when ISO size ~8gig, and the (possibly) extracted files have ~40 gig,
then the directory layout is garbled on purpose, and we skip in such cases the duration
(only take the scraped one - streamdetails should be ok after scraping?)
If the sizes pretty match (+/- 1 gig) then we count that as ok, what mediainfo reported....


PS: according to XML, your mediainfo is version 0.1.0?
Are sure you have the latest installed?


RE: MediaInfo from XML - hawikoeln - 2016-08-18

Don't know why this version number is part of the output:

31.05.2016 14:07 5.497.704 MediaInfo.exe

mediainfo.exe --Version
MediaInfo Command line,
MediaInfoLib - v0.7.86


I can send you tons of mediainfo output. Just tell me where you need it ;-)


RE: MediaInfo from XML - myron - 2016-08-30

Made an ugly hack, to set the accumulated language, if none has been found on video file.
I'm able to only to set the FIRST found language; so it doesn't work when having multiple audio streams in different languages....
But you might want to try Smile


RE: MediaInfo from XML - hawikoeln - 2016-08-30

Thanks, will do.


RE: MediaInfo from XML - ClueLessNoob - 2016-12-10

Hi,

Thanks first of all for TMM, really a great tool.

Am running TinyMediaManager V 2.9, build 2016-10-27 18:39 and mediainfo v0.7.91 in Linux.

Seems I have two questions:

1) How would the above work when you have a movie that is split onto two discs, e.g. LOTR.disc1.iso and LOTR.disc2.iso. I guess we load only disc1s xml?

2) I am trying to get TMM to load this xml (http://pastebin.com/dy18VgDv) which is in the same folder then the movie file and has the exact same filename to the moviefile plus the -mediainfo.xml ending (you suggested <filename>-mediainfo.xml). Unfortunately the file is not loaded. Do you happen to know why?

Maybe I should add that the xml was created via the suggested method but I pointed mediainfo to the appropriate mpls file to ensure it picks the right info.

Here the logfile info:

Code:
2016-12-10 17:46:33,820 INFO  [tmmpool-main-task-thread-4] o.t.c.m.tasks.MovieUpdateDatasourceTask2:969 - getting Mediainfo...
2016-12-10 17:46:33,821 DEBUG [tmmpool-mediainfo-thread-1] o.t.core.entities.MediaFile:1429 - start MediaInfo for /media/XX.2012.3D/XX.2012.3D.BluRay.1080p.AVC.DTS-HD.MA.7.1.disc1.iso
2016-12-10 17:46:33,821 INFO  [tmmpool-mediainfo-thread-1] o.t.core.entities.MediaFile:1221 - ISO: try to parse /media/XX.2012.3D/XX.2012.3D.BluRay.1080p.AVC.DTS-HD.MA.7.1.disc1-mediainfo.xml
2016-12-10 17:46:33,980 ERROR [tmmpool-mediainfo-thread-1] o.t.core.entities.MediaFile:1737 - ISO file seems to have an invalid structure - ignore duration
2016-12-10 17:46:33,980 DEBUG [tmmpool-mediainfo-thread-1] o.t.core.entities.MediaFile:1429 - start MediaInfo for /media/XX.2012.3D/XX.2012.3D.BluRay.1080p.AVC.DTS-HD.MA.7.1.disc2.iso
2016-12-10 17:46:33,981 ERROR [tmmpool-mediainfo-thread-1] o.t.core.entities.MediaFile:1330 - Mediainfo could not open STREAM - trying fallback
java.lang.RuntimeException: com.github.stephenc.javaisotools.loopfs.api.LoopFileSystemException: Invalid block size: 0
    at com.github.stephenc.javaisotools.loopfs.spi.AbstractBlockFileSystem.iterator(AbstractBlockFileSystem.java:63)
    at org.tinymediamanager.core.entities.MediaFile.getMediaInfoSnapshotFromISO(MediaFile.java:1252)
    at org.tinymediamanager.core.entities.MediaFile.gatherMediaInformation(MediaFile.java:1432)
    at org.tinymediamanager.core.MediaFileInformationFetcherTask.call(MediaFileInformationFetcherTask.java:84)
    at org.tinymediamanager.core.MediaFileInformationFetcherTask.call(MediaFileInformationFetcherTask.java:37)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: com.github.stephenc.javaisotools.loopfs.api.LoopFileSystemException: Invalid block size: 0
    at com.github.stephenc.javaisotools.loopfs.iso9660.Iso9660VolumeDescriptorSet.validateBlockSize(Iso9660VolumeDescriptorSet.java:210)
    at com.github.stephenc.javaisotools.loopfs.iso9660.Iso9660VolumeDescriptorSet.deserializePrimary(Iso9660VolumeDescriptorSet.java:128)
    at com.github.stephenc.javaisotools.loopfs.iso9660.Iso9660VolumeDescriptorSet.deserialize(Iso9660VolumeDescriptorSet.java:99)
    at com.github.stephenc.javaisotools.loopfs.spi.AbstractBlockFileSystem.loadVolumeDescriptors(AbstractBlockFileSystem.java:78)
    at com.github.stephenc.javaisotools.loopfs.spi.AbstractBlockFileSystem.iterator(AbstractBlockFileSystem.java:61)
    ... 10 common frames omitted



RE: MediaInfo from XML - myron - 2016-12-12

well, MediaInfo is basically read for every known video file.
So, if you have 2 iso discs, you should have 2 -mediainfo.xml files...

According to your log snippet, the xml for the first disc has been read;
We get an exception on second disc, because there is no such file (and we couldn't pare the iso directly)


RE: MediaInfo from XML - ClueLessNoob - 2016-12-12

thanks for the reply, what I am trying to say is that even for the first file the information is not displayed in TMM. Is that because disc2 failed?

so I generated the xml for the 2nd disc and dropped it into the folder with the right maning. I can see in the log file that the xml is read.

nevertheless TMM Media Info still has 0 information other then knowing it is a BluRay disc. Why does it not pick up the runtime, audio tracks, subtitles ...


RE: MediaInfo from XML - myron - 2016-12-13

have to check your XML file.
But kindy busy these days...

According to log, duration seems to be ignored b/c of structure, but all the other information should be there...


This forum uses Lukasz Tkacz MyBB addons.