问题
Is there any standard way to get information from a video file? For images we have EXIF data which can be used to get information about the date/time , size etc of the image file. I was wondering if there is such a thing for videos as well.
The use case is - I have lot of videos which I shot from my digital camera. I want to rename them to something more meaningful like YYYY-MM-DD rather than Video_N . The YYYY-MM-DD should be the date and time when the video was shot.
Any solution in Python, C/C++, Perl would be appreciated but if you have solution in other language, please do let me know.
Thanks.
回答1:
exiftool reads video containers and their metadata.
回答2:
Unfortunately, most cameras don't actually store enough metadata in the video :(.
If they are storing it, due to the wide variety of video codecs and containers like AVI, MOV, MPG, MP4, etc., a good option will to run ffmpeg -i to read it.
来源:https://stackoverflow.com/questions/6248347/exif-like-thing-for-videos