Main Menu

Extreme Newbie Help

Started by okeetd, September 22, 2019, 09:32:34 AM

Previous topic - Next topic

okeetd

Looking for super basic explanation of the exact steps necessary to batch rename all the MOV files in a specific folder by creation date. 

The files are in a folder on a secondary drive like this..... G:\Import Folder\iPhone Import\IMG_8170.MOV

I am looking to batch rename ONLY the files in that specific folder using the creation date data in this case it is this (YYYYMMDD HHMMSS)...... 20190116 194750

Okay - now you can laugh... but once I have the proper command.... what do I do with it... where do I put it?  :)  Thanks for the rudimentary explanation.

I must say I am super excited, I did a huge import of all my videos to make room on the iPhone for the upgrade and all the file dates in windows reads the date I imported NOT the creation date of the actual video (none of the windows explorer dates show the file creation date).... so I am excited that I can at least get the real date using EXIFTOOL.  I just need to batch the rename....

Thanks for the help!

 



StarGeek

Quote from: okeetd on September 22, 2019, 09:32:34 AMOkay - now you can laugh... but once I have the proper command.... what do I do with it... where do I put it?

The first thing to do, assuming you're on Windows, is follow the Windows Install instructions carefully.

Then you want to open a CMD window.  Depending upon your version of windows, it'll be in the Program menu under "System" or "Windows System" or something similar.  Or just type CMD in the menu box if using 7 (or Vista?) or higher.  Another option is WinKey+R and typing CMD.

After doing that, if you type exiftool in the cmd box and get the help text, then you're ready to use exiftool.  If you get something like not recognized as an internal or external command error, then exiftool hasn't been installed correctly.  Go back to the install instructions are follow it carefully.

Also, read over the stickied post in the Newbies section of this board, Getting started: Command-line ExifTool in Windows.

QuoteThe files are in a folder on a secondary drive like this..... G:\Import Folder\iPhone Import\IMG_8170.MOV

I am looking to batch rename ONLY the files in that specific folder using the creation date data in this case it is this (YYYYMMDD HHMMSS)...... 20190116 194750

Just to clarify, you want to change IMG_8170.MOV into 20190116 194750.MOV?

The command would be
exiftool -d "%Y%m%d %H%M%S%.%%e" "-Filename<CreateDate" "G:\Import Folder\iPhone Import"
Take note of the fact that because the directory path has a space in it, you have to put quotes around it.  Make sure they're regular quotes, " not fancy quotes " ".  You'll often get fancy quotes if you copy/paste quotes into a word processing program such as MS Word or Google Docs.

Quoteall the file dates in windows reads the date I imported NOT the creation date of the actual video (none of the windows explorer dates show the file creation date)

This is actually a complicated issue.  From the sound of it, technically the CreateDate in the file is wrong.  According to the spec, the CreateDate is supposed to be set to UTC (Coordinated Universal Time).  Windows, for once, reads the time stamp correctly.  You'll find that the "incorrect" time that Windows is showing will be off by the time zone difference of the computer you're on.  For example, if I take a video at 12 noon today, time zone -07:00 Pacific Daylight Time (I'm West Coast US), the local time that Windows would show would be 2019:09:22 12:00:00.  But the CreateDate embedded in that video would be 2019:09:22 19:00:00.

The trouble is, a lot of programs, including those by big companies such as Adobe, do not read the time stamp correctly and end up displaying things out of order.  In the long run, you have to decide what to do based upon what programs you use and how they read the time stamp.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

okeetd

#2
Thank you.  I run the command using the full file path (with spaces) and I get this error...

Warning: [minor] The ExtractEmbedded option may find more tags in the movie data - G:/Import Folder/TOM PHONE VIDEO IMPORT 9.15.19/2019/01 January/TEST/IMG_8170.MOV

Any thoughts on what I might be doing wrong?

And it reports the following and does NOT edit the file names.

1 directories scanned
    0 image files updated
   24 image files unchanged

Also when I run the following command it reports back all 24 of the exif tags for each of the files, so it feels like I have everything installed correctly... but who knows???

exiftool "G:\Import Folder\TOM PHONE VIDEO IMPORT 9.15.19\2019\01 January\Sample"

Thanks again.   

StarGeek

It's not an error.  It's just letting you know that there may be more data in the video stream.  Without adding the -ee (extractEmbedded) option, you're only getting the header metadata.  With the -ee option, you can, for example, extract any gps data (if there is any) and create a geotrack from the from the video (see Inverse Geotagging).  Another example would be to extract images embedded in a PDF.

If you do want to try it out, make sure and add the -a (duplicates) option so it shows all tags that might have duplicated names and the -G (groupNames) option (try -G1) to see what groups those tags belong to.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

okeetd

Thanks Stargeek, but it not doing anything to the file names.... they remain the same after I run the command....

okeetd

#5
Okay - quick update stargeek - I revised the script just a touch - to use creation date.  Also saw someone added a hyphen and hms to the time which is good.  I also changed the name of the directory to sample instead of test.  So I run the following script and it successfully changes the names to the proper date and time but it is stripping the MOV file extention away so explorer doesn't show the video thumnail and it doesn't know what kind of program to use to open it.  When I choose to open the file with VLC viewer the video still plays fine which is good.  How do I make sure to keep the file extention in tact? 

exiftool -d "%Y-%m-%d %Hh%Mm%Ss" "-Filename<CreationDate" "G:\Import Folder\TOM PHONE VIDEO IMPORT 9.15.19\2019\01 January\Sample"

Sorry and not to be a pest, but how can I also make sure if there is a duplicate file that it will name it with a (2) or something so I can see the duplicate. 

StarGeek

You forgot to include the extension, indicated by the .%%e in my first post.  Don't worry, this is fixable.

As long as there aren't any other file types except for videos in the directory, change your command to
exiftool -d "%Y-%m-%d %Hh%Mm%Ss.%%e" -ext * "-Filename<CreationDate" "G:\Import Folder\TOM PHONE VIDEO IMPORT 9.15.19\2019\01 January\Sample"

This uses the -ext (extension) option to allow all file types, even those without extensions.  Which is why you don't want to use it on a directory that has files other than ones you want to rename.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

okeetd

THAT WORKED!  Thanks So much StarGeek!

okeetd

Okay - so two I did great with the MOV files but now I am stuck on MTS files.... Exif tool reads the exif data and the proper original date and time are located in the "date/time original" field.  Is there a translator that would tell me what I should replace the "creationdate" with in the script?

MTS may be a shot in the dark? 

StarGeek

See FAQ #2.

To get the actual tag name, you want to add the -s (short) option.

To get all the time tags by name and group, I'd suggest using
exiftool -time:all -g1 -a -s <FILE>
That way you can pick and choose what tag works best for you.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

okeetd

Thanks again - I have looked over a lot of the file types and I still am not finding the MTS data.  I have also looked into Panasonic and tried a few of those tags with no success.  The exif data I get when I run exiftool is the following. I am looking to rename off of the Date/Time Original info towards the bottom.  Any further thoughts that would point me in the right direction would be appreciated. 

ExifTool Version Number         : 11.65
File Name                       : 00122.MTS
Directory                       : G:/Import Folder/TEST MTS
File Size                       : 518 MB
File Modification Date/Time     : 2018:05:17 18:53:38-04:00
File Access Date/Time           : 2019:09:22 23:04:47-04:00
File Creation Date/Time         : 2019:09:22 23:04:35-04:00
File Permissions                : rw-rw-rw-
File Type                       : M2TS
File Type Extension             : mts
MIME Type                       : video/m2ts
Video Stream Type               : H.264 Video
Audio Stream Type               : A52/AC-3 Audio
Audio Bitrate                   : 256 kbps
Surround Mode                   : Not indicated
Audio Channels                  : 2
Image Width                     : 1920
Image Height                    : 1080
Date/Time Original              : 2018:05:17 18:53:37-05:00
Aperture Setting                : 2.4
Gain                            : 12 dB
Exposure Program                : Manual
White Balance                   : Auto
Image Stabilization             : n/a
Exposure Time                   : 1/50
Exposure Compensation           : 0
Focal Length In 35mm Format     : inf mm
Make                            : Panasonic
Warning                         : [minor] The ExtractEmbedded option may find more tags in the video data
Audio Sample Rate               : 48000
Duration                        : 0:04:16
Image Size                      : 1920x1080
Megapixels                      : 2.1
Shutter Speed                   : 1/50

okeetd

Nevermind - I think I actually figured it out.... this command is getting me close, I will mess around with it to get it in the exact date time format I need.

exiftool -ext mts "-FileName<DateTimeOriginal" -d "%Y%m%d_%H%M%S.%%e" "G:\Import Folder\TEST MTS"

StarGeek

Try adding -G1 (see -G (groupNames) option) to see what groups the tags belong to if you need more details.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).