Log in

View Full Version : How to insert creation time metadata on a Mov file using ffmpeg


alvgarci
22nd December 2010, 06:47
Hi all:

I'm trying to create a mov file (converting from MTS), but I can't copy the creation time metadata from the MTS. I can read it, but not sure how to insert it on the mov.

Thanks

J_Darnley
22nd December 2010, 11:43
-metadata "tag=value"

alvgarci
22nd December 2010, 12:39
Well, I spent a lot of time searching the solution for that, but forgot write down directly the creation date and time as it was a common tag.


Did you tried this to set correctly the creation time and date on mov or mp4?

Thanks

Thanks

melanie23
24th December 2010, 02:53
Aww, you beat me to it.

alvgarci
28th December 2010, 21:17
Didn't work:

This is the process:

Goal I have a 00064.MTS file to convert without recompress video and compressing the audio into a mov container: also required > tag correctly the source creation date info

1) this is the exiftool 00064.MTS output

ExifTool Version Number : 8.40
File Name : 00064.MTS
Directory : .
File Size : 37 MB
File Modification Date/Time : 2010:10:28 21:25:07+02:00
File Permissions : rwxrwxrwx
File Type : M2TS
MIME Type : video/m2ts
Video Stream Type : H.264 Video
Audio Stream Type : A52/AC-3 Audio
Audio Bitrate : 448000
Surround Mode : Not indicated
Audio Channels : 3/2
Image Width : 1440
Image Height : 1080
Date/Time Original : 2008:07:13 03:47:28+02:00
Aperture Setting : Auto
Gain : 0 dB
Exposure Program : Program AE
White Balance : Auto
Focus : Auto (2.5)
Image Stabilization : On
F Number : 4
Make : Sony
Audio Sample Rate : 48000
Aperture : 4.0
Image Size : 1440x1080



2) Let's do the conversion:

ffmpeg -i 00064.MTS -vcodec copy -ab 128000 -metadata "Create Date=2008:07:13 03:47:28" -f mov myfile.mov

Here is the output

FFmpeg version SVN-r25922, Copyright (c) 2000-2010 the FFmpeg developers
built on Dec 9 2010 08:38:58 with gcc 4.2.1 (Apple Inc. build 5664)
configuration: --enable-libmp3lame --enable-shared --disable-mmx --arch=x86_64
libavutil 50.34. 0 / 50.34. 0
libavcore 0.15. 0 / 0.15. 0
libavcodec 52.99. 0 / 52.99. 0
libavformat 52.88. 0 / 52.88. 0
libavdevice 52. 2. 2 / 52. 2. 2
libavfilter 1.68. 0 / 1.68. 0
libswscale 0.12. 0 / 0.12. 0

Seems stream 0 codec frame rate differs from container frame rate: 59.94 (60000/1001) -> 59.94 (60000/1001)
Input #0, mpegts, from '00064.MTS':
Duration: 00:00:35.04, start: 1.000033, bitrate: 8909 kb/s
Program 1
Stream #0.0[0x1011]: Video: h264, yuv420p, 1440x1080 [PAR 4:3 DAR 16:9], 59.96 fps, 59.94 tbr, 90k tbn, 59.94 tbc
Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
Stream #0.2[0x1200]: Subtitle: pgssub
Output #0, mov, to 'myfile.mov':
Metadata:
Create Date : 2008:07:13 03:47:28
encoder : Lavf52.88.0
Stream #0.0: Video: avc1 / 0x31637661, yuv420p, 1440x1080 [PAR 4:3 DAR 16:9], q=2-31, 30k tbn, 29.97 tbc
Stream #0.1: Audio: aac, 48000 Hz, 5.1, s16, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 2100 fps=530 q=-1.0 Lsize= 34473kB time=35.05 bitrate=8056.9kbits/s
video:33702kB audio:715kB global headers:0kB muxing overhead 0.159716%

3) Conversion is OK

4) Now check the Metadata of the new mov file.

This is the output:


ExifTool Version Number : 8.40
File Name : myfile.mov
Directory : .
File Size : 34 MB
File Modification Date/Time : 2010:12:28 21:08:37+01:00
File Permissions : rw-r--r--
File Type : MOV
MIME Type : video/quicktime
Major Brand : Apple QuickTime (.MOV/QT)
Minor Version : 0.2.0
Compatible Brands : qt
Movie Data Size : 35243853
Movie Header Version : 0
Create Date : 0000:00:00 00:00:00
Modify Date : 0000:00:00 00:00:00
Time Scale : 1000
Duration : 00:35
Preferred Rate : 1
Preferred Volume : 100.00%
Preview Time : 0 s
Preview Duration : 0 s
Poster Time : 0 s
Selection Time : 0 s
Selection Duration : 0 s
Current Time : 0 s
Next Track ID : 3
Track Header Version : 0
Track Create Date : 0000:00:00 00:00:00
Track Modify Date : 0000:00:00 00:00:00
Track ID : 1
Track Duration : 00:35
Track Layer : 0
Track Volume : 0.00%
Image Width : 1920
Image Height : 1080
Graphics Mode : srcCopy
Op Color : 0 0 0
Matrix Structure : 1 0 0 0 1 0 0 0 1
Media Header Version : 0
Media Create Date : 0000:00:00 00:00:00
Media Modify Date : 0000:00:00 00:00:00
Media Time Scale : 48000
Media Duration : 00:35
Balance : 0
Handler Class : Data Handler
Handler Type : URL
Handler Description : DataHandler
Other Format : mp4a
Software Version : Lavf52.88.0
Avg Bitrate : 8044017
Image Size : 1920x1080
Rotation : 0





As you can see all create date is 0 (null). I've tried many formats and Tags.. none works.

Questions:

1) How to do it?

2) What is the metadata flag that usually video editing program uses to catalog the media?

Thanks

Alvaro

nm
30th December 2010, 02:06
"CreateDate" is an XMP tag, not native MP4/MOV metadata. FFmpeg can't add XMP tags to the file. I don't know any command-line tool that can.

2) What is the metadata flag that usually video editing program uses to catalog the media?

Most video editing programs probably use the file creation and modification dates for MP4 and MOV files.


Edit: Apparently exiftool also reads stream timestamps, as cacepi shows in the crossposted thread: http://forum.doom9.org/showthread.php?p=1467413#post1467413
Maybe other tools do too.