problems resizing video stream from c++

Blaine Bell blaine at blainebell.org
Fri Sep 1 02:17:11 UTC 2017


my gst-launch-1.0 commands are like this:

gst-launch-1.0 udpsrc port=8009 caps = "application/x-rtp, 
media=(string)video, clock-rate=(int)90000, encoding-name=(string)VP8" ! 
rtpvp8depay ! vp8dec ! videoconvert ! videoscale ! video/x-raw,width=100 
! autovideosink

This works perfectly.  But when I try to setup this stream in c++ (with 
slightly different output, I want to read images), it fails to go into 
PLAYING state.  I am having trouble debugging this, but have isolated it 
to attaching the caps using gst_element_link_filtered between the 
videoscale and next element (which from c++ is the jpegenc, but have 
also tried another videoconvert GstElement).  These all fail.

To be clear, I setup the videoconvert and videoscale element, and the 
element after like this:

   videoconvert1 = gst_element_factory_make("videoconvert", "convert1");
   videoscale = gst_element_factory_make("videoscale", "scale");
   jpegenc = gst_element_factory_make("jpegenc", "myenc");

then after the command:

   gst_bin_add_many (GST_BIN (pipeline), src, ....., videoconvert1, 
videoscale, jpegenc, ...., NULL);

I create the caps:

   caps = gst_caps_from_string("video/x-raw,width=100");

then use the gst_element_link_filtered() to connect the caps to the 
pipeline:

   gst_element_link_filtered(videoscale, jpegenc, caps);

I have tried many versions and combinations of this, but cannot get the 
resize to work.  Can someone help explain to me how to resize this video 
feed from C++?

Thanks in advance,

Blaine



More information about the gstreamer-devel mailing list