0

I'm trying to find out if file is a video. Currently trying with pymediainfo, but I'm stuck on this error:

Traceback (most recent call last):
  File "C:/Users/Ankka/Downloads/test.py", line 6, in <module>
    fileInfo = MediaInfo.parse(o)
  File "C:\Python34\lib\site-packages\pymediainfo\__init__.py", line 90, in parse
    p = Popen(command, stdout=fp_out, stderr=fp_err, env=environment)
  File "C:\Python34\lib\subprocess.py", line 859, in __init__
    restore_signals, start_new_session)
  File "C:\Python34\lib\subprocess.py", line 1112, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

I get this error with this code:

from pymediainfo import MediaInfo

o = "D:/Zeluge/video.mkv"

fileInfo = MediaInfo.parse(o)
for track in fileInfo.tracks:
   if track.track_type == "Video":
       print(o)
A.Ankka
  • 1
  • 1
  • do you have `mediainfo.exe` installed? – jfs Sep 13 '15 at 17:33
  • Yes, I have it installed. – A.Ankka Sep 13 '15 at 18:29
  • what happens if you call: `subprocess.check_call(["mediainfo", "--version"])`? – jfs Sep 13 '15 at 18:34
  • It does give the same FileNotFoundError. – A.Ankka Sep 13 '15 at 19:16
  • what happens if you provide the full path to `mediainfo` including the file extension? Note: you could use raw-string literals such as `r"C:\Some\Path"` (notice: `r''`) -- no need to use `/` here. – jfs Sep 13 '15 at 19:21
  • You mean like this? subprocess.check_call([r"C:\Program Files\MediaInfo\MediaInfo.exe", "--version"]) It opens the program – A.Ankka Sep 13 '15 at 19:40
  • try `os.environ['PATH'] = os.environ['PATH'] + os.pathsep + r"C:\Program Files\MediaInfo"` before calling `MediaInfo.parse()`. – jfs Sep 13 '15 at 19:46
  • Now the code on my original post opens the program and doesn't print anything, until I close the program, then it gives `bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?` – A.Ankka Sep 13 '15 at 19:55
  • it is a separate question. Check whether you have followed the installation instructions properly (e.g., install `lxml`). It seems like pymediainfo issue. – jfs Sep 13 '15 at 20:00

0 Answers0