使用ffmpeg和regex获取视频的“creation_time” [英] Get 'creation_time' of video using ffmpeg and regex
本文介绍了使用ffmpeg和regex获取视频的“creation_time”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个由 ffmpeg 生成的视频文件的元数据文本。
I have a metadata text of a video file which is produced by ffmpeg.
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2011-09-10 21:44:22
model : iPhone 4
model-deu : iPhone 4
encoder : 4.3.5
encoder-deu : 4.3.5
date : 2011-09-10T17:44:22-0400
date-deu : 2011-09-10T17:44:22-0400
location : +40.7329-073.9864/
location-deu : +40.7329-073.9864/
make : Apple
make-deu : Apple
我想获得 *'creation_time' * 使用上述文字的正则表达式。我正在使用C#。
I want to get the *'creation_time'* value using regex of the above text. I am using C#.
推荐答案
尝试使用下一个正则表达式:
Try to use next regex pattern:
creation_time\s*:\s*(\d+-\d+-\d+\s+\d+:\d+:\d+)
或更具体的模式:
creation_time\s*:\s*(\d{1,4}-\d{1,2}-\d{1,2}\s+\d{1,2}:\d{1,2}:\d{1,2})
子模式返回创建日期
这篇关于使用ffmpeg和regex获取视频的“creation_time”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文