4 # Date : created 2001-07-24
5 # Author : Felix Buenemann <atmosfear at users.sourceforge.net>
6 # Idea by : David Chan <prometheus at theendofthetunnel.org>
7 # License : GNU General Public License (GPL)
8 # (refer to: http://www.fsf.org/licenses/gpl.txt)
11 # Small Perl helper script that allows to play multiple files with MPlayer.
12 # Wildcards are supported (eg. "mp.pl -vo x11 /data/*.avi").
15 # If MPlayer is not in your path, give the full
16 # path to mplayer binary in the line below.
17 # (example: "/usr/local/bin/mplayer")
18 use constant MPLAYER
=> "mplayer";
23 "mp.pl: No parameters given!
25 MPlayer multifile playback helper script 0.9
26 Copyleft 2001 by Felix Buenemann
28 Syntax: mp.pl <parameters> <files>
30 Where <parameters> are all possible commandline switches for mplayer and
31 <files> can be either a list of files, like file1 file2 file3 and/or a
32 wildcard definition, like *.avi.
34 Example: mp.pl -vo x11 /dvd/VIDEO_TS/VTS_05_*.VOB movie.asf
36 if ($#ARGV < 0) || ($ARGV[0] =~ m/^--*(h|help)/);
39 if(m/^-\w+/) { push @parms, $_ }
40 elsif(-f
$_ && -r _
&& -B _
) { push @files, $_ }
41 else { push @parms, $_ }
43 die "No valid files to process!\n" unless @files;
45 print "Invoking MPlayer for '$_'...\n";
46 system(MPLAYER
, @parms, $_)
47 or die "Couldn't execute MPlayer: $!\n";
49 and die "Couldn't properly execute MPlayer, aborting!\n";