Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Olivain <juju@cotds.org>
  • Loading branch information
jolivain committed Oct 10, 2016
1 parent d7c20df commit d4e33a8
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
23 changes: 23 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Copyright (c) 2015-2016, Julien Olivain <juju@cotds.org>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
78 changes: 78 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
gst-shadertoy
=============


Introduction
------------

gst-shadertoy is a set of scripts for reusing ShaderToy webcam shaders
in a GStreamer pipeline. This package does not include any GStreamer
plugin, it's only few scripts to download and convert ShaderToy
shaders, and then create a pipeline with already existing elements,
using gst-launch-1.0.

This package does not include or redistributes any shader. Instead,
shaders will downloaded from the user request. Please pay attention
to license and author credits while playing with those scripts.

ShaderToy WebCam shaders:
https://www.shadertoy.com/results?filter=webcam

GStreamer glshader element:
https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/ext/gl
https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/ext/gl/gstglfiltershader.c


Quick Demonstration
-------------------

Step 1: Make sure you have all required dependencies. For example, on
a Fedora system:

sudo dnf install \
make curl \
gstreamer1 \
gstreamer1-plugins-base \
gstreamer1-plugins-good \
gstreamer1-plugins-bad-free

Step 2: Download Shaders

make -j4

Step 3: Run a Shader on your WebCam, for example:

./gst-shadertoy-cam.sh Drunk.fs

Step 4: Run a Shader on a movie, for example:

Download a movie, for example "Big Buck Bunny" from:
https://peach.blender.org/download/

./gst-shadertoy-file.sh movie.mp4 Glitch.fs


Notes
-----

There is a slight difference on glshader element properties before
GStreamer 1.8.0 and after. Earlier version takes a shader file path.
Later version takes the shader content directly from the command line.
gst-shadertoy-cam.sh and gst-shadertoy-file.sh will detect your
version and try to execute the best pipeline.

Please note that depending on your GPU and driver, this GStreamer
pipeline could be very resource demanding. Video size can be reduce
by adding the following elements before the "glupload":

videoscale ! 'video/x-raw,width=128,height=96,framerate=30/1' ! \

Adjust dimensions and framerate to your needs.

Note also that "glimagesink" window may not always start every time on
some systems.

Those gst-shadertoy scripts are distributed under the 2 clause BSD
license. See the LICENSE file for details.

Julien Olivain <juju@cotds.org>

0 comments on commit d4e33a8

Please sign in to comment.