Terence Eden. He has a beard and is smiling.
Theme Switcher:

Add date metadata to MP4 videos

· 2 comments · 150 words · Viewed ~3,411 times


As ever, notes to myself. I hope you appreciate this future me!

Photographs often contain EXIF metadata - really useful for finding out when a photo was taken. It turns out that you can add similar metadata to MP4 format videos.

Here's how to do it with ffmpeg on Ubuntu Linux. The magic option is -metadata creation_time="2015-12-25T12:34:56" Stick that in when you're encoding your video and it will be added to the new file.

The time should be in ISO8601.

If you have a video that you don't want to re-encode, you can do this.

ffmpeg -i original.mp4 -c copy -map 0 -metadata creation_time="2015-12-25T12:34:56" output.mp4

To check it has worked:

ffprobe -show_streams -show_format output.mp4

Should spit out a whole bunch of metadata, including

TAG:creation_time=2016-12-25T12:34:56.000000Z

Share this post on…

2 thoughts on “Add date metadata to MP4 videos”

  1. This is also mostly a note to myself 😉

    ISO8601 datetimes are localtime unless an offset is specified. If you need that, here's how to do it (examples for CET):

    2016-12-25T12:34:56+01:00 or 2016-12-25T12:34:56+0100 or 2016-12-25T12:34:56+01

    Syntax note: If you live on the western hemisphere, the plus becomes a minus.

    And in the metadata that got read out (TAG:creation_time=2016-12-25T12:34:56.000000Z), the "Z" stands for Zulu time, which is an alias for UTC or offset +00:00

    Reply

What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.

See allowed HTML elements: <a href="" title="">
<abbr title="">
<acronym title="">
<b>
<blockquote cite="">
<br>
<cite>
<code>
<del datetime="">
<em>
<i>
<img src="" alt="" title="" srcset="">
<p>
<pre>
<q cite="">
<s>
<strike>
<strong>

To respond on your own website, write a post which contains a link to this post - then enter the URl of your page here. Learn more about WebMentions.