Can I change capture date on Video files?

Started by suninmoon, September 14, 2022, 10:27:16 AM

Previous topic - Next topic

suninmoon

Hi

My apologies, I've been looking and tried some examples of commands that are supposed to make this work but I could not get it to work.

Can ExifTool change the capture date for MP4 specifically and possibly AVI?

Thank you
Josh

wywh

Try something like this which defaults to your current timezone. I guess .avi does not support much metadata but you might change the file dates or convert to .mp4, .m4v or .mov.

exiftool -api QuickTimeUTC=1 -QuickTime:CreateDate='2022:01:01 12:00:00' movie.mp4
- Matti

StarGeek

Use the command in FAQ #3 to figure out what the actual tag name of your "Capture Date" is.

Exiftool cannot edit AVI files, but it can edit MP4 files.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

lei

Hi StarGeek,

Can I ask why AVI files cannot be edited? It's not yet implemented or any other reasons? Thanks.

Quote from: StarGeek on September 14, 2022, 04:38:06 PMUse the command in FAQ #3 to figure out what the actual tag name of your "Capture Date" is.

Exiftool cannot edit AVI files, but it can edit MP4 files.

StarGeek

From a previous post
Quote from: Phil Harvey on July 24, 2016, 09:37:37 PMRight.  There is no AVI (RIFF) write support yet.  I don't know that adding write support for this now obsolete format would be worth the effort.

- Phil

I think most AVIs can be losslessly remuxed in to MP4 files with ffmpeg.  At least I've been able to do so.  And those that can't can almost certainly be remuxed into MKV files.

This is the ffmpeg command I use
ffmpeg -hide_banner -i input.avi -c copy -map 0 -map_metadata 0 output.mp4
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

lei

Understand. Thanks a lot.

Quote from: StarGeek on September 15, 2022, 10:52:02 AMFrom a previous post
Quote from: Phil Harvey on July 24, 2016, 09:37:37 PMRight.  There is no AVI (RIFF) write support yet.  I don't know that adding write support for this now obsolete format would be worth the effort.

- Phil

I think most AVIs can be losslessly remuxed in to MP4 files with ffmpeg.  At least I've been able to do so.  And those that can't can almost certainly be remuxed into MKV files.

This is the ffmpeg command I use
ffmpeg -hide_banner -i input.avi -c copy -map 0 -map_metadata 0 output.mp4

suninmoon

Quote from: StarGeek on September 14, 2022, 04:38:06 PMUse the command in FAQ #3 to figure out what the actual tag name of your "Capture Date" is.

Exiftool cannot edit AVI files, but it can edit MP4 files.


Thanks, I ran that and got a "CreateDate" and a "MediaCreateDate" both zeroed out.

suninmoon

Quote from: wywh on September 14, 2022, 11:23:11 AMTry something like this which defaults to your current timezone. I guess .avi does not support much metadata but you might change the file dates or convert to .mp4, .m4v or .mov.

exiftool -api QuickTimeUTC=1 -QuickTime:CreateDate='2022:01:01 12:00:00' movie.mp4
- Matti

Thank you Matti

So I ran that and got the following

C:\File>exiftool -api QuickTimeUTC=-4 -QuickTime:CreateDate='2013:07:04 14:25:07' C:\File\2013_MOV_00020.mp4
Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in QuickTime:CreateDate (PrintConvInv)
Nothing to do.

Not sure where I have an invalid date

Phil Harvey

Use double quotes instead of single quotes if you are running in Windows cmd.exe

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

wywh

Quote from: suninmoon on September 16, 2022, 03:32:23 PM-api QuickTimeUTC=-4

That seems to work although it should be '-api QuickTimeUTC=1' or just '-api QuickTimeUTC'.

I sometimes check what '-api QuickTimeUTC=0' shows without that local time and DST conversion.

- Matti

suninmoon

#10
Quote from: Phil Harvey on September 16, 2022, 09:10:17 PMUse double quotes instead of single quotes if you are running in Windows cmd.exe

- Phil

Thanks Phil, the double quotes worked. I think I got it. I used these two commands to fix the "Date Time Digitized" and "Capture Time" in Lightroom

C:\File>exiftool -api QuickTimeUTC=0 -Quicktime:CreateDate="2013:07:04 14:25:07" C:\File\2013_MOV_00020.mp4


C:\File>exiftool -api QuickTimeUTC=-4 -XMP-exif:DateTimeOriginal="2013:07:04 14:25:07" C:\File\2013_MOV_00020.mp4

Why I had to use two different UTC options to change the time I don't know. Does anyone have any ideas?

Thanks

Phil Harvey

#11
Setting QuickTimeUTC to -4 just turns on the option (the same as -api QuickTimeUTC or -api QuickTimeUTC=1), but setting QuickTimeUTC has no effect on XMP tags.

So both of your commands can be combined into this single command:

C:\File>exiftool -Quicktime:CreateDate="2013:07:04 14:25:07" -XMP-exif:DateTimeOriginal="2013:07:04 14:25:07" C:\File\2013_MOV_00020.mp4
- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

suninmoon


suninmoon

Quote from: wywh on September 17, 2022, 05:02:07 AM
Quote from: suninmoon on September 16, 2022, 03:32:23 PM-api QuickTimeUTC=-4

That seems to work although it should be '-api QuickTimeUTC=1' or just '-api QuickTimeUTC'.

I sometimes check what '-api QuickTimeUTC=0' shows without that local time and DST conversion.

- Matti


Thanks Matti

-api QuickTimeUTC=1

seems to have corrected the Capture time according to the file properties and when I import into Mac OS Photos it shows the correct time but for some reason Lightroom shows it as 4 hours ahead. I set for 19:17:12 and Lightroom shows the capture time as 23:17:12. This is on a Windows PC and the time zone in Windows is set to auto (UTC-05:00) Eastern Time

Would this be throwing off Lightroom?

Thanks

StarGeek

Quote from: suninmoon on September 21, 2022, 04:38:38 PMfor some reason Lightroom shows it as 4 hours ahead. I set for 19:17:12 and Lightroom shows the capture time as 23:17:12. This is on a Windows PC and the time zone in Windows is set to auto (UTC-05:00) Eastern Time

Would this be throwing off Lightroom?

For some reason, Adobe has decided not to support the Quicktime time stamps properly.  You might try writing the correct local time to the XMP time stamps, XMP:DateTimeOriginal, XMP:CreateDate, and XMP:ModifyDate (or all three at once with XMP:AllDates) and see if LR will give priority to the XMP data.

If that doesn't work, then you have to decide which you want to use.  The correct time in LR or the correct time in other programs.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype