Rename QuickTime video files (e.g. mp4) as follows "ModifyDate - Duration"

Started by veevoo, March 17, 2024, 01:52:02 PM

Previous topic - Next topic

veevoo

Hello. I apologize in advance for my English as I am using a translator.

First I would like to thank Phil Harvey for the great software.

Can you please tell me how I can rename QuickTime video files (e.g. mp4) with the following "ModifyDate - Duration" in the format %Y%m%d%d_%H%M%M%S%%+c.%%le without changing the tags themselves in the file?

I have read similar topics before asking the question:
https://exiftool.org/forum/index.php?topic=10683.0
https://exiftool.org/forum/index.php?topic=7289.0
https://exiftool.org/forum/index.php?topic=12391.0
https://exiftool.org/forum/index.php?topic=15451.0

but for reasons unknown to me the proposed solutions do not always work, i.e. the command

 exiftool '-testname<${modifydate;ShiftTime("-0:0:".$self->GetValue("Duration","ValueConv"));DateFmt("/path/to/dir/%Y/%m/%d/%Y%m%d_%H%M%S%%+c.%%le")}' -api QuicktimeUTC -ext mp4 .
part of my mp4 video files renames correctly, and part does not - taking the date from modifydate without subtracting duration. And all video files are made by the same phone on the same day.

As far as I understand it can be realized with a custom function in the configuration file. For me it would be a better solution than a long command in terminal. But unfortunately I don't know Perl programming language at all. I would also like to be able to rename videos and images in one command (using -execute) by specifying once the format -d "path/to/dir/%Y/%m/%d/%Y%m%d_%H%M%S%%+c.%%le" in -common_args.

exiftool version: 12.57, GNU Linux.

Thanks in advance.

Phil Harvey

Can you tell us what are the values of Duration for some of the files where the ModifyDate isn't shifted properly?

- 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 ($).