0

In Windows 10 environment, I would like to change the name of both “file with extension mp4” and “file with extension xml” to the shooting date of mp4 file.

C0001.MP4
C0001M01.XML
C0002.MP4
C0002M01.XML

Specifically, I want to change the file name as follows.

2019-10-23_13-10-32.MP4
2019-10-23_13-10-32.XML
2019-10-23_13-10-49.MP4
2019-10-23_13-10-49.XML

I tried to think that using the ext option would give me the expected result, but I didn't get the expected result.

First time

C:\Users\user>exiftool "-FileName<CreateDate" -d "%Y-%m-%d_%H-%M-%S%%-c.%%e" -ext "xml" C:\hoge
Warning: [minor] Error 3 placing ::NonRealTimeMetaLtcChangeTableLtcChangeStatus in structure or list - C:/hoge/C0001M01.XML
Warning: No writable tags set from C:/hoge/C0001M01.XML
Warning: [minor] Error 3 placing ::NonRealTimeMetaAudioFormatAudioRecPortTrackDst in structure or list - C:/hoge/C0002M01.XML
Warning: No writable tags set from C:/hoge/C0002M01.XML
    1 directories scanned
    0 image files updated
    2 image files unchanged

Second time

C:\Users\user>exiftool "-FileName<CreateDate" -d "%Y-%m-%d_%H-%M-%S%%-c.%%e" -ext "*" C:\hoge
Warning: [minor] The ExtractEmbedded option may find more tags in the movie data - C:/hoge/C0001.MP4
Warning: [minor] Error 3 placing ::NonRealTimeMetaLtcChangeTableLtcChangeStatus in structure or list - C:/hoge/C0001M01.XML
Warning: No writable tags set from C:/hoge/C0001M01.XML
Warning: [minor] The ExtractEmbedded option may find more tags in the movie data - C:/hoge/C0002.MP4
Warning: [minor] Error 3 placing ::NonRealTimeMetaAudioFormatAudioRecPortPort in structure or list - C:/hoge/C0002M01.XML
Warning: No writable tags set from C:/hoge/C0002M01.XML
    1 directories scanned
    2 image files updated
    2 image files unchanged

Added November 22, 2019

I tried the code posted in this link .

C:\Users\user>exiftool -TagsFromFile %d%f.mp4 "-FileName<CreateDate" -ext xml C:\hoge
Warning: Error opening file - C:/mp4data/C0001M01.mp4
Warning: Error opening file - C:/mp4data/C0002M01.mp4
    1 directories scanned
    0 image files updated
    2 image files unchanged

I think the cause of the error is that “.mp4 file name” and “.xml file name” do not match. Since “M01” is always a fixed value, is there any way to batch process it?

C0001.MP4
C0001M01.XML
C0002.MP4
C0002M01.XML
re6
  • 37
  • 1
  • 5
  • The error I believe is that `exiftool` is not finding metadata for the `xml` files in the directory. – l'L'l Nov 21 '19 at 03:05
  • I see. I realized I was misunderstood. Added a new question in the text. – re6 Nov 22 '19 at 01:51
  • Take a look at the Advanced Features under the [`-w` (textout) option](https://sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html#w-EXT-or-FMT--textOut) for details on how to modify the `%f` variable. I haven't tested it but I think that `%-.3f` might do it. That should remove the last 3 characters from the name of the XML filename (not including the extension). – StarGeek Nov 22 '19 at 02:40

0 Answers0