hi
I am Palak Dalal - IIT Bombay first year student of Computer Science B.Tech. I am thinking about doing a project on reading digits on licence plate of cars from a picture of the car. I have done considerable research on this project which involves both image processing and optical character recognition. Please let me know if you are interested in this project or any other requirements i need to fulfill. Thank You Palak Dalal ------------------------------------------------------------------------------ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Hello everyone,
I am trying to code get video frames from gstreamer pipeline, so I can do additional processing with them and draw each frame on screen via Irrlicht engine. I was able to do it using ffmpeg, but I am not able to get this done in gstreamer. The problem I am facing (and I am sure that this problem is very trivial) is that I cannot find a way how to get each (video)frame from gstreamer pipeline. Nevertheless, I found two ways, how this could be done. The first is use of appsink, and the second is to write my own (video)sink. Unfortunately, I was not able to do it in neither way, mainly due to the lack of example code, or my poor experience with gstreamer. So, my question is, which way should I go (use appsink, or extend (video)sink) and where to start with learning of how to accomplish this. Thanks in advance, Stepan ------------------------------------------------------------------------------ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
On Sun, 2009-03-29 at 23:02 +0200, Štěpán wrote:
> I am trying to code get video frames from gstreamer pipeline, so I > can do additional processing with them and draw each frame on screen via > Irrlicht engine. I was able to do it using ffmpeg, but I am not able to > get this done in gstreamer. The problem I am facing (and I am sure that > this problem is very trivial) is that I cannot find a way how to get > each (video)frame from gstreamer pipeline. > Nevertheless, I found two ways, how this could be done. The first is use > of appsink, and the second is to write my own (video)sink. These are both good methods. There is also gdkpixbufsink which essentially gives you RGB data (in a GdkPixbuf structure), and then there is also the possibility to just use fakesink and the "handoff" signal (but that's been replaced by appsink really). > Unfortunately, I was not able to do it in neither way, mainly due to the > lack of example code, or my poor experience with gstreamer. So, my > question is, which way should I go (use appsink, or extend (video)sink) > and where to start with learning of how to accomplish this. Here's a simple example demonstrating how to extract raw RGB video frames with appsink: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/tests/examples/snapshot/snapshot.c Hope this helps. Cheers -Tim ------------------------------------------------------------------------------ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Hi,
> there is also the possibility to just use fakesink and the "handoff" > signal (but that's been replaced by appsink really). I still find fakesink quite handy for python development, is there a way to use appsink in python ? Florent ------------------------------------------------------------------------------ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by Štěpán Rezek
There are more appsink examples here:
http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/tests/examples/app Rgds, - PABLO - On Sun, Mar 29, 2009 at 11:02 PM, Štěpán <[hidden email]> wrote: Hello everyone, ------------------------------------------------------------------------------ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
HI, You might also want to have a look at http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/tests/examples/snapshot The example there shows how to get a frame
and dump it as a png image. Cheers Karthik From: Pablo!
[mailto:[hidden email]] There are more appsink
examples here: On Sun, Mar 29, 2009 at 11:02 PM, Štěpán Hello everyone, IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. ------------------------------------------------------------------------------ This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by Tim-Philipp Müller-2
Hi,
thanks for your example, it helped me a lot. In fact, it nearly works already for me (I'll post the sourcecode when I am finished), but I have one slight problem - I cannot resize the video during playback. The important parts of code I am using are: #define CAPS "video/x-raw-rgb,pixel-aspect-ratio=1/1,bpp=(int)32,depth=(int)32,endianness=(int)4321,red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255" ... void main(){ gchar * descr = g_strdup_printf ("uridecodebin uri=file://%s ! ffmpegcolorspace ! videoscale ! capsfilter name=flt !" " appsink name=sink caps=\"" CAPS "\"", filename); pipeline = gst_parse_launch (descr, &errorMessage); if (errorMessage != NULL) { g_print ("could not construct pipeline: %s", errorMessage->message); g_error_free (errorMessage); exit (-1); } /* get sink */ sink = gst_bin_get_by_name (GST_BIN (pipeline), "sink"); g_object_set (G_OBJECT (sink), "emit-signals", TRUE, "sync", TRUE, NULL); g_signal_connect (sink, "new-buffer", G_CALLBACK (on_new_buffer_from_source), 0); GMainLoop * loop = g_main_loop_new (NULL, FALSE); bus = gst_element_get_bus (pipeline); gst_bus_add_watch (bus, (GstBusFunc) on_sink_message, loop); gst_object_unref (bus); } ... void on_new_buffer_from_source (GstElement * elt, gpointer data) { g_print("Buffer arrived\n"); GstBuffer *buffer; /* get the buffer from appsink */ buffer = gst_app_sink_pull_buffer (GST_APP_SINK (elt)); ... void changeResolution(int w, int h){ if (desiredW != w || desiredH != h){ std::cout << "Changing resolution from ["<< desiredW << "x" << desiredH << "] to [" << w << "x" << h << "]" << std::endl; desiredW = w; desiredH = h; needResize = true; GstElement * flt = gst_bin_get_by_name (GST_BIN (pipeline), "flt"); g_object_set (G_OBJECT (flt), "caps", gst_caps_new_simple ("video/x-raw-rgb", "width", G_TYPE_INT, w, "height", G_TYPE_INT, h, NULL), NULL); gst_object_unref(flt); } } Everything works fine until the changeResolution() is called, then it stops giving me new buffers in on_new_buffer_from_source. Thanks, Stepan Tim-Philipp Müller napsal(a): > > > Here's a simple example demonstrating how to extract raw RGB video > frames with appsink: > > http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/tests/examples/snapshot/snapshot.c > > Hope this helps. > > Cheers > -Tim > > > > ------------------------------------------------------------------------------ > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel > ------------------------------------------------------------------------------ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
On Tue, 2009-03-31 at 20:03 +0200, Štěpán wrote:
> thanks for your example, it helped me a lot. In fact, it nearly > works already for me (I'll post the sourcecode when I am finished), but > I have one slight problem - I cannot resize the video during playback. > The important parts of code I am using are: > ... > gchar * descr = g_strdup_printf ("uridecodebin uri=file://%s ! > ffmpegcolorspace ! videoscale ! capsfilter name=flt !" > " appsink name=sink caps=\"" CAPS "\"", filename); > pipeline = gst_parse_launch (descr, &errorMessage); There shouldn't be any need for that capsfilter element, you should be able to just put the width=x,height=y parameters into the appsink CAPS and then change those via gst_app_sink_set_caps() or g_object_set (appsink, "caps", new_caps, NULL); Changing caps of a capsfilter element has been a bit problematic in the past. I think it should work now with the latest GStreamer core release, but it might not work with older releases. > Everything works fine until the changeResolution() is called, then it > stops giving me new buffers in on_new_buffer_from_source. You should get an error message on the pipeline bus (presumably an "internal flow error: not-negotiated"). Cheers -Tim ------------------------------------------------------------------------------ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |