MOV, AVI and THM files

Started by Lplates, April 18, 2014, 02:44:25 PM

Previous topic - Next topic

Lplates

Hi,
I am using the excellent exiftool to organise my pics etc., now have them nearly all sorted :)
The problem is AVI / THM files.
MOV files and there accompanying THM file OK, in that both THM and MOV for the cameras I have contain the EXIF data I want :)
(Camera model/make and date created)
AVI files seem to be the problem in that the AVI does not have camera info, but THM does, so they go to separate folders
(I use config file below)
and sadly a lot of AVI's I have do not have a THM file at all :(
so I find I need to make a THM for each AVI and then (maybe in a 2nd pass) move them both to new folder structure
1) Generate THM from AVI file, camera model / make can be text (only had 2 Canon cameras, all AVI's I have are Canon)
    can get create date for THM from AVI ?
2) move AVI/THM to same folder, that is THM will have all info, the AVI will "follow" it

Have tried 1) a few times, just realised that -thumbnailimage may not work on AVI files!
sure 2) must be possible, but not sure how!

Thanks to all,
Dave.

#Start config file
-d
%Y-%m-%d\
-filename=E:\Misc\0000-00-00\%f%-c.%le
-filename<E:\Misc\${FileModifyDate;}\%f%-c.%le
-filename<E:\Misc\${DateTimeOriginal;}\%f%-c.%le
-filename<E:\Misc\${CreateDate;}\%f%-c.%le
-filename<E:\${Model;s\ +$\\g;}\${FileModifyDate;}\%f%-c.%le
-filename<E:\${Model;s\ +$\\g;}\${DateTimeOriginal;}\%f%-c.%le
-filename<E:\${Model;s\ +$\\g;}\${CreateDate;}\%f%-c.%le

Phil Harvey

#1
Hi Dave,

To clear up a potential misconception:  ExifTool only extracts existing metadata, so it will only extract ThumbnailImage if it exists as metadata in the file -- it can not be used go generate a new thumbnail image from the movie data.

But as long as you have a THM with the AVI, you handle them both like this (assuming the .THM files have a capitalized extension):

#Start config file
-ext
avi
-tagsfromfile
%d%f.THM
-d
%Y-%m-%d\
-filename=E:\Misc\0000-00-00\%f%-c.%le
-filename<E:\Misc\${FileModifyDate;}\%f%-c.%le
-filename<E:\Misc\${DateTimeOriginal;}\%f%-c.%le
-filename<E:\Misc\${CreateDate;}\%f%-c.%le
-filename<E:\${Model;s\ +$\\g;}\${FileModifyDate;}\%f%-c.%le
-filename<E:\${Model;s\ +$\\g;}\${DateTimeOriginal;}\%f%-c.%le
-filename<E:\${Model;s\ +$\\g;}\${CreateDate;}\%f%-c.%le
-execute
-ext
thm
-d
%Y-%m-%d\
-filename=E:\Misc\0000-00-00\%f%-c.%le
-filename<E:\Misc\${FileModifyDate;}\%f%-c.%le
-filename<E:\Misc\${DateTimeOriginal;}\%f%-c.%le
-filename<E:\Misc\${CreateDate;}\%f%-c.%le
-filename<E:\${Model;s\ +$\\g;}\${FileModifyDate;}\%f%-c.%le
-filename<E:\${Model;s\ +$\\g;}\${DateTimeOriginal;}\%f%-c.%le
-filename<E:\${Model;s\ +$\\g;}\${CreateDate;}\%f%-c.%le


So this only leaves the problem of creating the THM.  Once you have a THM image, you could use ExifTool to copy whatever metadata you want from the assocated AVI.

- Phil

Edit:  I forgot to mention that you need to add -common_args after all other arguments on the command line and before the file names with the above argfile.
...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 ($).

Lplates

Hi Phil,
Thanks for speedy reply :)
1) thought this might be the case (thumbnail from AVI) but wondered if I'd missed something!
2) do I need a thumbnail image to create a THM file ? (not sure many programs use THM files, but useful to store EXIF data for the AVI in...)
3) thanks for the config file, think I can see how it's supposed to work (getting tags from THM matching AVI name), though, of course not for me :)
    It copies all AVI's (those that have a THM file with them, but not the THM files themselves) to the default location, that is \Misc\0000-00-00 !
    I assume its probably because the tag data is not being used and I've put something in the wrong place but damned if I can see where its going wrong :(

The command line I am using is:
exiftool.exe -v -a -P -r -o .\Err\ -@ _CopyArgsAVI.txt -common_args e:\Pictures\ >& Errors.txt

and copyargsavi.txt is:
#Start config file
-ext
avi
-tagsfromfile
%d%f.THM
-d
%Y-%m-%d\
-filename=E:\PicsSortB\Misc\0000-00-00\%f%-c.%le
-filename<E:\PicsSortB\Misc\${FileModifyDate;}\%f%-c.%le
-filename<E:\PicsSortB\Misc\${DateTimeOriginal;}\%f%-c.%le
-filename<E:\PicsSortB\Misc\${CreateDate;}\%f%-c.%le
-filename<E:\PicsSortB\${Model;s\ +$\\g;}\${FileModifyDate;}\%f%-c.%le
-filename<E:\PicsSortB\${Model;s\ +$\\g;}\${DateTimeOriginal;}\%f%-c.%le
-filename<E:\PicsSortB\${Model;s\ +$\\g;}\${CreateDate;}\%f%-c.%le
-execute
-ext
thm
-d
%Y-%m-%d\
-filename=E:\PicsSortB\Misc\0000-00-00\%f%-c.%le
-filename<E:\PicsSortB\Misc\${FileModifyDate;}\%f%-c.%le
-filename<E:\PicsSortB\Misc\${DateTimeOriginal;}\%f%-c.%le
-filename<E:\PicsSortB\Misc\${CreateDate;}\%f%-c.%le
-filename<E:\PicsSortB\${Model;s\ +$\\g;}\${FileModifyDate;}\%f%-c.%le
-filename<E:\PicsSortB\${Model;s\ +$\\g;}\${DateTimeOriginal;}\%f%-c.%le
-filename<E:\PicsSortB\${Model;s\ +$\\g;}\${CreateDate;}\%f%-c.%le

Phil Harvey

Quote from: Lplates on April 19, 2014, 12:04:33 PM
    It copies all AVI's (those that have a THM file with them, but not the THM files themselves)

It should copy the THM files too.

Quoteto the default location, that is \Misc\0000-00-00 !
    I assume its probably because the tag data is not being used and I've put something in the wrong place but damned if I can see where its going wrong :(

I don't see anything wrong either.  Are there any errors/warnings?

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

Lplates

none that I can see, have copied first few lines from Errors.txt
no other o/p to screen :(

Writing File:FileName
======== e:/Pictures/Canon A710/2007_07_26/100_0019.AVI
Setting new values from e:/Pictures/Canon A710/2007_07_26/100_0019.THM
'e:/Pictures/Canon A710/2007_07_26/100_0019.AVI' --> 'E:/PicsSortB/Misc/0000-00-00/100_0019.avi'
Created directory E:/PicsSortB/Misc
Created directory E:/PicsSortB/Misc/0000-00-00
Rewriting e:/Pictures/Canon A710/2007_07_26/100_0019.AVI...
Nothing changed in e:/Pictures/Canon A710/2007_07_26/100_0019.AVI
======== e:/Pictures/Canon A710/2007_07_26/100_0020.AVI
Setting new values from e:/Pictures/Canon A710/2007_07_26/100_0020.THM
'e:/Pictures/Canon A710/2007_07_26/100_0020.AVI' --> 'E:/PicsSortB/Misc/0000-00-00/100_0020.avi'
Rewriting e:/Pictures/Canon A710/2007_07_26/100_0020.AVI...
Nothing changed in e:/Pictures/Canon A710/2007_07_26/100_0020.AVI
======== e:/Pictures/Canon A710/2007_07_26/100_0021.AVI
Setting new values from e:/Pictures/Canon A710/2007_07_26/100_0021.THM
'e:/Pictures/Canon A710/2007_07_26/100_0021.AVI' --> 'E:/PicsSortB/Misc/0000-00-00/100_0021.avi'
Rewriting e:/Pictures/Canon A710/2007_07_26/100_0021.AVI...
Nothing changed in e:/Pictures/Canon A710/2007_07_26/100_0021.AVI

Lplates

have attached, ok I hope, the exiftool output for the first THM file, looks ok to me...
but thought u might like a look at it!

Phil Harvey

Ah.  Right.  I should have read point 3 in FAQ 22.  Sorry.

The FileName assignment for the AVI files has to come before the -tagsFromFile option:

#Start config file
-ext
avi
-filename=E:\PicsSortB\Misc\0000-00-00\%f%-c.%le
-tagsfromfile
%d%f.THM
-d
%Y-%m-%d\
-filename<E:\PicsSortB\Misc\${FileModifyDate;}\%f%-c.%le
-filename<E:\PicsSortB\Misc\${DateTimeOriginal;}\%f%-c.%le
-filename<E:\PicsSortB\Misc\${CreateDate;}\%f%-c.%le
-filename<E:\PicsSortB\${Model;s\ +$\\g;}\${FileModifyDate;}\%f%-c.%le
-filename<E:\PicsSortB\${Model;s\ +$\\g;}\${DateTimeOriginal;}\%f%-c.%le
-filename<E:\PicsSortB\${Model;s\ +$\\g;}\${CreateDate;}\%f%-c.%le
-execute
-ext
thm
-d
%Y-%m-%d\
-filename=E:\PicsSortB\Misc\0000-00-00\%f%-c.%le
-filename<E:\PicsSortB\Misc\${FileModifyDate;}\%f%-c.%le
-filename<E:\PicsSortB\Misc\${DateTimeOriginal;}\%f%-c.%le
-filename<E:\PicsSortB\Misc\${CreateDate;}\%f%-c.%le
-filename<E:\PicsSortB\${Model;s\ +$\\g;}\${FileModifyDate;}\%f%-c.%le
-filename<E:\PicsSortB\${Model;s\ +$\\g;}\${DateTimeOriginal;}\%f%-c.%le
-filename<E:\PicsSortB\${Model;s\ +$\\g;}\${CreateDate;}\%f%-c.%le


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

Lplates

#7
No need for apologies, Think I might have read that myself in my travels around here!
that seems to have done the trick :)
Have just noticed that the avi's are copied to and the THM's are moved to correct place
assume common_args should apply to the -o option on cmd line?
thought they (thm) should be copied to!

Phil Harvey

Right.  In fact, you probably want most of the arguments to apply to both commands, so move them to after -common_args.

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

Lplates

That's done the job :)
thanks!

Much to my surprise, I find I have 400+ avi files (I think all the MOVS I have are Ok) without THM files :( so lots in the Misc folder!
spent a fair bit of time today looking for something to generate thms from avi, not much luck :(
I know exiftool can't get thumbs from avi's, but can exiftool generate a THM with no pic ?
If not, should I be able to use a blank pic jpg as thumb (just got to make one!) and get exiftool to put in the THM the createdate etc
would like to put in camera model / make as well, but have avi's from at least 3 different cameras! and just Misc...

excuse rambling, just noticed the Nikon S70 avi's seem to have make/model/createdate etc in the AVI, so that's 1 less camera, I wont need the THMs for them
that's now 200+ files, better already :)

Phil Harvey

Quote from: Lplates on April 21, 2014, 12:30:10 PM
If not, should I be able to use a blank pic jpg as thumb

That is probably the way to do it.

Quotejust noticed the Nikon S70 avi's seem to have make/model/createdate etc in the AVI

You will also find a ThumbnailImage embedded in the S70 AVI videos.

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