Search code examples
windowsffmpegmp4batch-renameexiftool

I want to change the file name with exiftool. To “Result of adding time zone (+9) to CreateDate”


I shot a video with a sony camera. A file with the extension .mp4 was created. I want to change the shooting date and time to a file name. The environment is Windows10.


What I tried

I first dragged and dropped the .mp4 video file to exiftool (-k) .exe.

ExifTool Version Number         : 11.76
File Name                       : C0001.MP4
File Modification Date/Time     : 2019:10:23 13:10:49+09:00
File Access Date/Time           : 2019:11:17 21:50:24+09:00
File Creation Date/Time         : 2019:11:17 21:50:21+09:00
MIME Type                       : video/mp4
Major Brand                     : Sony XAVC
Create Date                     : 2019:10:23 04:10:32
Modify Date                     : 2019:10:23 04:10:32
Track Create Date               : 2019:10:23 04:10:32
Track Modify Date               : 2019:10:23 04:10:32
Media Create Date               : 2019:10:23 04:10:32
Media Modify Date               : 2019:10:23 04:10:32
Time Zone                       : +09:00
Last Update                     : 2019:10:23 13:10:32+09:00
Creation Date Value             : 2019:10:23 13:10:32+09:00

I then typed the following command at a Windows 10 command prompt:

C:\hoge>"exiftool(-k).exe" -r "-FileName<CreateDate" -d "%Y-%m-%d_%H-%M-%S - %%f.%%e" C:\hoge
Warning: [minor] The ExtractEmbedded option may find more tags in the movie data - C:/hoge/C0001.MP4
Warning: Error removing old file - C:/hoge/C0001.MP4
    1 directories scanned
    1 image files updated
-- press RETURN --

The following file was created.

2019-10-23_04-10-32 - C0001.MP4


How can I output the following file?

I don't know how to add time zone (+9) to CreateDate.

2019_1023_131032.MP4


Solution

  • If the timezone (+09:00) is the local time on the computer you are using, then add -api QuickTimeUTC to the command. This will let exiftool know that the CreateDate, which is supposed to be written as UTC time, was correctly written and to adjust it to the local time. Many older cameras would write the time stamp as local time instead of UTC.

    The other option you can use if the time zone isn't the same as the local computer is the GlobalTimeShift option. In your example, you would add -GlobalTimeShift 9 to the command.