Hello, I need to play this line on gstreamer using c++:
filesrc location=Video2.avi ! decodebin2 name=dec ! queue ! ffmpegcolorspace ! autovideosink dec. ! queue ! audioconvert ! audioresample ! autoaudiosink This code does this: #include <gst/gst.h> int main(int argc, char *argv[]) { char str [] = "filesrc location=Video2.avi ! decodebin2 name=dec ! \ queue ! ffmpegcolorspace ! autovideosink dec. ! \ queue ! audioconvert ! audioresample ! autoaudiosink"; GError *error = NULL; GstElement *element; gst_init (&argc, &argv); element = gst_parse_launch(str, &error); gst_element_set_state (element, GST_STATE_PLAYING); if (!element) { fprintf (stderr, "Parse error: %s\n", error->message); exit(1); } while(1){} return 1; } 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. 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. Thanks a lot! -- Marlos Cholodovskis Machado ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Hi,
> 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. > 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. The short answer is: you can take a look at appsink or fakesink elements. The more detailed answer to the similar question could be found here: Q: http://comments.gmane.org/gmane.comp.video.gstreamer.devel/31397 A: http://permalink.gmane.org/gmane.comp.video.gstreamer.devel/31400 Regards, Andrey. P.S. while(1) {} is going to eat 100% CPU time :-) ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Okay, I'm going to read this information, thanks a lot...
The while(1) is just a test =P... Thanks anyway... 2010/10/22 Andrey Nechypurenko <[hidden email]> Hi, -- Marlos Cholodovskis Machado ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by Marlos C. Machado-2
Am 22.10.2010 20:56, schrieb Marlos C. Machado:
> Hello, I need to play this line on gstreamer using c++: > > filesrc location=Video2.avi ! decodebin2 name=dec ! queue ! ffmpegcolorspace ! > autovideosink dec. ! queue ! audioconvert ! audioresample ! autoaudiosink > > This code does this: > > /#include <gst/gst.h> > > int main(int argc, char *argv[]) > { > char str [] = "filesrc location=Video2.avi ! decodebin2 name=dec ! \ > queue ! ffmpegcolorspace ! autovideosink dec. ! \ > queue ! audioconvert ! audioresample ! autoaudiosink"; > GError *error = NULL; > GstElement *element; > > gst_init (&argc, &argv); > element = gst_parse_launch(str, &error); > > gst_element_set_state (element, GST_STATE_PLAYING); > > if (!element) { > fprintf (stderr, "Parse error: %s\n", error->message); > exit(1); > } > > while(1){} > > return 1; > }/ > > 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. > 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. You will need to write a video-sink for your rendering system. Why: 1.) if you just take out the frame and render it from your app, you kill/harm A/V sink, as GSTreamer does not know when you actualy render. 2.) taking out the frame will introduce memory copies, you can't make the decoder decoding into the final surface anymore. If all that is not an issue in your case, using appsink is okay. Stefan > > Thanks a lot! > > -- > Marlos Cholodovskis Machado > > > > > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > > > > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |