Ask Your Question

Revision history [back]

Open udp encoded videostream with gstreamer

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

Open udp encoded videostream with gstreamer

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