FFMPEG - 获取创建 and/or 修改日期

FFMPEG - Get creation and/or modification date

我正在努力从我服务器上托管的 MP4 文件中获取修改日期。

我尝试了以下库:

ffmpeg -i video.mp4

运气不好。我得到的只是持续时间和其他一些字段,但我无法获得修改日期。我也试过 ffprobe 也没有。

有什么建议吗??

非常感谢

通过 ffprobe 获得 creation_time:

ffprobe -v quiet input.mp4 -print_format json -show_entries stream=index,codec_type:stream_tags=creation_time:format_tags=creation_time

查看所有标签:

ffprobe -v quiet input.mp4 -print_format json -show_entries stream_tags:format_tags

我找不到对 modification_time 的任何引用,因此请考虑使用 exiftool or mediainfo

如果 ffmpeg 没有为您提供创建日期元数据,它可能根本不存在于文件中。实用程序 'mediainfo' 可以显示更多信息,可能值得研究其针对您的 mp4 的输出。

我帮你查过了,确实,mp4 在 MDHD 中有一个修改时间条目,但它没有导出(参见 code). You can file an enhancement request 将此元数据功能添加到 FFmpeg,但现在不会帮助你,你需要另一个工具来阅读这个字段。

就输出而言,更简单的 aergistal 替代品是

$ ffprobe -v quiet -select_streams v:0  -show_entries stream_tags=creation_time -of default=noprint_wrappers=1:nokey=1 input.mp4

它将像这样打印创建时间:

2020-07-23T11:51:02.000000Z