使用 gstreamer 进行 RTSP 流式传输时出错
Error during RTSP streaming using gstreamer
我正在使用 gstreamer 进行 RTSP 流式传输。
为此,我从 https://gstreamer.freedesktop.org/src/gst-rtsp-server/ 下载了 gst-rtsp-server 安装程序。我成功地编译了代码。我可以使用(服务器端代码)
启动 gstreamer rtsp 服务器
./test-launch "(videotestsrc !x264enc !rtph264pay name=pay0 pt=96)"
此服务器开始监听 8554 端口后
在接收方(客户端),播放我正在使用的流媒体视频
gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1:8554/test
但是我在服务器端遇到以下错误:
** Message: state PLAYING media 0xb04160
** Message: 0xb04160: got message type new-clock
0:00:04.375120259 17746 0xa74b00 WARN bin gstbin.c:2395:gst_bin_do_latency_func:<media-pipeline> did not really configure latency of 0:00:00.000000000
** Message: client 0x95d760: sent a message with cseq 4
0:00:04.391459616 17746 0xa9f230 WARN basesrc gstbasesrc.c:2625:gst_base_src_loop:<udpsrc0> error: Internal data flow error.
0:00:04.391536109 17746 0xa9f230 WARN basesrc gstbasesrc.c:2625:gst_base_src_loop:<udpsrc0> error: streaming task paused, reason not-linked (-1)
** (lt-test-launch:17746): WARNING **: 0xb04160: got error Internal data flow error. (gstbasesrc.c(2625): gst_base_src_loop (): /GstPipeline:media-pipeline/GstUDPSrc:udpsrc0:
streaming task paused, reason not-linked (-1))
RTSP request message 0xaa0888
请告诉我,客户端必须使用哪些 gstreamer 元素?
我可以使用 VLC 成功播放流媒体视频(打开 VLC --> 媒体 --> 打开网络流媒体 --> RTSP://path....)
注意:
我正在使用 gstreamer-1.0
我正在使用 Ubuntu PC 进行客户端和服务器设置。
在服务器端,您使用 x264enc 对数据进行编码,因此在客户端,您必须对其进行解码,然后才能播放。
试试这个管道,它会起作用
gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1:8554/test ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink
我能够 运行 使用以下命令:
gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1/test caps="application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H264" ! rtph264depay !解码箱!视频转换!自动视频接收器
我正在使用 gstreamer 进行 RTSP 流式传输。 为此,我从 https://gstreamer.freedesktop.org/src/gst-rtsp-server/ 下载了 gst-rtsp-server 安装程序。我成功地编译了代码。我可以使用(服务器端代码)
启动 gstreamer rtsp 服务器./test-launch "(videotestsrc !x264enc !rtph264pay name=pay0 pt=96)"
此服务器开始监听 8554 端口后
在接收方(客户端),播放我正在使用的流媒体视频
gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1:8554/test
但是我在服务器端遇到以下错误:
** Message: state PLAYING media 0xb04160
** Message: 0xb04160: got message type new-clock
0:00:04.375120259 17746 0xa74b00 WARN bin gstbin.c:2395:gst_bin_do_latency_func:<media-pipeline> did not really configure latency of 0:00:00.000000000
** Message: client 0x95d760: sent a message with cseq 4
0:00:04.391459616 17746 0xa9f230 WARN basesrc gstbasesrc.c:2625:gst_base_src_loop:<udpsrc0> error: Internal data flow error.
0:00:04.391536109 17746 0xa9f230 WARN basesrc gstbasesrc.c:2625:gst_base_src_loop:<udpsrc0> error: streaming task paused, reason not-linked (-1)
** (lt-test-launch:17746): WARNING **: 0xb04160: got error Internal data flow error. (gstbasesrc.c(2625): gst_base_src_loop (): /GstPipeline:media-pipeline/GstUDPSrc:udpsrc0:
streaming task paused, reason not-linked (-1))
RTSP request message 0xaa0888
请告诉我,客户端必须使用哪些 gstreamer 元素? 我可以使用 VLC 成功播放流媒体视频(打开 VLC --> 媒体 --> 打开网络流媒体 --> RTSP://path....)
注意: 我正在使用 gstreamer-1.0 我正在使用 Ubuntu PC 进行客户端和服务器设置。
在服务器端,您使用 x264enc 对数据进行编码,因此在客户端,您必须对其进行解码,然后才能播放。
试试这个管道,它会起作用
gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1:8554/test ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink
我能够 运行 使用以下命令:
gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1/test caps="application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H264" ! rtph264depay !解码箱!视频转换!自动视频接收器