Author Topic: Renaming file with a tag of external XML file  (Read 102 times)

Lovos98

  • Newbie
  • *
  • Posts: 1
Renaming file with a tag of external XML file
« on: March 15, 2019, 05:19:43 PM »
I feel pretty dumb but I really can't figure out how to do this,
I own a Sony camera which produces mp4 videos and xml files with their metadata.
I would like to rename all my files to the date when they were created. My code is ilke this:

exiftool -k -ext MP4 -ext XML -ee -d %y%m%d-%H%M%S%%-c.%%e "-FileName<CreateDate" .

my output:
Code: [Select]
Warning: [minor] Error 3 placing ::NonRealTimeMetaLtcChangeTableLtcChangeStatus in structure or list - ./1.XML
Warning: [minor] Error 3 placing ::NonRealTimeMetaAudioFormatAudioRecPortAudioCodec in structure or list - ./1.XML
Warning: [minor] Error 3 placing ::NonRealTimeMetaAudioFormatAudioRecPortPort in structure or list - ./1.XML
Warning: [minor] Error 3 placing ::NonRealTimeMetaAudioFormatAudioRecPortTrackDst in structure or list - ./1.XML
Warning: [minor] Error 3 placing ::NonRealTimeMetaLtcChangeTableLtcChangeValue in structure or list - ./1.XML
Warning: No writable tags set from ./1.XML
    1 directories scanned
    0 image files updated
    2 image files unchanged


my mp4 doesn't rename neither does my xml

they are called 1.mp4 and 1.xml and I want them both to have the same name with the date.

the tag does exist,
 exiftool -k -time:all 1.mp4
gives me:

Code: [Select]
File Modification Date/Time     : 2019:03:15 03:44:13+01:00
File Access Date/Time           : 2019:03:15 13:43:07+01:00
File Creation Date/Time         : 2019:03:15 13:43:07+01:00
Create Date                     : 2019:03:15 02:43:56
Modify Date                     : 2019:03:15 02:43:56
Track Create Date               : 2019:03:15 02:43:56
Track Modify Date               : 2019:03:15 02:43:56
Media Create Date               : 2019:03:15 02:43:56
Media Modify Date               : 2019:03:15 02:43:56
Time Zone                       : +01:00
Last Update                     : 2019:03:15 03:43:56+01:00


Could somebody point me out what I am doing wrong?

Thanks!

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2365
Re: Renaming file with a tag of external XML file
« Reply #1 on: March 15, 2019, 05:30:35 PM »
What happens if you run the command without -k and -ee.  Neither should be necessary for reading the CreateDate
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14405
    • ExifTool Home Page
Re: Renaming file with a tag of external XML file
« Reply #2 on: March 15, 2019, 09:08:50 PM »
The XML likely didn't contain a CreateDate, but I can't figure out why the MP4 didn't get renamed since it does apparently have a CreateDate.

Try this:

exiftool -d %y%m%d-%H%M%S%%-c.%%e -p "$createdate" 1.mp4

If that works, then this should as long as you have write permission:

exiftool -d %y%m%d-%H%M%S%%-c.%%e "-filename<createdate" 1.mp4

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