Get 'creation_time' of video using ffmpeg

2019-09-01 12:02发布

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

I want to get the *'creation_time'* value using regex of the above text. I am using C#.

标签: c# regex ffmpeg
1条回答
倾城 Initia
2楼-- · 2019-09-01 12:37

Try to use next regex pattern:

creation_time\s*:\s*(\d+-\d+-\d+\s+\d+:\d+:\d+)

or more specific pattern:

creation_time\s*:\s*(\d{1,4}-\d{1,2}-\d{1,2}\s+\d{1,2}:\d{1,2}:\d{1,2})

subpattern return a creation date

查看更多
登录 后发表回答