Advertisement
mikelieman

iclips - loop-sources.pl

May 21st, 2011
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.54 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use strict;
  4. use warnings;
  5.  
  6. while (1) {
  7.  
  8.     foreach my $nbr qw( 001 002 ) {
  9.  
  10.         my ($file) = glob("tmp-iclips-$nbr-*.avi");
  11.  
  12.         if ( not $file ) {
  13.             print "Waiting for a file to play to become available\n";
  14.             next;
  15.         }    # if not file
  16.  
  17.         my $cmd =
  18.             "/usr/local/bin/mplayer -ss "
  19.           . ( time - substr( $file, 15, 10 ) - 1 )
  20.           . " -ao oss -vo xv -nofs -nocache $file";
  21.  
  22.         qx{$cmd};
  23.  
  24.     };    # foreach
  25.  
  26.     sleep 1;
  27.  
  28. };    # while
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement