mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
gst-launch-ext
Original commit message from CVS: gst-launch-ext
This commit is contained in:
parent
ec911acfec
commit
2114eaf1f4
3 changed files with 55 additions and 15 deletions
|
@ -844,6 +844,7 @@ gst-libs/gst/resample/Makefile
|
||||||
gst-libs/gst/riff/Makefile
|
gst-libs/gst/riff/Makefile
|
||||||
examples/capsfilter/Makefile
|
examples/capsfilter/Makefile
|
||||||
examples/Makefile
|
examples/Makefile
|
||||||
|
tools/Makefile
|
||||||
)
|
)
|
||||||
|
|
||||||
echo -e "configure: *** Plugins that will be built : $GST_PLUGINS_YES"
|
echo -e "configure: *** Plugins that will be built : $GST_PLUGINS_YES"
|
||||||
|
|
|
@ -17,7 +17,7 @@ Prefix: %prefix
|
||||||
Requires: libxml2 >= 2.4.0
|
Requires: libxml2 >= 2.4.0
|
||||||
Requires: gstreamer >= %{ver}
|
Requires: gstreamer >= %{ver}
|
||||||
BuildRequires: nasm => 0.90
|
BuildRequires: nasm => 0.90
|
||||||
BuildRequires: gstreamer-devel > 0.3.0
|
BuildRequires: gstreamer-devel >= %{ver}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
GStreamer is a streaming-media framework, based on graphs of filters which
|
GStreamer is a streaming-media framework, based on graphs of filters which
|
||||||
|
@ -30,7 +30,7 @@ plugins.
|
||||||
%files
|
%files
|
||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
%doc AUTHORS COPYING README
|
%doc AUTHORS COPYING README
|
||||||
|
%{_bindir}/gst-launch-ext
|
||||||
%prep
|
%prep
|
||||||
%setup
|
%setup
|
||||||
%build
|
%build
|
||||||
|
|
|
@ -8,19 +8,7 @@
|
||||||
|
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
|
|
||||||
### defaults
|
|
||||||
my $VIDEOSINK = "xvideosink";
|
|
||||||
my $AUDIOSINK = "osssink";
|
|
||||||
my $GST_CVS_PATH = "~/gst/cvs";
|
|
||||||
|
|
||||||
my %pipes = (
|
|
||||||
"mp3", "mad ! $AUDIOSINK",
|
|
||||||
"ogg", "vorbisdec ! $AUDIOSINK",
|
|
||||||
"mpg", "mpegdemux video_00! { queue ! mpeg2dec ! $VIDEOSINK } audio_00! { queue ! mad ! $AUDIOSINK }",
|
|
||||||
"avi", "avidemux video_00! { queue ! windec ! $VIDEOSINK }",
|
|
||||||
"vob", "mpegdemux video_00! { queue ! mpeg2dec ! $VIDEOSINK }",
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
sub extension
|
sub extension
|
||||||
{
|
{
|
||||||
|
@ -30,15 +18,66 @@ sub extension
|
||||||
return $ext;
|
return $ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub read_config
|
||||||
|
{
|
||||||
|
my $config_file = "~/.gst";
|
||||||
|
if (-e $config_file)
|
||||||
|
{
|
||||||
|
open CONFIG, $config_file;
|
||||||
|
while (<CONFIG>)
|
||||||
|
{
|
||||||
|
chomp;
|
||||||
|
s/#.*//;
|
||||||
|
s/\s+$//;
|
||||||
|
next unless length;
|
||||||
|
my ($var, $value) = split (/\s*=\s*/, $_, 2);
|
||||||
|
$cfg{$var} = $value;
|
||||||
|
}
|
||||||
|
if (!($cfg{AUDIOSINK}))
|
||||||
|
{
|
||||||
|
print "Please add an AUDIOSINK to $config_file !\n";
|
||||||
|
}
|
||||||
|
if (!($cfg{VIDEOSINK}))
|
||||||
|
{
|
||||||
|
print "Please add a VIDEOSINK to $config_file !\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "No configuration file $config_file found. You might want to create one.\n";
|
||||||
|
$cfg{AUDIOSINK} = "osssink";
|
||||||
|
$cfg{VIDEOSINK} = "xvideosink";
|
||||||
|
$cfg{CVS_PATH} = "~/gst/cvs";
|
||||||
|
}
|
||||||
|
|
||||||
|
# check for gst-launch in cvs dir
|
||||||
|
$GST_LAUNCH=$cfg{CVS_PATH}."/gstreamer/tools/gst-launch";
|
||||||
|
if (! -x $GST_LAUNCH)
|
||||||
|
{
|
||||||
|
# let's hope it's installed ...
|
||||||
|
$GST_LAUNCH="gst-launch";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
### main
|
### main
|
||||||
|
|
||||||
|
read_config ();
|
||||||
|
|
||||||
|
my %pipes = (
|
||||||
|
"mp3", "mad ! $cfg{AUDIOSINK}",
|
||||||
|
"ogg", "vorbisdec ! $cfg{AUDIOSINK}",
|
||||||
|
"mpg", "mpegdemux video_00! { queue ! mpeg2dec ! $cfg{VIDEOSINK} } audio_00! { queue ! mad ! $cfg{AUDIOSINK} }",
|
||||||
|
"avi", "avidemux video_00! { queue ! windec ! $cfg{VIDEOSINK} }",
|
||||||
|
"vob", "mpegdemux video_00! { queue ! mpeg2dec ! $cfg{VIDEOSINK} }",
|
||||||
|
|
||||||
|
);
|
||||||
my $file = shift @ARGV or die "Please give a file name !";
|
my $file = shift @ARGV or die "Please give a file name !";
|
||||||
|
|
||||||
my $ext = extension ($file);
|
my $ext = extension ($file);
|
||||||
|
|
||||||
if ($pipe = $pipes{$ext})
|
if ($pipe = $pipes{$ext})
|
||||||
{
|
{
|
||||||
$command = "$GST_CVS_PATH/gstreamer/tools/gst-launch filesrc location=\"$file\" ! $pipe";
|
$command = "$GST_LAUNCH filesrc location=\"$file\" ! $pipe";
|
||||||
print "Running $command\n";
|
print "Running $command\n";
|
||||||
system ($command);
|
system ($command);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue