- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 gstreamer 使用以下命令连接到 ubiquiti 相机并成功连接。
gst-launch-1.0 --gst-debug=4 rtspsrc location="rtsp://:554/live/ch00_0"! rtph264depay ! h264解析! openh264dec ! d3dvideosink
我查看了调试,它说无法将 pads rtspsrc 链接到 rtph264depay。
Picture
但它可以正常播放并且可以看到视频。当我把它放到一个 c 项目中时,它说无法将源链接到 rtph264parse。我环顾四周,说要使用带有以下代码的动态垫
static void on_pad_added (GstElement *element, GstPad *pad, gpointer data)
{
GstPad *sinkpad;
GstElement *decoder = (GstElement *) data;
/* We can now link this pad with the rtsp-decoder sink pad */
g_print ("Dynamic pad created, linking source/demuxer\n");
sinkpad = gst_element_get_static_pad (decoder, "sink");
gst_pad_link (pad, sinkpad);
gst_object_unref (sinkpad);
}
int main(int argc, char *argv[])
{
/* Initialize GStreamer */
gst_init(&argc,&argv);
/* Build Pipeline */
pipel.pipeline = gst_pipeline_new("My pipeline");
pipel.source = gst_element_factory_make ("rtspsrc","source");
g_object_set (G_OBJECT (pipel.source), "latency",2000,NULL);
pipel.rtppay = gst_element_factory_make( "rtph264depay", "depayl");
pipel.parse = gst_element_factory_make("h264parse","parse");
pipel.filter1 = gst_element_factory_make("capsfilter","filter");
pipel.decodebin = gst_element_factory_make ("openh264dec","decode");
pipel.sink = gst_element_factory_make("d3dvideosink","sink");
g_object_set (G_OBJECT (pipel.sink), "sync",FALSE,NULL);
//create_uri(url,url_size,ip_address,port);
g_object_set(GST_OBJECT(pipel.source),"location","rtsp://<IP>:554/live/ch00_0",NULL);
filtercaps = gst_caps_from_string("application/x-rtp");
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.sink
,NULL);
if(!gst_element_link(pipel.source,pipel.rtppay))
printf("\nFailed source to rtppay\n");
if(!gst_element_link_many(pipel.parse,pipel.decodebin,pipel.sink,NULL))
printf("\nFailed to link parse to sink");
g_signal_connect(pipel.rtppay, "pad-added", G_CALLBACK(on_pad_added), pipel.parse);
}
最佳答案
static void cb_new_rtspsrc_pad(GstElement *element,GstPad*pad,gpointer data)
{
gchar *name;
GstCaps * p_caps;
gchar * description;
GstElement *p_rtph264depay;
name = gst_pad_get_name(pad);
g_print("A new pad %s was created\n", name);
// here, you would setup a new pad link for the newly created pad
// sooo, now find that rtph264depay is needed and link them?
p_caps = gst_pad_get_pad_template_caps (pad);
description = gst_caps_to_string(p_caps);
printf("%s\n",p_caps,", ",description,"\n");
g_free(description);
p_rtph264depay = GST_ELEMENT(data);
// try to link the pads then ...
if(!gst_element_link_pads(element, name, p_rtph264depay, "sink"))
{
printf("Failed to link elements 3\n");
}
g_free(name);
}
/* ---------- Main --------------- */
int main(int argc, char *argv[])
{
/* Initialize GStreamer */
gst_init(&argc,&argv);
/* Build Pipeline */
pipel.pipeline = gst_pipeline_new("My pipeline");
creating_pipeline(ip_address,port);
pipel.source = gst_element_factory_make ("rtspsrc","source");
g_object_set (G_OBJECT (pipel.source), "latency",2000,NULL);
pipel.rtppay = gst_element_factory_make( "rtph264depay", "depayl");
pipel.parse = gst_element_factory_make("h264parse","parse");
pipel.filter1 = gst_element_factory_make("capsfilter","filter");
pipel.decodebin = gst_element_factory_make ("openh264dec","decode");
pipel.sink = gst_element_factory_make("d3dvideosink","sink");
g_object_set (G_OBJECT (pipel.sink), "sync",FALSE,NULL);
//create_uri(url,url_size,ip_address,port);
g_object_set(GST_OBJECT(pipel.source),"location","rtsp://<ip>:554/live/ch00_0",NULL);
filtercaps = gst_caps_from_string("application/x-rtp");
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
,NULL);
// listen for newly created pads
g_signal_connect(pipel.source, "pad-added", G_CALLBACK(cb_new_rtspsrc_pad),pipel.rtppay);
gst_bin_add_many (GST_BIN (pipel.pipeline),pipel.parse,NULL);
if(!gst_element_link(pipel.rtppay,pipel.parse))
printf("\nNOPE\n");
gst_bin_add_many (GST_BIN (pipel.pipeline),pipel.decodebin
,pipel.sink
,NULL);
if(!gst_element_link_many(pipel.parse,pipel.decodebin,pipel.sink,NULL))
printf("\nFailed to link parse to sink");
g_signal_connect(pipel.rtppay, "pad-added", G_CALLBACK(on_pad_added), pipel.parse);
}
关于gstreamer 1.0 rtspsrc 到 rtph264depay 无法链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32233370/
是否有人尝试将 Gstreamer SDK 教程移植到 http://docs.gstreamer.com/display/GstSDK/Tutorials到 gstreamer 1.0? 我尝试将
我正在尝试构建和安装 gst-plugin-bad-1.4.0,但在为我的硬件目标运行配置脚本时出现以下错误。我正在我的 Ubuntu 上安装的目标 SDK/linux-devkit/中运行构建,并且
我想制作某种流媒体服务器。我希望它通过网络从实时流(例如网络摄像头、ipcam 等)接收 RTSP 流,然后使用不同的 URL 在我的本地网络上广播相同的流。我知道 gstreamer 可以做得很好,
在将解复用的 h264 解码输出发送到 gstreamer 管道中的 autovideosink 之前,是否可以在两者之间提供一些延迟。如果是这样,任何人都可以发布示例管道来做到这一点。 我使用的管道
我需要捕获第二个显示器的屏幕并在主显示器中的一个窗口内“监视”它(以 x0.5 缩放并使用相邻插值,因为我更喜欢性能与质量)。从这里 link ,我有这个截屏命令: gst-launch ximage
与 stagefright 相比,使用 gstreamer 有哪些优势?谁能指出其中的区别。 最佳答案 一开始,一个非常笼统的评论。如果GStreamer 是非常值得商榷的。优于 Stagefrigh
我确定我已经让这个管道在我设置的早期 Ubuntu 系统上运行(为了便于阅读而格式化): playbin uri=rtspt://user:pswd@192.168.xxx.yyy/ch1/m
我创建了一个管道,如下所示: v4l2src -> tee -> queue -> encoder -> avimux -> filesink tee -> queue -> v
在执行以下命令时, gst-launch-1.0 filesrc location=Wildlife.wmv ! decodebin ! queue ! ffmpegcolorspace ! auto
我想将二进制数据直接写入 gstreamer 管道,但我无法这样做。 我试过 rawaudioparse 插件。我已将二进制数据写入 .raw 文件并尝试使用此命令播放此二进制数据。 gst-laun
如何查看 GST_CAT_INFO、GST_DEBUG 等函数的输出? 我需要使用调试级别设置自己编译 gstreamer 还是可以在应用程序级别完成? 最佳答案 可以使用 GST_DEBUG 环境变
我想编写(但首先我想了解如何做)基于 GStreamer 框架的应用程序(不止一个),这些应用程序将同时共享相同的硬件资源。 例如:有硬件加速的视频解码。我想使用硬件加速同时启动两个能够解码不同视频流
我有一个 gstreamer 管道,它可以完美地工作并获取相机流,将其编码为 H.264 视频,将其保存到文件中并按如下方式在屏幕上显示: gst-launch-1.0 -v autovideosrc
我正在开发 C 程序来执行自适应流,但我无法使用 g_object_set() 函数更改 x264enc 元素的“比特率”属性。我该如何更改它? 谢谢。 最佳答案 安装git版本的gstreamer丑
我有一个 gstreamer 管道,它可以完美地工作并获取相机流,将其编码为 H.264 视频,将其保存到文件中并按如下方式在屏幕上显示: gst-launch-1.0 -v autovideosrc
我跑 ./autogen.sh在克隆的 repo 中,它没有说以下内容: configure: No package 'gstreamer-plugins-base-1.0' found config
引用http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-dynamic-pipelines.htm
我有一个项目,我们正在使用 gstreamer、x264 等通过本地网络将视频流多播到多个接收器(连接到监视器的专用计算机)。我们在视频源(相机)系统和显示器上都使用了 gstreamer。 我们使用
我正在尝试使用 GStreamer 作为我们正在内部开发的软电话的视频后端。我们的软电话不是基于 GLib 的,有自己的事件循环。是否可以在没有 GMainLoop 的情况下设置 gst 管道并进入各
关于 gstreamer 元素的一些信息,我必须发出一个查询,比如 gst_element_query_position(data.playbin,GST_FORMAT_TIME,¤t)
我是一名优秀的程序员,十分优秀!