.mts files, tag "datetimeoriginal" not possible to rename & copy files

Started by prep8r8tor, January 19, 2025, 02:18:38 PM

Previous topic - Next topic

prep8r8tor

Hello all,

exiftool -time:all -s 00087.MTS

FileModifyDate                  : 2025:01:18 17:05:20+01:00
FileAccessDate                  : 2025:01:18 22:41:02+01:00
FileInodeChangeDate             : 2025:01:18 20:58:32+01:00
DateTimeOriginal                : 2015:12:27 18:55:23+00:00

exiftool -s 00087.MTS

ExifToolVersion                 : 13.12
FileName                        : 00087.MTS
Directory                       : .
FileSize                        : 4.2 GB
FileModifyDate                  : 2025:01:18 17:05:20+01:00
FileAccessDate                  : 2025:01:18 22:41:02+01:00
FileInodeChangeDate             : 2025:01:18 20:58:32+01:00
FilePermissions                 : -rwxrwxrwx
FileType                        : M2TS
FileTypeExtension               : mts
MIMEType                        : video/m2ts
VideoStreamType                 : H.264 (AVC) Video
AudioStreamType                 : A52/AC-3 Audio
AudioBitrate                    : 256 kbps
SurroundMode                    : Not indicated
AudioChannels                   : 2
AudioSampleRate                 : 48000
ImageWidth                      : 1920
ImageHeight                     : 1080
DateTimeOriginal                : 2015:12:27 18:55:23+00:00
GPSVersionID                    : 2.2.0.0
GPSStatus                       : Measurement Void
GPSMapDatum                     : WGS-84
Make                            : JVC
Warning                         : [minor] The ExtractEmbedded option may find more tags in the video data
Duration                        : 0:23:09
ImageSize                       : 1920x1080
Megapixels                      : 2.1


Hello,
I would like to rename my video files according to the creation date and resolution of the recording and copy them to a new folder.

The recording date "datetimeoriginal" is visible. The resolution "1920x1080" is also visible.

The manufacturer of the video camera is also visible.

When I try to rename all the files in the subfolders based on the recording date, resolution and manufacturer,

exiftool -api largefilesupport=1 -r -o -ignoreMinorErrors . '-filename</media/p/WDC14TB-A/2024-exiftool-test/jvc/${DateTimeOriginal;}_${ImageSize}-${Make;}%-c.%le' -d '%Y.%m.%d-%H-%M-%S'

I get a terse message:

4 directories scanned
0 image files read


What am I doing wrong?
The date of recording is the most important criterion/parameter for me.

Thank you for your help in advance.
P8





StarGeek

FAQ #16, Why doesn't ExifTool rename my AVI files?

MTS files are not writable by exiftool, so they are not processed by default. Add the -ext (-extension) option like this
-ext+ mts

Edit: Another problem is that you are including the -o (-out) option, but immediately following it is the -m (-ignoreMinorErrors) option. The -o option requires the name or directory to output copies to. Since this is missing, it will attempt to make a copy of files with the name -ignoreMinorErrors. You then have the dot, which I'm guessing is the argument you wanted to use with the -o option. You'll have to move the dot to directly after the -o option

Edit2: That may not be right, as moving the dot means you no longer have a directory to process. Are you trying to make copies of all the mts files in the new directory, or are you trying to move and rename the files to the new directory? if the former, then you will still need a dot to represent the current directory. If the latter, remove the -o option.
"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

prep8r8tor

Thank you very much StarGeek for your quick reply.

I have achieved my goal with the syntax you improved.

exiftool -api largefilesupport=1 -r . '-FileName</media/p/WDC14TB-A/2024-exiftool-test/jvc/${DateTimeOriginal;}_${ImageSize}-${Make;}%-c.%le' -d '%Y.%m.%d-%H-%M-%S' -ext+ mts

But the files were moved to the desired directory, not copied.
How can I copy the files, not move them? "-o" doesn't work in my syntax...
I simply adopted the dot after the "-r". I have to admit that I'm not entirely sure what the dot means. In any case, the syntax together with "-r -o . " just doesn't work here. I was able to successfully copy other files, e.g. Nikon raw files.
I am very grateful for the existence of the exiftool by Phil Harvey. But it is very time consuming to really exploit the tool and use its power comfortably.

Thanks
P.




StarGeek

The dot stands for the current directory.

If you want to create copies, then you would use the -o (-out) option, but as I said, it needs a name that will either be a file name to create or the directory to write to.  In your case, you are including the target directory as part of the file rename, so all that is needed is a dummy directory.

Try this
exiftool -api largefilesupport=1 -r -o DummyDir/ '-FileName</media/p/WDC14TB-A/2024-exiftool-test/jvc/${DateTimeOriginal;}_${ImageSize}-${Make;}%-c.%le' -d '%Y.%m.%d-%H-%M-%S' -ext+ mts .

To make it more obvious, I've used DummyDir/ after the -o option. This is just a placeholder that is overridden by the path /media/p/WDC14TB-A/2024-exiftool-test/jvc/ used in the filename rename.

I've moved the dot which represents the current directory to the end of the line. This is a stylistic choice, as most example exiftool commands place the files/directories to be processed at the end of the command.

See also Writing "FileName" and "Directory" tags.
"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

prep8r8tor

Thanks again for the help,
it worked well now. I will continue to study exiftool, thanks for the tip. There are still many photos and videos from the last 20 years - digital, and another 20, analog to digital, waiting for me. I am more and more impressed by the power of exiftool.

Best wishes