Administrator
|
Hi all.
I am writing a small function, making screenshots. I have studied several examples already, and now I'm trying to copy them to my application. My function gets the last displayed buffer from the videosink, then builds the pipeline: appsrc -> ffmpegcolorspace -> videoscale -> encoder -> filesink I have to save the screenshot to one of several formats, so I use one of several encoders: jpegenc, ffenc_bmp, pngenc, ffenc_tiff. All elements are created and added to the pipeline. The problem is that my function cannot set caps on the encoder's sink pad. Even following simple statements return false: caps=gst_caps_from_string("video/x-raw-rgb" ",bpp=24,depth=24" ); pad=gst_element_get_static_pad(enc,"sink"); rb=gst_pad_set_caps(pad,caps);rb is always 0 (FALSE) However, I need this, because my function also has to scale the screenshot, if new width and height are given. |
Maybe you are not giving full caps?
What caps have you tried? 2010/9/6 wl2776 <[hidden email]>
-- Your Sincerely Michael Joachimiak ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Administrator
|
I tried much longer caps, anyway, return was FALSE. I have an impression, that I shouldn't give full caps to a pad, and it fill missing values from the default. Right? |
Administrator
|
In reply to this post by wl2776
On Mon, 2010-09-06 at 06:52 -0700, wl2776 wrote:
> Hi all. > I am writing a small function, making screenshots. > I have studied several examples already, and now I'm trying to copy them to > my application. > > My function gets the last displayed buffer from the videosink, then builds > the pipeline: > appsrc -> ffmpegcolorspace -> videoscale -> encoder -> filesink > > I have to save the screenshot to one of several formats, so I use one of > several encoders: jpegenc, ffenc_bmp, pngenc, ffenc_tiff. > All elements are created and added to the pipeline. > > The problem is that my function cannot set caps on the encoder's sink pad. > Even following simple statements return false: > caps=gst_caps_from_string("video/x-raw-rgb" > ",bpp=24,depth=24" > ); > pad=gst_element_get_static_pad(enc,"sink"); > rb=gst_pad_set_caps(pad,caps); gst_pad_set_caps() must not be used from applications. If you wish to restrict/specify the caps flowing between two elements, insert a capsfilter element. Edward > > rb is always 0 (FALSE) > > However, I need this, because my function also has to scale the screenshot, > if new width and height are given. ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |