使用FFmpeg检索和保存媒体元数据 [英] Retrieving and Saving media metadata using FFmpeg
问题描述
我想读取媒体文件中的元数据,然后将该元数据保存在文本/ xml文件中,以便稍后将该数据插入到我的数据库中。我更喜欢使用ffmpeg。
I want to read the metadata in media files and then save that metadata in a text/xml file, so that I can later insert that data in my database. I would prefer to use ffmpeg.
MediaInfo也是一样的事情?我知道我可以使用MediaInfo获取个别曲目的元数据,但我想自动化它;如在每当找到新的媒体文件时,读取其元数据,然后将其存储在txt / xml文件中。
Also is the same thing possible with MediaInfo?? I know I can get the metadata for individual tracks using MediaInfo, but I would want to automate it; as in whenever a new media file is found, read its metadata and then store it in a txt/xml file.
或者,是否有任何其他工具/实用程序/ API我可以使用这个?
Or, is there any other tool/utility/API that I can use for this?
推荐答案
您可以使用将媒体文件元数据保存到文本文件 - f ffmetadata
选项如下:
ffmpeg -i input_video -f ffmetadata metadata.txt
有关详细信息,请参阅元数据部分在ffmpeg文档中。
For details, see Metadata section in ffmpeg documentation.
这篇关于使用FFmpeg检索和保存媒体元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!