GStreamer 1.2.1, vs2013, cinder 0.8.5 and a 'hello world'
Lasse Laursen
gazoo at 42.dk
Mon Nov 25 03:30:21 PST 2013
Hey,
I've posted a bit previously about intentions of using GStreamer for
streaming some video to an OpenGL texture. It resulted in a drawn out
period of development where I spent about 2-3 weeks scrambling trying to
recompile this and that and using all sorts of tools. Sufficed to say -
it's taking me too long to figure out how to do that, so I'm forced to
try a much, much simpler approach, just to get something simple working.
Essentially I'm just content with getting a set of raw frames out of a
video using gstreamer and putting these in memory for my own use. I know
that can easily ballon to several hundred megs, but I'm content with
restricting myself to smaller film clips.
So I grabbed the latest releases of gstreamer 1.2.1 and got to work
compiling the following simple 'hello world' example:
void VideoMaster::gstTesting3()
{
GstElement *pipeline;
GstBus *bus;
GstMessage *msg;
/* Initialize GStreamer */
gst_init( NULL, NULL );
/* Build the pipeline */
pipeline = gst_parse_launch("playbin
uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
/* Start playing */
gst_element_set_state(pipeline, GST_STATE_PLAYING);
/* Wait until error or EOS */
bus = gst_element_get_bus(pipeline);
msg = gst_bus_timed_pop_filtered(bus, GST_CLOCK_TIME_NONE,
(GstMessageType) (GST_MESSAGE_ERROR | GST_MESSAGE_EOS));
/* Free resources */
if (msg != NULL)
gst_message_unref(msg);
gst_object_unref(bus);
gst_element_set_state(pipeline, GST_STATE_NULL);
gst_object_unref(pipeline);
//return 0;
}
So - if I run the command 'playbin
uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm' straight
from the command line gst-launch-1.0.exe, then things work out fine more
or less. However, in my cinder application I get a big fat nothing.
I'm assuming this may have something to do with the fact that Cinder
creates its own personal OpenGL rendering context and this simple 'hello
world' example tries to create it's own rendering window which somehow
creates trouble?
I am a bit puzzled though as the pipeline object itself just becomes a
NULL object. Perhaps that's normal behavior if something goes wrong?
While I'm on a roll here - I was also wondering if someone could point
me in the direction of what I should be looking at if I'm interested in
letting the program open any video file gStreamer can handle, and
putting them into a sink that allows me to extract raw single frame data?
Regards,
Gazoo
More information about the gstreamer-devel
mailing list