From 5f00adbc77673a77ed66c711f75beab4ce3f928c Mon Sep 17 00:00:00 2001 From: Richard Boulton Date: Sat, 2 Mar 2002 16:24:00 +0000 Subject: [PATCH] Fix a small typo in gst-launch-ext. Original commit message from CVS: Fix a small typo in gst-launch-ext. Add gst-visualise, together with a manpage. --- tools/Makefile.am | 4 +-- tools/gst-launch-ext.1 | 2 +- tools/gst-visualise | 79 ++++++++++++++++++++++++++++++++++++++++++ tools/gst-visualise.1 | 35 +++++++++++++++++++ 4 files changed, 117 insertions(+), 3 deletions(-) create mode 100755 tools/gst-visualise create mode 100644 tools/gst-visualise.1 diff --git a/tools/Makefile.am b/tools/Makefile.am index 28ec5f0778..074a1e6f0c 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,5 +1,5 @@ -bin_SCRIPTS = gst-launch-ext +bin_SCRIPTS = gst-launch-ext gst-visualise -man_MANS = gst-launch-ext.1 +man_MANS = gst-launch-ext.1 gst-visualise.1 EXTRA_DIST = $(bin_SCRIPTS) $(man_MANS) diff --git a/tools/gst-launch-ext.1 b/tools/gst-launch-ext.1 index fece4f5576..6918f856e6 100644 --- a/tools/gst-launch-ext.1 +++ b/tools/gst-launch-ext.1 @@ -2,7 +2,7 @@ .SH "NAME" gst\-launch\-ext \- Run a predefined GStreamer pipeline .SH "SYNOPSIS" -\fBgst\-launch\-ext\fR \fI[OPTION...]\fR PIPELINE\-DESCRIPTION +\fBgst\-launch\-ext\fR \fIfilename [filename...]\fR .SH "DESCRIPTION" .LP \fIgst\-launch\-ext\fP is a tool that is used to run a basic predefined \fIGStreamer\fP pipeline. diff --git a/tools/gst-visualise b/tools/gst-visualise new file mode 100755 index 0000000000..b292dffbaf --- /dev/null +++ b/tools/gst-visualise @@ -0,0 +1,79 @@ +#!/usr/bin/perl -w + +# launch a gst-launch pipeline to display a visualisation of the +# input audio. +# make use of default input srcs. +# visualisation plugin is specified on command line. + +### packages + +use File::Basename; + + +my (%pipes, %cfg); + +sub read_config +{ + my $config_file = `echo -n ~`."/.gst"; + if (-e $config_file) + { + open CONFIG, $config_file; + while () + { + chomp; + s/#.*//; + s/\s+$//; + next unless length; + my ($var, $value) = split (/\s*=\s*/, $_, 2); + $cfg{$var} = $value; + } + if (!($cfg{AUDIOSRC})) + { + print "Please add an AUDIOSRC 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"; + } + if (!defined $cfg{AUDIOSRC}) { $cfg{AUDIOSRC} = "esdmon"; } + if (!defined $cfg{VIDEOSINK}) { $cfg{VIDEOSINK} = "sdlvideosink"; } + if (!defined $cfg{CVS_PATH}) { $cfg{CVS_PATH} = `echo -n ~`."/gst/cvs"; } +} + +sub visualise(@) +{ + my $vis = $cfg{VISUALIZER}; + $vis = shift() if ($#_ != -1); + $vis = "goom" unless $vis; + + my $pipe; + $pipe = $vis unless $pipe = $pipes{$vis}; + + $command = "gst-launch $cfg{AUDIOSRC} ! $pipe ! { queue ! colorspace ! $cfg{VIDEOSINK} }"; + print "Running $command\n"; + system ("PATH=\$PATH:".$cfg{CVS_PATH}."/gstreamer/tools $command"); +} + +### main + +read_config (); + +%pipes = ( + "goom", "goom", + "chart", "chart", + "synaesthesia", "synaesthesia", + "monoscope", "monoscope" +); + +if ($#ARGV > 0) { + print STDERR "Usage: gst-visualise [visualiser]\n"; + exit 1; +} + +visualise(@ARGV); + diff --git a/tools/gst-visualise.1 b/tools/gst-visualise.1 new file mode 100644 index 0000000000..f61446ece9 --- /dev/null +++ b/tools/gst-visualise.1 @@ -0,0 +1,35 @@ +.TH "GStreamer" "1" "February 2002" "" "" +.SH "NAME" +gst\-visualise \- Run a GStreamer pipeline to display an audio visualisation +.SH "SYNOPSIS" +\fBgst\-visualise\fR \fI[visualiser]\fR +.SH "DESCRIPTION" +.LP +\fIgst\-visualise\fP is a tool that is used to run a basic \fIGStreamer\fP pipeline, to display a graphical visualisation of an audio stream. + +By default, the audio stream is read from ESD (the Enlightened Sound Daemon), +but this can be changed by setting the AUDIOSRC parameter in ~/.gst. For +example, you might set "AUDIOSRC=osssrc" to display a visualisation of the +sound input to your soundcard. + +You can select a visualiser by providing a parameter naming the visualiser. +For example: + + gst\-visualise synaesthesia + +will use the synaesthesia plugin. If no visualiser is named, the VISUALIZER +property in ~/.gst will be used. If this is not specified either, the goom +visualiser will be used. + +The videosink to use to display the visualisation will be read from the +VIDEOSINK parameter in ~/.gst, defaulting to sdlvideosink. + +.SH "SEE ALSO" +.BR gst\-launch\-ext (1), +.BR gst\-guilaunch (1), +.BR gst\-complete (1), +.BR gst\-register (1), +.BR gst\-inspect (1), +.BR gst\-launch (1), +.SH "AUTHOR" +The GStreamer team at http://gstreamer.net/ -- 2.34.1