2013-12-17 179 views
1

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

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

这玩的很好,但我需要一个自建的管道。感谢帮助!

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: 
+0

请参考此问题的答案http://stackoverflow.com/questions/17987422/how-to-get-pipeline-created-by-playbin-in-textual-format-in-gstreamer/18008987#18008987 – user2618142

+0

从这里的Java例子工作得很好... http://stackoverflow.com/questions/4192871/playing-rtsp-with-python-gstreamer/6819360#6819360 – user3110056

回答

2

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

从GStreamer的SDK文档 - basic tutorial 11

的GStreamer有能力输出图形文件。这些文件是.dot文件,可以使用像GraphViz这样的免费程序进行读取,它描述了管道的拓扑结构,以及每个链接中协商的上限。

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