3 # launch a gst-launch pipeline for the supplied media file
4 # use the extension to determine the gst-launch pipeline
5 # make use of default output sinks
16 my $ext = (fileparse ($path, '\..*?'))[2];
23 my $config_file = `echo -n ~`."/.gst";
26 open CONFIG, $config_file;
33 my ($var, $value) = split (/\s*=\s*/, $_, 2);
36 if (!($cfg{AUDIOSINK}))
38 print "Please add an AUDIOSINK to $config_file !\n";
40 if (!($cfg{VIDEOSINK}))
42 print "Please add a VIDEOSINK to $config_file !\n";
47 print "No configuration file $config_file found. You might want to create one.\n";
49 if (!defined $cfg{AUDIOSINK}) { $cfg{AUDIOSINK} = "osssink"; }
50 if (!defined $cfg{VIDEOSINK}) { $cfg{VIDEOSINK} = "xvideosink"; }
51 if (!defined $cfg{CVS_PATH}) { $cfg{CVS_PATH} = `echo -n ~`."/gst/cvs"; }
56 my ($file, $ext) = @_;
60 if ($cfg{VISUALIZER} && ($pipe = $pipes{"vis." . $ext}))
62 $command = "gst-launch filesrc location=\"$file\" ! $pipe";
63 print "Running $command\n";
64 system ("PATH=\$PATH:".$cfg{CVS_PATH}."/gstreamer/tools $command");
66 elsif ($pipe = $pipes{$ext})
68 $command = "gst-launch filesrc location=\"$file\" ! $pipe";
69 print "Running $command\n";
70 system ("PATH=\$PATH:".$cfg{CVS_PATH}."/gstreamer/tools $command");
74 print "No suitable pipe found for extension $ext.\n";
82 ### "ac3", "ac3parse ! $cfg{AUDIOSINK}",
84 "au", "auparse ! $cfg{AUDIOSINK}",
85 "avi", "avidemux video_%02d! { queue ! windec ! $cfg{VIDEOSINK} } avidemux0.audio_%02d! { queue ! mad ! $cfg{AUDIOSINK} }",
86 "fli", "flxdec ! colorspace ! $cfg{VIDEOSINK}",
87 "mod", "modplug ! $cfg{AUDIOSINK}",
88 "mp3", "mad ! $cfg{AUDIOSINK}",
89 "mpg", "mpegdemux video_%02d! { queue ! mpeg2dec ! $cfg{VIDEOSINK} } mpegdemux0.audio_%02d! { queue ! mad ! $cfg{AUDIOSINK} }",
90 "ogg", "vorbisdec ! $cfg{AUDIOSINK}",
91 "sid", "siddec ! $cfg{AUDIOSINK}",
92 "vob", "mpegdemux video_%02d! { queue ! mpeg2dec ! $cfg{VIDEOSINK} } mpegdemux0.private_stream_1_%02d! { queue ! a52dec ! $cfg{AUDIOSINK} }",
95 if ($cfg{VISUALIZER}) {
98 "vis.mp3", "mad ! tee silent=true 'tee1.src0!' queue leaky=1 ! { $cfg{VISUALIZER} ! colorspace ! $cfg{VIDEOSINK} } 'tee1.src1!' $cfg{AUDIOSINK}",
99 "vis.ogg", "vorbisdec ! tee silent=true 'tee1.src0!' queue leaky=1 ! { $cfg{VISUALIZER} ! colorspace ! $cfg{VIDEOSINK} } 'tee1.src1!' $cfg{AUDIOSINK}",
100 "vis.wav", "wavparse ! tee silent=true 'tee1.src0!' queue leaky=1 ! { $cfg{VISUALIZER} ! colorspace ! $cfg{VIDEOSINK} } 'tee1.src1!' $cfg{AUDIOSINK}",
105 print STDERR "Usage: gst-launch-ext filename[s]\n";
110 while ($file = shift @ARGV) {
111 my $ext = extension ($file);
114 open (PLAYLIST, '<', $file);
116 while ($file2 = <PLAYLIST>) {
118 my $ext2 = extension ($file2);
119 playfile($file2, $ext2);
123 playfile($file, $ext);