Monday, September 15, 2008

GStreamer pipeline description generator

rvtk-gst-pg is a GStreamer pipeline description generator that will be released togather with Rvtk 0.3. It is a GUI utility to generate GStreamer pipeline description for tools like gst-launch , ARToolkit-based applications , and any GStreamer based applications.

It is getting more number of applications use GStreamer for video playing. That include few webcam applications (e.g. Cheese) and computer vision software (e.g. Lasertraq). Although they are working fine , they usually lack a user interface to tune camera parameter. User may only use default camera parameter unless they know how to construct GStreamer pipeline description, which is too complicated for end-user.

Example of pipeline description:
# Capture image from a webcam with resolution of 320x240 and 30fps.

gst-launch-0.10 -v v4l2src name=source queue-size=2 ! video/x-raw-yuv,width=320,height=240,framerate=30/1 ! ffmpegcolorspace ! ximagesink

# Play a AVI file.
gst-launch-0.10 filesrc location=video.avi ! decodebin ! ffmpegcolorspace ! ximagesink
The usage of rvtk-gst-pg is quite similar to zenity. It will display few Gtk+ dialogs , and return the user input to standard output for shell scripting:

$ rvtk-gst-pg --help
Usage:
rvtk-gst-pg [OPTION...] [sink element]

Help Options:
-?, --help Show help options
--help-all Show all help options
--help-gtk Show GTK+ Options

Application Options:
-v, --var Export variable name
--display=DISPLAY X display to use
Example script: play video from webcam or local media by gst-launch:

PIPELINE=`rvtk-gst-pg xvimagesink`
if [ ! -z "$PIPELINE" ]
then
gst-launch $PIPELINE
fi
Firstly, it will prompt a dialog to ask for the location of media source. The first tab contains the detected capture device list , another tab shows a file selection browser to choose their local media file.



If a capture device is chosen , it will prompt another dialog for more options of capture device. That include the image format , resolution and FPS.


Finally , rvtk-gst-pg will print out the pipeline description according to the media chosen and the passed argument to standard output.

Example video : rvtk-gst-pd + levelhead



Although Rvtk 0.3 is not released yet , the source of rvtk-gst-pg is already available in Launchpad: https://code.launchpad.net/rvtk

1 comment:

Jose said...

Thanks so much for this post :D, i had a lot of problem setting the ARTOOLKIT_CONFIG variable with the correct value, but this works great for me :D

Sponsor