用于rtsp h264流的gstreamer管道

时间:2013-12-17 07:33:48

标签: video video-streaming gstreamer rtsp

我是gstreamer的新手,无法弄清楚如何为以下示例创建工作管道。我想从网络摄像机解码h264流。

gst-launch rtspsrc location=rtsp://172.16.112.124/axis-media/media.amp  latency=0 ! decodebin ! autovideosink -vvv

这很好但我需要一个自建的pipline。谢谢你的帮助!

Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstRtpBin:rtpbin0: latency = 0
/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstRtpBin:rtpbin0: buffer-mode = slave (1)
/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0: timeout = 5000000
/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0: buffer-size = 0
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0: timeout = 0
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H264, packetization-mode=(string)1, profile-level-id=(string)420029, sprop-parameter-sets=(string)\"Z0IAKeNQKD9gLcBAQGkHiRFQ\\,aM48gA\\=\\=\", a-framerate=(string)30.0, a-transform=(string)\"1\\,0\\,0\\;0\\,1\\,0\\;0\\,0\\,1\", clock-base=(uint)1627931333, seqnum-base=(uint)55492, npt-start=(guint64)0, play-speed=(double)1, play-scale=(double)1
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:sink: caps = application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H264, packetization-mode=(string)1, profile-level-id=(string)420029, sprop-parameter-sets=(string)\"Z0IAKeNQKD9gLcBAQGkHiRFQ\\,aM48gA\\=\\=\", a-framerate=(string)30.0, a-transform=(string)\"1\\,0\\,0\\;0\\,1\\,0\\;0\\,0\\,1\", clock-base=(uint)1627931333, seqnum-base=(uint)55492, npt-start=(guint64)0, play-speed=(double)1, play-scale=(double)1
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstGhostPad:sink: caps = application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H264, packetization-mode=(string)1, profile-level-id=(string)420029, sprop-parameter-sets=(string)\"Z0IAKeNQKD9gLcBAQGkHiRFQ\\,aM48gA\\=\\=\", a-framerate=(string)30.0, a-transform=(string)\"1\\,0\\,0\\;0\\,1\\,0\\;0\\,0\\,1\", clock-base=(uint)1627931333, seqnum-base=(uint)55492, npt-start=(guint64)0, play-speed=(double)1, play-scale=(double)1
/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0.GstGhostPad:recv_rtp_src_0_2308308883_96: caps = application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H264, packetization-mode=(string)1, profile-level-id=(string)420029, sprop-parameter-sets=(string)\"Z0IAKeNQKD9gLcBAQGkHiRFQ\\,aM48gA\\=\\=\", a-framerate=(string)30.0, a-transform=(string)\"1\\,0\\,0\\;0\\,1\\,0\\;0\\,0\\,1\", clock-base=(uint)1627931333, seqnum-base=(uint)55492, npt-start=(guint64)0, play-speed=(double)1, play-scale=(double)1
/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0.GstGhostPad:recv_rtp_src_0_2308308883_96.GstProxyPad:proxypad6: caps = application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H264, packetization-mode=(string)1, profile-level-id=(string)420029, sprop-parameter-sets=(string)\"Z0IAKeNQKD9gLcBAQGkHiRFQ\\,aM48gA\\=\\=\", a-framerate=(string)30.0, a-transform=(string)\"1\\,0\\,0\\;0\\,1\\,0\\;0\\,0\\,1\", clock-base=(uint)1627931333, seqnum-base=(uint)55492, npt-start=(guint64)0, play-speed=(double)1, play-scale=(double)1
/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstRtpBin:rtpbin0.GstGhostPad:recv_rtp_src_0_2308308883_96.GstProxyPad:proxypad5: caps = application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H264, packetization-mode=(string)1, profile-level-id=(string)420029, sprop-parameter-sets=(string)\"Z0IAKeNQKD9gLcBAQGkHiRFQ\\,aM48gA\\=\\=\", a-framerate=(string)30.0, a-transform=(string)\"1\\,0\\,0\\;0\\,1\\,0\\;0\\,0\\,1\", clock-base=(uint)1627931333, seqnum-base=(uint)55492, npt-start=(guint64)0, play-speed=(double)1, play-scale=(double)1
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H264, packetization-mode=(string)1, profile-level-id=(string)420029, sprop-parameter-sets=(string)\"Z0IAKeNQKD9gLcBAQGkHiRFQ\\,aM48gA\\=\\=\", a-framerate=(string)30.0, a-transform=(string)\"1\\,0\\,0\\;0\\,1\\,0\\;0\\,0\\,1\", clock-base=(uint)1627931333, seqnum-base=(uint)55492, npt-start=(guint64)0, play-speed=(double)1, play-scale=(double)1
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstRtpH264Depay:rtph264depay0.GstPad:src: caps = video/x-h264
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstRtpH264Depay:rtph264depay0.GstPad:sink: caps = application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H264, packetization-mode=(string)1, profile-level-id=(string)420029, sprop-parameter-sets=(string)\"Z0IAKeNQKD9gLcBAQGkHiRFQ\\,aM48gA\\=\\=\", a-framerate=(string)30.0, a-transform=(string)\"1\\,0\\,0\\;0\\,1\\,0\\;0\\,0\\,1\", clock-base=(uint)1627931333, seqnum-base=(uint)55492, npt-start=(guint64)0, play-speed=(double)1, play-scale=(double)1
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/ffdec_h264:ffdec_h2640.GstPad:sink: caps = video/x-h264
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstGhostPad:src0: caps = video/x-raw-yuv, width=(int)320, height=(int)240, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/ffdec_h264:ffdec_h2640.GstPad:src: caps = video/x-raw-yuv, width=(int)320, height=(int)240, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstD3DVideoSink:autovideosink0-actual-sink-d3dvideo.GstPad:sink: caps = video/x-raw-yuv, width=(int)320, height=(int)240, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0.GstGhostPad:sink: caps = video/x-raw-yuv, width=(int)320, height=(int)240, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstGhostPad:src0.GstProxyPad:proxypad7: caps = video/x-raw-yuv, width=(int)320, height=(int)240, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0.GstGhostPad:sink.GstProxyPad:proxypad1: caps = video/x-raw-yuv, width=(int)320, height=(int)240, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false, pixel-aspect-ratio=(fraction)1/1
WARNING: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstD3DVideoSink:autovideosink0-actual-sink-d3dvideo: A lot of buffers are being dropped.
Additional debug info:

1 个答案:

答案 0 :(得分:2)

您可以找到decodebin创建的管道,然后手动创建它。

来自gstreamer sdk文档 - basic tutorial 11

  

GStreamer具有输出图形文件的功能。这些.dot文件,可通过GraphViz等免费程序读取,描述管道的拓扑结构,以及每个链接中协商的上限。

     

要获取.dot文件,只需将GST_DEBUG_DUMP_DOT_DIR环境变量设置为指向要放置文件的文件夹即可。 gst-launch将在每次状态更改时创建一个.dot文件,因此您可以看到大写协商的演变。