reading and parsing Windows video files metadata in Python

元气小坏坏 提交于 2019-12-11 06:19:38

问题


I'm working on a project and I need to read and parse video metadata.(duration, date created,title,bit rate , ...) as far as I know there isn't any good package for Python 3.X for this issue.

1 -- I found these :

enzyme

hachoir-metadata

but they are designed for python 2.X

2 -- I also know how to use ffmpeg and other libraries that process video files. but they are so slow, I want to simply read the metadata from the windows file.

3 -- I tried to use exifread package to read video metadata , but as far as I found out , it doesn't work on video files.

4 -- there was this question that asked for a way to retrieve only length of videos, but it is unanswered.

I'm looking for this:

file = open(path_to_video_file)
props = python_video_info_parser.get_info(file)
print(props)

platform:

python 3.4 windows 10


回答1:


I hope you found what you are looking for. :)

But if you did not or others are wondering.. I am researching the same sunject and I may have found a solution.

What I have found so far is a command-line tool called exiftool. If you download this software and use the command line feature you are able to run these commands with the subprocess module.

There is support for a lot of file formats, as shown in the documentation.

I will update this post as soon as I have found a working soltuion. :)

You can download the tool here.



来源:https://stackoverflow.com/questions/39743494/reading-and-parsing-windows-video-files-metadata-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!