MP4 Model Naming Date Correction and Writing in specified directory in one walk

Started by CRNEFmat, January 24, 2023, 04:51:31 PM

Previous topic - Next topic

CRNEFmat

Hi there,
I do two runs specified:

ARGFILE 1 (execute.txt)
#Makes UTC Time and set Model to XiaoYi4kplus
-r
-overwrite_original
-Model=XiaoYi4Kplus
-CreateDate-=2
-ModifyDate-=2
O:\Yi4k\

ARGFILE 2 (execute.txt)
#Renaming and copy to specefied directories
-r
-o
-.
-m
-d
H:\video.archive\video.%Y(UTC)\%Y%m%d-DE-/%Y%m%d_%H%M%S
-FileName<${CreateDate}_${ModelShort}%-6f.%e
O:\Yi4k\

EXECUTE file (execute.bat)
exiftool -ext MP4 -@ execute.txt
pause
exit
ModelShort is defined in the config file!

Do you see a possibility to this ALL in ONE Argfile to provide the slow -overwrite_original procedure in place?

Best regards,
Matthias





StarGeek

The main problem is that you can't adjust the time stamps and use the adjusted time in the rename.  As long as the -2 is hardcoded, you'll have to drop the -d (-dateFormat) option and move it into the CreateDate using the DateFmt and ShiftTime helper functions.  Test it out with Testname first to make sure it's working correctly.

#Makes UTC Time and set Model to XiaoYi4kplus
-r
-overwrite_original
-Model=XiaoYi4Kplus
-CreateDate-=2
-ModifyDate-=2
-o
.
-m
-FileName<${CreateDate;ShiftTime('-2');DateFmt('H:\video.archive\video.%Y(UTC)\%Y%m%d-DE-/%Y%m%d_%H%M%S')}_${ModelShort}%-6f.%e
O:\Yi4k\

The dummy argument for the -o (-out) option is supposed to be a directory, so it should be just a dot, not (hyphen)(dot).  Though I haven't tested it to see if there's a problem.  If it works correctly, don't worry about it.

Alternatively, you could keep the -d option and instead use the GlobalTimeShift option.  In that case, you would have to use the -TagsFromFile option to copy the adjusted dates back into file
#Makes UTC Time and set Model to XiaoYi4kplus
-r
-overwrite_original
-Model=XiaoYi4Kplus
-GlobalTimeShift
-2
-TagsFromFile
@
-CreateDate
-ModifyDate
#Renaming and copy to specefied directories
-o
-.
-m
-d
H:\video.archive\video.%Y(UTC)\%Y%m%d-DE-/%Y%m%d_%H%M%S
-FileName<${CreateDate}_${ModelShort}%-6f.%e
O:\Yi4k\
"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

CRNEFmat

Hi StarGeek,
thank you so much. ModelShort is not taken into the filename, but is written to the exif tags. This is no problem. Working with my Yi4KPlus is a special workflow, so it is not necessary to catch the ModelShort naming out of the file, this time.
#Makes UTC Time and set Model to XiaoYi4kplus
-r
-overwrite_original
-Model=XiaoYi4Kplus
-CreateDate-=2
-ModifyDate-=2
-o
.
-m
-FileName<${CreateDate;ShiftTime('-2');DateFmt('H:\video.archive\video.%Y(UTC)\%Y%m%d-DE-/%Y%m%d_%H%M%S')}_XA%-6f.%e
O:\Yi4k\

Both versions suggested work flawless, but move the file from the source target.
I don't understand why?

Is there another possibility to only copy and rewrite the MP4 file?

Thank you for your reply, it made my understanding of the exiftool synthax more clear!!!!

Best regards,
Matthias

Phil Harvey

Hi Matthias,

Remove the -overwrite_original option if you want to copy instead of move the file.

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

CRNEFmat

Hi Phil,
that's it.

Thank you very much for this fine tool and your help!
Thanks to all in this forum!

Best regards,
Matthias