problem transmission via udp
morning
duythienelectric at gmail.com
Mon Dec 14 03:41:26 UTC 2020
Hi everybody,
After many days of research, I am having a problem that after processing
images from appsink, I do not know how to transmit via udp.
The process is as follows:
(1)use gst_parse_launch () to get video source ==>
(2)gst_app_sink_set_callbacks () to image processor ==> (3)pass processed
video via udp (I'm using appsrc). I'm having problem at (3)
I refer from this link:
https://stackoverflow.com/questions/10403588/adding-opencv-processing-to-%20gstreamer-application
I don't know how to send the processed appsink so that appsrc can get the
data.
appsrc = gst_element_factory_make("appsrc", "source");// appsrc --test:
videotestsrc
conv = gst_element_factory_make("nvvidconv", "conv");// nvvidconv
--test: videoconvert
videoenc = gst_element_factory_make("nvv4l2h264enc", "enc");//
nvv4l2h264enc --test: x264enc
parser = gst_element_factory_make("h264parse", "parser");
payloader = gst_element_factory_make("rtph264pay", "pay");
g_object_set(G_OBJECT(payloader), "config-interval", 1, NULL);
g_object_set(G_OBJECT(videoenc), "bitrate", 8000000, NULL);
g_object_set(G_OBJECT(videoenc), "maxperf-enable", 1, NULL);
g_object_set(G_OBJECT(appsrc), "caps",
gst_caps_new_simple("video/x-raw",
"format", G_TYPE_STRING, "NV12",
"width", G_TYPE_INT, 640,
"height", G_TYPE_INT, 480,
"pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
"framerate", GST_TYPE_FRACTION, 0, 1,
NULL), NULL);
udpsink = gst_element_factory_make("udpsink", "udpsink");
g_object_set(G_OBJECT(udpsink), "host", "192.168.22.100", NULL);
g_object_set(G_OBJECT(udpsink), "port", 5000, NULL);
std::cout << "set up appsrc..." << std::endl;
gst_bin_add_many(GST_BIN(pipeline), appsrc, conv, videoenc, payloader,
udpsink, NULL);
if (gst_element_link_many(appsrc, conv, videoenc, payloader, udpsink,
NULL) != TRUE)
{
return -1;
}
Can someone help me suggest, or 1 similar example, I'm newbie with
gstreamer.
Thanks.
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list