带有TLS示例的GStreamer RTSP服务器失败

时间:2016-01-28 20:41:11

标签: c gstreamer glib

我正在尝试使用GStreamer 1.7.1来启动具有身份验证和TLS支持的RTSP服务器。我使用的代码几乎与file from source相同,只有#define WITH_AUTH#define WITH_TLS

我在示例目录中编译后使用./test-video启动服务器。

要访问流,我使用终端中的以下行从同一台计算机连接: gst-launch-1.0 rtspsrc location=rtsps://127.0.0.1:8554/test user-id=user user-pw=password tls-validation-flags=generic-error ! rtph264depay ! avdec_h264 ! videoconvert ! osxvideosink

尝试启动客户端后,服务器会输出以下消息:

0:00:03.217216000 26896 0x7fe1248159e0 ERROR             rtspclient rtsp-client.c:733:find_media: client 0x7fe1240208e0: not authorized to see factory path /test
0:00:03.217248000 26896 0x7fe1248159e0 ERROR             rtspclient rtsp-client.c:2276:handle_describe_request: client 0x7fe1240208e0: no media

(test-video:26896): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed

(test-video:26896): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed

(test-video:26896): GStreamer-CRITICAL **: gst_element_get_request_pad: assertion 'GST_IS_ELEMENT (element)' failed

(test-video:26896): GStreamer-CRITICAL **: gst_object_unref: assertion 'object != NULL' failed

(test-video:26896): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed

(test-video:26896): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed

(test-video:26896): GStreamer-CRITICAL **: gst_element_get_request_pad: assertion 'GST_IS_ELEMENT (element)' failed

(test-video:26896): GStreamer-CRITICAL **: gst_object_unref: assertion 'object != NULL' failed

(test-video:26896): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(test-video:26896): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(test-video:26896): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed

(test-video:26896): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed

(test-video:26896): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed

(test-video:26896): GStreamer-CRITICAL **: gst_element_get_request_pad: assertion 'GST_IS_ELEMENT (element)' failed

(test-video:26896): GStreamer-CRITICAL **: gst_object_unref: assertion 'object != NULL' failed

(test-video:26896): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed

(test-video:26896): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed

(test-video:26896): GStreamer-CRITICAL **: gst_element_get_request_pad: assertion 'GST_IS_ELEMENT (element)' failed

(test-video:26896): GStreamer-CRITICAL **: gst_object_unref: assertion 'object != NULL' failed

(test-video:26896): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(test-video:26896): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(test-video:26896): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed

客户端输出为:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsps://127.0.0.1:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info

** (gst-launch-1.0:26910): CRITICAL **: gst_rtsp_message_take_header: assertion 'value != NULL' failed
Progress: (request) SETUP stream 0

(gst-launch-1.0:26910): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(gst-launch-1.0:26910): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(gst-launch-1.0:26910): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed

(gst-launch-1.0:26910): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(gst-launch-1.0:26910): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(gst-launch-1.0:26910): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed

(gst-launch-1.0:26910): GLib-GObject-WARNING **: gtype.c:4272: type id '0' is invalid

(gst-launch-1.0:26910): GLib-GObject-WARNING **: can't peek value table for type '<invalid>' which is not currently referenced

(gst-launch-1.0:26910): GLib-GObject-WARNING **: gvalue.c:184: cannot initialize GValue with type '(null)', this type has no GTypeValueTable implementation

(gst-launch-1.0:26910): GLib-GObject-WARNING **: gtype.c:4272: type id '0' is invalid

(gst-launch-1.0:26910): GLib-GObject-WARNING **: can't peek value table for type '<invalid>' which is not currently referenced

(gst-launch-1.0:26910): GLib-GObject-WARNING **: gvalue.c:184: cannot initialize GValue with type '(null)', this type has no GTypeValueTable implementation

(gst-launch-1.0:26910): GStreamer-CRITICAL **: gst_value_deserialize: assertion 'G_IS_VALUE (dest)' failed

(gst-launch-1.0:26910): GStreamer-CRITICAL **: gst_value_deserialize: assertion 'G_IS_VALUE (dest)' failed

(gst-launch-1.0:26910): GLib-GObject-CRITICAL **: g_object_set_property: assertion 'G_IS_OBJECT (object)' failed

(gst-launch-1.0:26910): GLib-GObject-CRITICAL **: g_object_set_property: assertion 'G_IS_OBJECT (object)' failed

(gst-launch-1.0:26910): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed

(gst-launch-1.0:26910): GLib-GObject-CRITICAL **: g_value_unset: assertion 'G_IS_VALUE (value)' failed

(gst-launch-1.0:26910): GLib-GObject-CRITICAL **: g_value_unset: assertion 'G_IS_VALUE (value)' failed

(gst-launch-1.0:26910): GStreamer-CRITICAL **: gst_element_get_request_pad: assertion 'GST_IS_ELEMENT (element)' failed

(gst-launch-1.0:26910): GStreamer-CRITICAL **: gst_object_unref: assertion 'object != NULL' failed

(gst-launch-1.0:26910): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed

** (gst-launch-1.0:26910): CRITICAL **: gst_rtsp_message_take_header: assertion 'value != NULL' failed
Progress: (request) SETUP stream 1

(gst-launch-1.0:26910): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(gst-launch-1.0:26910): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(gst-launch-1.0:26910): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed

(gst-launch-1.0:26910): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(gst-launch-1.0:26910): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(gst-launch-1.0:26910): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed

(gst-launch-1.0:26910): GLib-GObject-WARNING **: gtype.c:4272: type id '0' is invalid

(gst-launch-1.0:26910): GLib-GObject-WARNING **: can't peek value table for type '<invalid>' which is not currently referenced

(gst-launch-1.0:26910): GLib-GObject-WARNING **: gvalue.c:184: cannot initialize GValue with type '(null)', this type has no GTypeValueTable implementation

(gst-launch-1.0:26910): GLib-GObject-WARNING **: gtype.c:4272: type id '0' is invalid

(gst-launch-1.0:26910): GLib-GObject-WARNING **: can't peek value table for type '<invalid>' which is not currently referenced

(gst-launch-1.0:26910): GLib-GObject-WARNING **: gvalue.c:184: cannot initialize GValue with type '(null)', this type has no GTypeValueTable implementation

(gst-launch-1.0:26910): GStreamer-CRITICAL **: gst_value_deserialize: assertion 'G_IS_VALUE (dest)' failed

(gst-launch-1.0:26910): GStreamer-CRITICAL **: gst_value_deserialize: assertion 'G_IS_VALUE (dest)' failed

(gst-launch-1.0:26910): GLib-GObject-CRITICAL **: g_object_set_property: assertion 'G_IS_OBJECT (object)' failed

(gst-launch-1.0:26910): GLib-GObject-CRITICAL **: g_object_set_property: assertion 'G_IS_OBJECT (object)' failed

(gst-launch-1.0:26910): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed

(gst-launch-1.0:26910): GLib-GObject-CRITICAL **: g_value_unset: assertion 'G_IS_VALUE (value)' failed

(gst-launch-1.0:26910): GLib-GObject-CRITICAL **: g_value_unset: assertion 'G_IS_VALUE (value)' failed

(gst-launch-1.0:26910): GStreamer-CRITICAL **: gst_element_get_request_pad: assertion 'GST_IS_ELEMENT (element)' failed

(gst-launch-1.0:26910): GStreamer-CRITICAL **: gst_object_unref: assertion 'object != NULL' failed

(gst-launch-1.0:26910): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Progress: (request) Sending PLAY request
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc4: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): void gst_base_src_loop(GstPad *) (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc4:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.001834000
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

我目前正在尝试使用OS X El Capitan机器,但我也尝试使用Linux Mint 17.3机器并接收相同的消息。

有没有人对如何解决这个问题有任何想法?感谢您提前提供任何帮助。

1 个答案:

答案 0 :(得分:1)

这些错误可能是由于gstreamer或glib无法动态加载模块。

首先检查:

使用任何TLS功能,Glib可在TLS模块中动态加载。通过defualt这是一个gnutls模块。在Ubuntu上,这可以在/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so中找到。如果你想自己编译它,那么这个依赖是由glib-networking(https://github.com/GNOME/glib-networking)提供的。

第二次检查:

TLS握手完成后,RTSP服务器继续设置SRTP通道。如果系统上不存在SRTP插件,程序将发布CRITICAL错误。运行 gst-inspect-1.0 srtpenc gst-inspect-1.0 srtpdec 以验证这些插件是否存在以及是否满足其依赖关系。