gstreamer 1.0 videoscale 到 capsfilter 到 d3dvideosink
gstreamer 1.0 videoscale to capsfilter to d3dvideosink
我正在尝试更改 rtspsrc 中的视频格式。我一直有 fakesink,直到我在我的程序 C 中进入 capsfilter。它说内部数据流错误。有人知道如何完成这项工作吗?
pipel.source = gst_element_factory_make ("rtspsrc","source");
g_object_set(GST_OBJECT(pipel.source),"location",url,NULL);
pipel.rtppay = gst_element_factory_make( "rtph264depay", "depayl");
pipel.decodebin = gst_element_factory_make ("openh264dec","decode");
pipel.parse = gst_element_factory_make("h264parse","parse");
pipel.videoscale = gst_element_factory_make("videoscale","scale");
filtercaps = gst_caps_from_string("video/x-raw,width=320,height=240");
g_object_set (G_OBJECT (pipel.filter1), "caps",filtercaps,NULL);
gst_caps_unref(filtercaps);
gst_bin_add_many (GST_BIN (pipel.pipeline),pipel.source,pipel.rtppay,pipel.parse,pipel.decodebin,pipel.videoscale,pipel.filter1,pipel.sink
,NULL);
if(!gst_element_link_many(pipel.rtppay,pipel.parse,pipel.decodebin,pipel.videoscale,pipel.filter1,pipel.sink))
printf("\nFailed Linking\n");
g_signal_connect(pipel.source, "pad-added", G_CALLBACK(cb_new_rtspsrc_pad),pipel.rtppay);
g_signal_connect(pipel.rtppay, "pad-added", G_CALLBACK(on_pad_added), pipel.parse);
filtercaps = gst_caps_from_string("video/x-raw,width=320,height=240");
gst_bin_add_many (GST_BIN (pipel.pipeline),pipel.source,pipel.rtppay,pipel.parse,pipel.decodebin,pipel.videoscale,pipel.sink
,NULL);
if(!gst_element_link_many(pipel.rtppay,pipel.parse,pipel.decodebin,pipel.videoscale,pipel.sink))
printf("\nFailed Linking\n");
添加此行将使其生效。您不在 bin 和链接中的 videoscale 和 videosink 之间使用 capsfilter。
gst_element_link_filtered(pipel.videoscale, pipel.sink, filtercaps);
gst_caps_unref(filtercaps);
我正在尝试更改 rtspsrc 中的视频格式。我一直有 fakesink,直到我在我的程序 C 中进入 capsfilter。它说内部数据流错误。有人知道如何完成这项工作吗?
pipel.source = gst_element_factory_make ("rtspsrc","source");
g_object_set(GST_OBJECT(pipel.source),"location",url,NULL);
pipel.rtppay = gst_element_factory_make( "rtph264depay", "depayl");
pipel.decodebin = gst_element_factory_make ("openh264dec","decode");
pipel.parse = gst_element_factory_make("h264parse","parse");
pipel.videoscale = gst_element_factory_make("videoscale","scale");
filtercaps = gst_caps_from_string("video/x-raw,width=320,height=240");
g_object_set (G_OBJECT (pipel.filter1), "caps",filtercaps,NULL);
gst_caps_unref(filtercaps);
gst_bin_add_many (GST_BIN (pipel.pipeline),pipel.source,pipel.rtppay,pipel.parse,pipel.decodebin,pipel.videoscale,pipel.filter1,pipel.sink
,NULL);
if(!gst_element_link_many(pipel.rtppay,pipel.parse,pipel.decodebin,pipel.videoscale,pipel.filter1,pipel.sink))
printf("\nFailed Linking\n");
g_signal_connect(pipel.source, "pad-added", G_CALLBACK(cb_new_rtspsrc_pad),pipel.rtppay);
g_signal_connect(pipel.rtppay, "pad-added", G_CALLBACK(on_pad_added), pipel.parse);
filtercaps = gst_caps_from_string("video/x-raw,width=320,height=240");
gst_bin_add_many (GST_BIN (pipel.pipeline),pipel.source,pipel.rtppay,pipel.parse,pipel.decodebin,pipel.videoscale,pipel.sink
,NULL);
if(!gst_element_link_many(pipel.rtppay,pipel.parse,pipel.decodebin,pipel.videoscale,pipel.sink))
printf("\nFailed Linking\n");
添加此行将使其生效。您不在 bin 和链接中的 videoscale 和 videosink 之间使用 capsfilter。
gst_element_link_filtered(pipel.videoscale, pipel.sink, filtercaps);
gst_caps_unref(filtercaps);