Hello, I need to play this line on gstreamer using c++:<br><br>filesrc location=Video2.avi ! decodebin2 name=dec ! queue ! ffmpegcolorspace ! autovideosink dec. ! queue ! audioconvert ! audioresample ! autoaudiosink<br><br>
This code does this:<br><br><i><font size="1"><span style="font-family: courier new,monospace;">#include <gst/gst.h></span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">int main(int argc, char *argv[])</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">{</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> char str [] = "filesrc location=Video2.avi ! decodebin2 name=dec ! \</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> queue ! ffmpegcolorspace ! autovideosink dec. ! \</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> queue ! audioconvert ! audioresample ! autoaudiosink";</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> GError *error = NULL;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> GstElement *element;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> gst_init (&argc, &argv);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> element = gst_parse_launch(str, &error);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> gst_element_set_state (element, GST_STATE_PLAYING);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> if (!element) {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> fprintf (stderr, "Parse error: %s\n", error->message);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> exit(1);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> while(1){}</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> return 1;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span></font></i><br><br>But I need to play this video on a texture, how do I bind the video with a texture in OpenGL, for example? I mean, I do not know how to access the stream, the code above plays on a window created by gstreamer.<br>
If I'm able to access the stream i'm able to bind it to OpenGL. I'd prefer to use no-specific OpenGL plugins since I do not know what rendering system I'm going to use.<br><br>Thanks a lot!<br><br>-- <br>Marlos Cholodovskis Machado<br>
<br><br><br>