gstreamer/gst/audiovisualizers
Edward Hervey b78b980d72 Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	ext/faac/gstfaac.c
	ext/opus/gstopusdec.c
	ext/opus/gstopusenc.c
	gst/audiovisualizers/gstspacescope.c
	gst/colorspace/colorspace.c
2011-11-25 12:48:58 +01:00
..
gstbaseaudiovisualizer.c add parent to pad functions 2011-11-17 15:53:42 +01:00
gstbaseaudiovisualizer.h audiovisualizer: port to 0.11 2011-11-10 23:20:32 +02:00
gstdrawhelpers.h audiovisualizers: add aa-line code and user for wave/space-scope 2011-11-24 19:04:17 +01:00
gstspacescope.c Merge remote-tracking branch 'origin/master' into 0.11 2011-11-25 12:48:58 +01:00
gstspacescope.h spacescope: use the drawhelpers and add a draw-style property 2011-11-23 11:21:15 +01:00
gstspectrascope.c audiovisualizer: port to 0.11 2011-11-10 23:20:32 +02:00
gstspectrascope.h audiovisualizers: rename baseclass from basescope to baseaudiovisualizer 2011-06-06 15:25:14 +03:00
gstsynaescope.c audiovisualizer: port to 0.11 2011-11-10 23:20:32 +02:00
gstsynaescope.h audiovisualizers: rename baseclass from basescope to baseaudiovisualizer 2011-06-06 15:25:14 +03:00
gstwavescope.c Merge remote-tracking branch 'origin/master' into 0.11 2011-11-25 12:48:58 +01:00
gstwavescope.h wavescope: add a style property for drawing modes 2011-11-23 08:42:01 +01:00
Makefile.am Merge branch 'master' into 0.11 2011-11-23 11:08:39 +01:00
plugin.c controller: port to new controller location and api 2011-11-04 20:14:01 +01:00
README audiovisualizers: add aa-line code and user for wave/space-scope 2011-11-24 19:04:17 +01:00

A basclass for audiovisualizers. Takes care of re-fitting the audio-rate to
video-rate. It receives audio-data at the sampling-rate. It needs to render
video-frames at frame-rate. The rendering needs n audio samples (depends on
subclass). The baseclass takes care of that.

Some effects could be enhanced by running geometrictransform elements
afterwards. A blur and/or videozoom element would be great (vertigotv looks
great but has some negotiation issues).

= Feedback =
* put 'Audio' to klass as well ?

= API =

* we have a couple of drawing helpers in gstdrawhelpers.h
  (would be nice if we could use cairo) 
  draw_point (x,y,color);
  draw_line (x1,x2,y1,y2,color);
* some more we could add:
  draw_hline (x1,x2,y,color);
  draw_vline (x,y1,y2,color);
  draw_rect (x1,x2,y1,y2,color);
  draw_box (x1,x2,y1,y2,color); // filled
* shading effects
  - would be nice to use a generic 3x3 matrix operation, we don't run inplace
    anyway
  - this way we could also blur the background

= Elements to port =
gst-plugin-ugly/gst/synaestesia -> synaescope
gst-plugin-bad/gst/smoothwave -> wavescope
gst-plugin-good/gst/monoscope -> blend into what we have in wavescope

= Elements to add =
spectrascope - done
spacescope - stereo wavescope
- left->x, right->y - done
- polar mapping
multiscope :
- like wave/space scope, but run the signal through two filters to split it into
  bass, mid and high (200 Hz, 2000 Hz)
- draw 3 wave-scopes into red/gree/blue
- when drawing only draw that component to mix colors
- eventually use the spacescope-position to rotate/shift the wave

= TODO =
- element maker template
- test for baseclass

= Test it =

GST_DEBUG="*:2,*scope*:4"

GST_PLUGIN_PATH=$GST_PLUGIN_PATH:$PWD gst-inspect scopes

GST_PLUGIN_PATH=$GST_PLUGIN_PATH:$PWD gst-launch audiotestsrc ! audioconvert ! wavescope ! colorspace ! ximagesink
GST_PLUGIN_PATH=$GST_PLUGIN_PATH:$PWD gst-launch filesrc location=$HOME/Music/1.mp3 ! decodebin2 ! audioconvert ! wavescope ! colorspace ! ximagesink

GST_PLUGIN_PATH=$GST_PLUGIN_PATH:$PWD gst-launch filesrc location=$HOME/Music/1.mp3 ! decodebin2 ! audioconvert ! spacescope style=lines shade-amount=0x00080402 ! ximagesink
GST_PLUGIN_PATH=$GST_PLUGIN_PATH:$PWD gst-launch filesrc location=$HOME/Music/1.mp3 ! decodebin2 ! audioconvert ! spacescope style=lines shade-amount=0x00080402 ! vertigotv ! ximagesink

GST_PLUGIN_PATH=$GST_PLUGIN_PATH:$PWD gst-launch filesrc location=$HOME/Music/1.mp3 ! decodebin2 ! audioconvert ! spectrascope ! colorspace ! ximagesink
GST_PLUGIN_PATH=$GST_PLUGIN_PATH:$PWD gst-launch filesrc location=$HOME/Music/1.mp3 ! decodebin2 ! audioconvert ! spectrascope shader=fade-and-move-up shade-amount=0x00040302 ! colorspace ! ximagesink

GST_PLUGIN_PATH=$GST_PLUGIN_PATH:$PWD gst-launch filesrc location=$HOME/Music/1.mp3 ! decodebin2 ! tee name=t ! queue ! audioconvert ! synaesthesia ! ximagesink t. ! queue ! synaescope shade-amount=0x00040404 ! colorspace ! ximagesink