Open udp encoded videostream with gstreamer

asked 2016-12-28 04:42:31 -0600

anunuparov gravatar image

updated 2016-12-28 06:13:23 -0600

Hello,

I have a host which sends videostream with opencv and gstreamer. Writter looks like this:

writer.open("appsrc ! videoconvert ! x264enc noise-reduction=10000 tune=zerolatency byte-stream=true threads=4 ! mpegtsmux ! udpsink host=192.168.0.148 port=7002", 0, (double)30, Size(640, 480), true);

I can open it with gstreamer with this parameters, and everything works correctly:

gst-launch-1.0 udpsrc port=7002 ! tsparse ! tsdemux ! h264parse ! avdec_h264 ! videoconvert ! ximagesink sync=false

But If I try to open this stream in opencv with next command:

VideoCapture cap("udpsrc port=7002 ! tsparse ! tsdemux ! h264parse ! avdec_h264 ! videoconvert ! appsink");

Program halts during execution of next line:

cap >> frame;

P.S. opencv is build with support of gstreamer-1.0

Thank you for attention, anunuparov

edit retag flag offensive close merge delete