Usage of rtspclientsink plugin.
surprised
1028554060 at qq.com
Tue Oct 29 01:08:11 UTC 2019
Hi,gstreamers. I want to use the rtspclientsink plugin in my program. It
succeeded via gst-launch-1.0 when using rtspclientsink,but failed in my
program. My program is compiled successfully and no running time errors,but
my pipeline was blocked,so the data was not sent into network via
rtspclientsink. Can you find some problems in my program? Should I config
something like the following when using rtspclientsink: server =
gst_rtsp_server_new (); mounts = gst_rtsp_server_get_mount_points (server);
??? My key part of the program is showing in the following and I hope some
of you can help me find the problem:
//////////////////////////////////////////////
app1-> videosrc = gst_element_factory_make ("appsrc", "videosrc1");
if( !app1->videosrc ) {
g_print( "Failed to create element appsrc1!\n");
}
else{
g_print("Succeed to create element appsrc1!\n");
}
app1->videoparse = gst_element_factory_make("videoparse","videoparse1");
if (!app1->videoparse){
g_print("Failed to create element videoparse1!\n");
}
else{
g_print("Succeed to create element videoparse1!\n");
}
app1->capsfilter1 = gst_element_factory_make("capsfilter","capsfilter11");
if (!app1->capsfilter1){
g_print("Failed to create element capsfilter11!\n");
}
else{
g_print("Succeed to create element capsfilter11!\n");
}
app1->capsfilter2 = gst_element_factory_make("capsfilter","capsfilter21");
if (!app1->capsfilter2){
g_print("Failed to create element capsfilter21!\n");
}
else{
g_print("Succeed to create element capsfilter21!\n");
}
app1->omxh265enc = gst_element_factory_make("omxh265enc","omxh265enc1");
if (!app1->omxh265enc){
g_print("Failed to create element omxh265enc1!\n");
}
else{
g_print("Succeed to create element omxh265enc!\n");
}
app1->rtspclientsink =
gst_element_factory_make("rtspclientsink","rtspclientsink1");
if (!app1->rtspclientsink){
g_print("Failed to create element rtspclientsink!\n");
}
else{
g_print("Succeed to create element rtspclientsink!\n");
}
sprintf(rtsp_str,"rtsp://216.1.1.80/81_%d",sessionNum);
g_object_set(G_OBJECT(app1->rtspclientsink),
"location",rtsp_str,
"protocols",GST_RTSP_LOWER_TRANS_TCP,
NULL);
g_object_set(G_OBJECT(app1->videoparse),"format","I420","width",4096,"height",2168,"framerate",5,1,NULL);
caps1 = gst_caps_new_simple("video/x-h265",
"stream-format",G_TYPE_STRING,"byte-stream",
NULL);
g_object_set(G_OBJECT(app1->capsfilter2),"caps",caps1,NULL);
caps2 = gst_caps_new_simple("video/x-raw",
"format",G_TYPE_STRING,"I420",
"width",G_TYPE_INT,4096,
"height",G_TYPE_INT,2168,
"framerate",GST_TYPE_FRACTION,24,1,
"pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
NULL);
gst_app_src_set_caps(GST_APP_SRC( app1->videosrc), caps2);
g_object_set(G_OBJECT(app1->videosrc),
"stream-type", 0,
"is-live", TRUE,
"format", GST_FORMAT_TIME,
"max-bytes",FRAME_W * FRAME_H * 3/2 * 100,
NULL);
gst_bin_add_many(videoBin,app1->videosrc,app1->videoparse,app1->omxh265enc,app1->capsfilter2,app1->rtspclientsink,NULL);
bool ok=false;
ok =
gst_element_link_many(app1->videosrc,app1->videoparse,app1->omxh265enc,app1->capsfilter2,app1->rtspclientsink,NULL);
if (ok) g_print("Linked most of the elements together!\n");
else g_print("*** Linking error! ***\n");
g_object_set(G_OBJECT(app1->videosrc),
"stream-type", 0,
"is-live", TRUE,
"format", GST_FORMAT_TIME,
"do-timestamp", TRUE,
"min-latency", 0,
"max-bytes", FRAME_W * FRAME_H * 3/2 * 100,
"block", TRUE,
"min-percent", 50,
NULL);
///////////////////////////////////////////////
It's urgent! Thank you very much!
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list