Find all mp4 files with create date = "0000:00:00 00:00:00"

Started by baumaeschi, June 28, 2023, 09:35:10 AM

Previous topic - Next topic

baumaeschi

Hi Phil
I want to recursively search in the directory "iPhone SE Susanne" for all mp4 files with createdate equal to 0000:00:00 00:00:00 and, if match, replace the createdate by the filemodifieydate. I know, it must be a ' " issue. But no combination of " and ' works. I'm working in the powershell of windows.2023-06-28_152945.jpg

exiftool -if "$createdate eq '0000:00:00 00:00:00'" "-createdate<filemodifydate" "iPhone SE Susanne"  -ext mp4 -r

  11 directories scanned
    3 files failed condition
    0 image files read

Any Idea whats going wrong?

Best regards
Martin

Phil Harvey

I don't know what software you are running in your screenshot.

Try using the command line and running ExifTool directly with this command to see the values of CreateDate:

exiftool -createdate "iPhone SE Susanne" -ext mp4 -r

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

wywh

These quotes work on macOS:

exiftool -a -G1 -s -api LargeFileSupport=1 -if '$CreateDate eq "0000:00:00 00:00:00"' -CreateDate .
======== ./2022-0104-1907-47.mp4
[QuickTime]     CreateDate                      : 0000:00:00 00:00:00
    1 directories scanned
    2 files failed condition
    1 image files read

Notice also that you might get different output depending on QuickTimeUTC setting also from such "timeless" movies (and also maybe depending location -- on 30 April 1921 at midnight, our official time was advanced 20 minutes and 10.9 seconds which apparently explains the weird times I tend to get before that). The default '-api QuickTimeUTC=0' seems best for this purpose (I wonder what date the other setting yields in Windows?). On macOS 13.4.1 I get:

exiftool -a -G1 -s -api LargeFileSupport=1 -api QuickTimeUTC=0 -CreateDate 2022-0104-1907-47.mp4 
[QuickTime]     CreateDate                      : 0000:00:00 00:00:00

exiftool -a -G1 -s -api LargeFileSupport=1 -api QuickTimeUTC=1 -CreateDate 2022-0104-1907-47.mp4   
[QuickTime]     CreateDate                      : 1904:01:01 01:39:49+01:39

- Matti

StarGeek

Quote from: baumaeschi on June 28, 2023, 09:35:10 AMI'm working in the powershell of windows.

You have to pay attention to the highlighting when using PowerShell.  The light green highlighting indicates that PS is reading CreateDate as a PowerShell variable, not a exiftool tag name


That said, as you can see by the second command, swapping the quotes as you would do on Mac/Linus doesn't work either.  Your first command works correctly in CMD.

PowerShell is a poor choice to use with exiftool because it has so many idiosyncrasies compared to other commands lines.
"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

baumaeschi

Thanks to all helping me with this issue

Actually, the hint of StarGeek was the solution.
Quote from: StarGeek on June 28, 2023, 11:43:19 AMPowerShell is a poor choice to use with exiftool because it has so many idiosyncrasies compared to other commands lines.
Yeees - it seems you are absolutely right!
Below are the outputs of Phil's and my own command in the Command Shell:
D:\Fotos\Fotos 20xx>
D:\Fotos\Fotos 20xx>exiftool -createdate "iPhone SE Susanne" -ext mp4 -r
======== iPhone SE Susanne/202305__/HBDS4181.MP4
Create Date                     : 2023:05:15 11:05:53
======== iPhone SE Susanne/202305__/VLXY5130.MP4
Create Date                     : 0000:00:00 00:00:00
======== iPhone SE Susanne/202305__/VYCC2603.MP4
Create Date                     : 0000:00:00 00:00:00
   11 directories scanned
    3 image files read

D:\Fotos\Fotos 20xx>exiftool -if "$createdate eq '0000:00:00 00:00:00'" "-createdate<filemodifydate" "iPhone SE Susanne"  -ext mp4 -r
   11 directories scanned
    1 files failed condition
    2 image files updated

D:\Fotos\Fotos 20xx>exiftool -createdate "iPhone SE Susanne" -ext mp4 -r
======== iPhone SE Susanne/202305__/HBDS4181.MP4
Create Date                     : 2023:05:15 11:05:53
======== iPhone SE Susanne/202305__/VLXY5130.MP4
Create Date                     : 2023:06:10 17:42:15+02:00
======== iPhone SE Susanne/202305__/VYCC2603.MP4
Create Date                     : 2023:05:22 14:57:01+02:00
   11 directories scanned
    3 image files read
For Phil: The Software I was running for the screenshot was Exif Tool GUI. I'm using it still a lot for the inspection of tags in media files.

simonmcnair

Quote from: StarGeek on June 28, 2023, 11:43:19 AMPowerShell is a poor choice to use with exiftool because it has so many idiosyncrasies compared to other commands lines.
As an ardent user of Microsoft for the past 20 year, I honestly believe that powershell is a poor choice to use with anything unless you have to.  For me it breaks all too often, is hard to debug and is the worst thing since cod liver oil.
Just my 2p though.