Pymediainfo library throwing RuntimeError when parsing files
akosasante opened this issue · 10 comments
Knowit throws a RuntimeError whenever it tries to use the MediaInfo library to parse files. It only happens with some files, so I'm not sure if size or something else is the cause. Let me know what other information I can provide
KnowIt reported:
+-------------------------------------------------------+
| KnowIt 0.3.0-dev |
+-------------------------------------------------------+
| pymediainfo |
| 3.2.1 |
| libmediainfo.so.0 |
| v0.7.91 |
| |
| ffprobe |
| v3.2.14 |
| |
| enzyme |
| 0.4.2 |
+-------------------------------------------------------+
| profile: default |
+-------------------------------------------------------+
Traceback (most recent call last):
File "/opt/medusa/ext/knowit/api.py", line 64, in know
result = provider.describe(video_path, context)
File "/opt/medusa/ext/knowit/providers/mediainfo.py", line 285, in describe
media_info = self.executor.extract_info(video_path)
File "/opt/medusa/ext/knowit/providers/mediainfo.py", line 100, in extract_info
return self._execute(filename)
File "/opt/medusa/ext/knowit/providers/mediainfo.py", line 167, in _execute
return MediaInfo.parse(filename, library_file=self.location)
File "/opt/medusa/lib/pymediainfo/__init__.py", line 266, in parse
" with libmediainfo".format(filename))
RuntimeError: An eror occured while opening /media/******/TV/All Elite Wrestling Dynamite/Season 1/All Elite Wrestling Dynamite - S01E01 - #1 - Capital One Arena in Washington, DC.mkv with libmediainfo
+-------------------------------------------------------+
May be very old libmediainfo?
Yeah please try with a newer version of mediainfo, this one is 3 years old.
Thanks for the quick reply! And good catch, I didn't realize that the libmediainfo version was so old.
I'm on a raspberry pi running OSMC (Open Source Media Center) version "2019.10-1" which runs Debian Stretch (v. 9.11).
It looks like 0.7.91 is the newest version of libmediainfo available for stretch: https://packages.debian.org/search?keywords=libmediainfo.
Unfortunately, I don't see anything in stretch-backports either: https://packages.debian.org/search?suite=stretch-backports&keywords=libmediainfo. Is there any other way I can pull in a newer version?
First, let's make sure that this isn't a mediainfo bug. Can you try running mediainfo on the file and see if it crashes?
If it does, you can probably get a newer version through upstream's repos: https://mediaarea.net/en/Repos
Running MediaInfo on a 1.2GB mkv:
$ mediainfo "All Rise - S01E01 - Pilot.mkv"
General
Unique ID : 215072238046203745224870006372964952042 (0xA1CD680649E165E288AA609EFF06E7EA)
Complete name : All Rise - S01E01 - Pilot.mkv
Format : Matroska
Format version : Version 4 / Version 2
File size : 1.19 GiB
Duration : 42 min 42 s
Overall bit rate : 4 003 kb/s
Encoded date : UTC 2019-09-24 01:02:55
Writing application : FastLE v3.0.0 - AVS
Writing library : libx264 + libebml + libmatroska + libfastrar
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings, CABAC : Yes
Format settings, ReFrames : 5 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 42 min 42 s
Bit rate : 3 539 kb/s
Width : 1 280 pixels
Height : 718 pixels
...etc
Running MediaInfo on a 3.2GB mkv:
$ mediainfo "All Rise - S01E04 - A View from the Bus.mkv"
<no result, just a blank line>
FWIW, In my searching for a solution I also found this (very old) bug about libzen and large file sizes: https://bugs.launchpad.net/ubuntu/+source/libzen/+bug/1693850
Yeah it's a mediainfo bug then, you'll need to try a newer version from their repository. If it still doesn't work, you'll have to file an issue upstream.
If it still doesn't work, you'll have to file an issue upstream.
We don't provide binaries for "raspberry pi running OSMC", so the user needs to compile from source and/or ask the distro manager to fix their release of libzen (fixed years ago in the "upstream" ditro).
If it still doesn't work, you'll have to file an issue upstream.
We don't provide binaries for "raspberry pi running OSMC", so the user needs to compile from source and/or ask the distro manager to fix their release of libzen (fixed years ago in the "upstream" ditro).
I meant in case it was something other than this size bug :)
But looking at the version in Stretch (0.4.34) and the fact that it was fixed in 0.4.35 by MediaArea/ZenLib@dc105b3, it might be a Stretch bug indeed.
Maybe you can just try installing the Buster debs (not that I recommend it though).
Alright; thanks for the help folks! I will see if I can just compile the fixed version; but nonetheless appreciate the aid with this ticket.
FWIW, installing/building the mediainfo version from the repo https://mediaarea.net/en/Repos seems to have cleared up the issue so far. Thanks again!