mikelieman icon

iclips - loop-sources.pl

mikelieman | PRO | 05/21/11 02:56:32 PM UTC | 0 ⭐ | 836 👁️ | Never ⏰ | []
Perl |

540 B

|

None

|

0 👍

/

0 👎

#!/usr/bin/perl
 
use strict;
use warnings;
 
while (1) {
 
    foreach my $nbr qw( 001 002 ) {
 
        my ($file) = glob("tmp-iclips-$nbr-*.avi");
 
        if ( not $file ) {
            print "Waiting for a file to play to become available\n";
            next;
        }    # if not file
 
        my $cmd =
            "/usr/local/bin/mplayer -ss "
          . ( time - substr( $file, 15, 10 ) - 1 )
          . " -ao oss -vo xv -nofs -nocache $file";
 
        qx{$cmd};
 
    };    # foreach
 
    sleep 1;
 
};    # while

Comments