Author Topic: ExifTool - how to speedup lookups in video files  (Read 218 times)

redtux

  • Newbie
  • *
  • Posts: 1
ExifTool - how to speedup lookups in video files
« on: June 08, 2020, 09:09:03 AM »
Hi
Are there any ways to speed up how long it takes to process reading loads of meia files.
With a base number of around 30000 files Image::Exiftool takes around 35 minutes.

I have tried using Parrallel, but it runs sequentially due to waiting for IO (all processes spawned bar 1 have status of D+, ie: uninterruptable sleep probably io from man page of ps)
code

DB lookup for list of files
Code: [Select]
my $list=$dbh->selectall_arrayref('SELECT DISTINCT tagfile
FROM tagfile ');

use Image::ExifTool;
my $exifTool = new Image::ExifTool;
my @tags=(qw/Artist Title TVShow Album Genre Year ImageWidth AvgBitrate AverageBitRate FileType FileSize Filename/); # this takessame time as no tags defined
$exifTool->Options(FastScan => 2);

foreach my $l (@{$list}){
my $tagsr=$exifTool->ImageInfo($l,@tags);
}

Any tips appreciated

Mike

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16879
    • ExifTool Home Page
Re: ExifTool - how to speedup lookups in video files
« Reply #1 on: June 08, 2020, 09:08:31 PM »
Hi Mike,

Yes, the ExifTool API is not designed for parallel processing.  The only option I could see would be to spawn multiple Perl processes.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).