GStreamer and Video Capture Device

1,137 views
Skip to first unread message

Brayden

unread,
Jun 14, 2010, 6:08:34 PM6/14/10
to gstreamer-java
I'm trying to build a program in Java using GStreamer to stream live
video from a CaptureDevice plugged in via USB. (Composite going into
capture device, into computer). I'm very new to GStreamer and not too
certain where to start with this. I don't really know what element to
use. I'm thinking I need to specify the CaptureDevice in:
Element videosrc = ElementFactory.make("CaptureDevice", "source");
Something like that? I don't know what the factory elements are. I
might be completely off. Any advice greatly appreciated.

Tal Shalif

unread,
Jun 15, 2010, 9:24:18 AM6/15/10
to gstream...@googlegroups.com
You need to know about Gstreamer and the pipeline elements before diving into gstreamer-java. I would advice to:
  1. Play with gst-launch, gst-inspect until you have a pipeline with does more-or-less what you want to acheive.
    Than you can return to gstreamer-java:
  2. My recommendation is to use Pipeline.launch() with exactly the same pipeline you used with gst-launch above and work from there.


--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group.
To post to this group, send email to gstream...@googlegroups.com.
To unsubscribe from this group, send email to gstreamer-jav...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gstreamer-java?hl=en.


Brayden

unread,
Jun 15, 2010, 4:04:35 PM6/15/10
to gstreamer-java
I've been messing with gst-launch in Windows and I can't even get it
to play a simple .mp4 file. Only think I can get working is
videotestsrc and audiotestsrc. Could someone help me out with a line
to open a .mp4 in Windows? It keeps saying "A C protocol source plugin
is required to play this stream, but not installed" but I have all the
plugins there are and the newest version of GStream installed
(0.10.6).
I'm using:
gst-launch playbin uri=C:/Users/username/pathtovideo.mp4
Any help?

On Jun 15, 7:24 am, Tal Shalif <tsha...@gmail.com> wrote:
> You need to know about Gstreamer and the pipeline elements before diving
> into gstreamer-java. I would advice to:
>
>    1. Play with gst-launch, gst-inspect until you have a pipeline with does
>    more-or-less what you want to acheive.
>    Than you can return to gstreamer-java:
>    2. My recommendation is to use Pipeline.launch() with exactly the same
>    pipeline you used with gst-launch above and work from there.
>
> On 15 June 2010 01:08, Brayden <brayden.ree...@gmail.com> wrote:
>
>
>
> > I'm trying to build a program in Java using GStreamer to stream live
> > video from a CaptureDevice plugged in via USB. (Composite going into
> > capture device, into computer). I'm very new to GStreamer and not too
> > certain where to start with this. I don't really know what element to
> > use. I'm thinking I need to specify the CaptureDevice in:
> > Element videosrc = ElementFactory.make("CaptureDevice", "source");
> > Something like that? I don't know what the factory elements are. I
> > might be completely off. Any advice greatly appreciated.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "gstreamer-java" group.
> > To post to this group, send email to gstream...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > gstreamer-jav...@googlegroups.com<gstreamer-java%2Bunsubscribe@go oglegroups.com>
> > .

Brayden

unread,
Jun 16, 2010, 3:39:41 PM6/16/10
to gstreamer-java
Nevermind... I just realized it was uri=file:///c:/users/etc
But now I'm having issues what what I really need GStreamer for. To
view the stream from a VC500 Video Capture device. It's plugged into a
USB port and capturing video via a composite connection. I'm having
issues figuring out which elements to use and how to build the stream.
From looking around I think I need ksvideosrc? But I'm not sure how to
direct it to the VC500, and then which sink to use to display it.
Again, any help is greatly appreciated. Or links to websites that
could help, I've read through tons myself.
Thanks.

Squiker

unread,
Jun 24, 2010, 6:27:36 AM6/24/10
to gstreamer-java
This stuff is very confusing especially if you do not know about the
basics and basic use of GStreamer (the underlying c framework) it
self.

Your best bet is to first look around the various examples etc about
GStreamer and the various phyton examples before diving in here.. I
also found that he following projects provide a great deal of insight
in to camera and capture devices:


WebCamStudio : http://www.ws4gl.org/
&& http://sourceforge.net/projects/webcamstudio/

The Processing GSVideo project : http://www.processing.org/
&& http://gsvideo.sourceforge.net/


Especially the Java sources of these two projects proved very useful
for me when dabbling around with capturing images of my webcam.


Just for the record. For capturing video you almost always use a v4l
(Video For Linux) or v4l2 (Video For Linux2) source..


Good luck!
Stefan.

Ismakun

unread,
Jul 9, 2010, 1:26:41 PM7/9/10
to gstreamer-java
Yeah just for starters check if your device is supported by V4L or
V4L2 drivers. I worked with this on a linux box with ubuntu. In order
to use the correct device in your pipeline you need to make sure first
that V4L2 suports your device and second you must point to the correct
device in the pipeline. Search in google how to look for your
connected devices in your current distro.

If you are in luck I may have some sample code that work for me on my
project. I'll post it later.

And yeah as other guys already posted first go to the shell and use
gst-launch a bit and learn about pipelines and the Gstreamer api. Then
work with this wrapper for Java.
> > > > >http://groups.google.com/group/gstreamer-java?hl=en.- Hide quoted text -
>
> - Show quoted text -

Patrick Balleux

unread,
Aug 9, 2010, 5:09:30 PM8/9/10
to gstreamer-java
As a quick pointer, look for the class
webcamstudio.sources.VideoSourceV4L, you will see how I capture from
the video device and manage to get the data to create an image...

Have fun!

Patrick
Reply all
Reply to author
Forward
0 new messages