I'm using the configuration file to concatenate or modify some data.
Sometimes I get variables format changed like in this portion of configuration:
TestVideo => {
Require => {
0 => 'FileSize',
1 => 'MediaDuration',
2 => 'VideoFrameRate',
3 => 'FileType',
},
ValueConv => q{
my $size = $val[0];
my $duration = $val[1];
my $fps = $val[2];
my $filetype = $val[3];
my $attr = 'file_size='.$size.','.'duration='.$duration.','.'frame_rate='.$fps.','.'file_type='.$filetype.'';
return $attr;
},
},
and I get this:
$ exiftool -config ~/.exiftool-catalogo-config.py -ver -FileSize -MediaDuration -VideoFrameRate -FileType -TestVideo test.mp4
10.63
File Size : 11 MB
Media Duration : 0:00:36
Media Duration : 0:00:36
Video Frame Rate : 59.94
File Type : MP4
Test Video : file_size=11391052,duration=36.9535833333333,frame_rate=59.9400599400599,file_type=MP4
Why value like File Size, Media Duration and Video Frame Rate are represented in another format? Can I keep the original one?
Actually, these are in the original format. Normally exiftool is nice enough to convert them to a more readable format for you.
I believe that you want to use $prt instead of $val to get readable versions. So try this in your code:
my $size = $prt[0];
ny $duration = $prt[1];
my $fps = $prt[2];
Quote from: StarGeek on October 05, 2017, 05:27:24 PMI believe that you want to use $prt instead of $val
It work, thanks :)
$ exiftool -config ~/.exiftool-catalogo-config.py -ver -FileSize -MediaDuration -VideoFrameRate -FileType -TestVideo test.mp4
10.63
File Size : 11 MB
Media Duration : 0:00:36
Media Duration : 0:00:36
Video Frame Rate : 59.94
File Type : MP4
Test Video : file_size=11 MB,duration=0:00:36,frame_rate=59.94,file_type=MP4