I found this page via google and it was very helpful. In the hopes that my additions to what I found here will be helpful to others, I'm posting my mods here.
The improvements are to handle H.265 files out of my Panasonic TS3. I had a heck of a time figuring out the fact that the Make was a number and what it meant.
I also want to use a smaller abbreviation for the Model, and I want either 1) the Canon File Number, or a 2) Sequence Number.
First, the command line I use:
exiftool \
-ext '*' --ext avi \
-r \
-d %Y%m%d-%H%M-%S \
'-filename<${DateTimeOriginal}${MyFileNumber}-${MyModel}.%e' \
.
The entirety of my .ExifTool_config file:
%Image::ExifTool::UserDefined = (
'Image::ExifTool::Composite' => {
MyModel => { # Abbreviate the model number for inclusion into filename
Desire => {
0 => 'Model',
# always exists, AFAIK:
1 => 'Make',
},
ValueConv => q{
my $name;
$name = defined $val[0] ? "$val[0]" : "$val[1]";
# H.264 videos have numeric Make
# Numeric values are from:
# http://owl.phy.queensu.ca/~phil/exiftool/TagNames/H264.html
if ($name =~ /^\d+$/) {
return "Pana-H264" if $name == 0x103;
return "Sony-H264" if $name == 0x108;
return "Canon-H264" if $name == 0x1011;
return "UNKNOWN-H264-VALUE:$name";
}
# Phones:
$name =~ s{Galaxy Nexus}{GN};
# Canon: ORDER IS IMPORTANT!
$name =~ s{Canon EOS 5D Mark III}{5D3};
$name =~ s{Canon EOS 5D Mark II}{5D2};
$name =~ s{Canon EOS 7D}{7D};
# Panasonic, remove DMC- prefix, leave rest.
$name =~ s{DMC-}{};
return "$name";
},
},
# Would it be better to key on Make?????
MyFileNumber => {
Desire => {
# Canon. Example: "100-3504".
0 => 'FileNumber',
# Panasonic. Usually 0.
1 => 'SequenceNumber',
# dummy value that must exist and is ignored.
2 => 'Make',
},
ValueConv => q{
if (defined $val[0]) {
# probably Canon, look for "100-" and remove it
my $fn = $val[0];
$fn =~ s{^100-}{};
return "-$fn";
}
return "$val[1]" if defined($val[1]);
return 0;
},
PrintConv => 'sprintf("%02s",$val)',
},
},
);
1; #end
This thread really helped me, so I hope it helps others...