Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use File::Basename;
- $path = "/home/pi/wd/Shared Videos/TV/\@midnight/";
- $start_time = "00:00:05.0"; #hh:mm:ss.0
- $duration = "10"; #in seconds
- opendir(DIR,$path) or die("Cannot open directory");
- @files = grep(/^*\.(mkv|mp4)/i, readdir(DIR));
- foreach $file (@files)
- {
- my $filename = fileparse($file, '\.[^\.]*');
- system("ffmpeg -i " . $file . " -ss " . $start_time . " -vf fps=1 -t " . $duration . " " . $filename . "_%03d.png");
- print("Created thumbnail for " . $file . "\r\n");
- }
- closedir(DIR);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement