i.MX27 Video GST Caps

Document created by jesseg Employee on Aug 21, 2012Last modified by Jodi Paul on May 14, 2013
Version 3Show Document
  • View in full screen mode

Caps

 

Caps are the capabilities of a pad of a gstreamer element, find out more at official gstreamer page [1]

Caps describes the types of media that may stream over a pad. In the case of streaming over Ethernet, it's important to know previously the caps of udpsink element to inform the client part what media it waits.


Example

 

A simples test is to stream a video from your PC to your own PC.

First of all, open two terminals. In one side, setup your IP. For this example:

export HOST=192.168.0.5 

 

 

Replace 192.168.0.5 with your own IP address

 

 

$gst-launch -v videotestsrc ! ffenc_mpeg4 ! rtpmp4vpay ! udpsink host=$HOST port=5000 
Setting pipeline to PAUSED ... 
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)320, height=(int)240, framerate=(fraction)30/1 
Pipeline is PREROLLING ... 
/GstPipeline:pipeline0/ffenc_mpeg4:ffenc_mpeg40.GstPad:src: caps = video/mpeg, width=(int)320, height=(int)240, framerate=(fraction)30/1, mpegversion=(int)4, systemstream=(boolean)false /GstPipeline:pipeline0/ffenc_mpeg4:ffenc_mpeg40.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)320, height=(int)240, framerate=(fraction)30/1 /GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0.GstPad:sink: caps = video/mpeg, width=(int)320, height=(int)240, framerate=(fraction)30/1, mpegversion=(int)4, systemstream=(boolean)false /GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, 
config= (string)000001b001000001b58913000001000000012000c48d8800f50a041e1463000001b24c61766335312e35302e30, payload=(int)96, ssrc=(guint)3033206283, clock-base=(guint)3260076862, seqnum-base=(guint)9109 
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config= (string)000001b001000001b58913000001000000012000c48d8800f50a041e1463000001b24c61766335312e35302e30, payload=(int)96, ssrc=(guint)3033206283, clock-base=(guint)3260076862, seqnum-base=(guint)9109 
Pipeline is PREROLLED ... 
Setting pipeline to PLAYING ... 
New clock: GstSystemClock

 

 

New clock: GstSystemClock indicates that everything goes right and the streaming is flying over Ethernet

 

 

Get caps from udpsink0.GstPad:sink:

caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=string)000001b001000001b58913000001000000012000c48d8800f50a041e1463000001b24c61766335312e35302e30, payload=(int)96, ssrc=(guint)3033206283, clock-base=(guint)3260076862, seqnum-base=(guint)9109 


The parameters from caps:

  • media=(string)video
  • clock-rate=(int)90000
  • encoding-name=(string)MP4V-ES
  • profile-level-id=(string)1
  • config=string)000001b001000001b58913000001000000012000c48d8800f50a041e1463000001b24c61766335312e35302e30
  • payload=(int)96
  • ssrc=(guint)3033206283
  • clock-base=(guint)3260076862
  • seqnum-base=(guint)9109

 

To receive the streaming above using gstreamer. Just copy entire caps line and fit it into command line like this:

 

$ gst-launch -v udpsrc port=5000 caps ="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=  
  (string)000001b001000001b58913000001000000012000c48d8800f50a041e1463000001b24c61766335312e35302e30, payload=(int)96, ssrc=(guint)3033206283, clock-base=(guint)3260076862, seqnum-base=(guint)9109" ! rtpmp4vdepay ! ffdec_mpeg4 ! autovideosinkSetting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock 
/GstPipeline:pipeline0/GstRtpMP4VDepay:rtpmp4vdepay0.GstPad:src: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, codec_data= (buffer)000001b001000001b58913000001000000012000c48d8800f50a041e1463000001b24c61766335312e35302e30 
/GstPipeline:pipeline0/GstRtpMP4VDepay:rtpmp4vdepay0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001b001000001b58913000001000000012000c48d8800f50a041e1463000001b24c61766335312e35302e30, payload=(int)96, ssrc=(guint)3033206283, clock-base=(guint)3260076862, seqnum- 
base=(guint)9109 
/GstPipeline:pipeline0/ffdec_mpeg4:ffdec_mpeg40.GstPad:sink: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, codec_data= (buffer)000001b001000001b58913000001000000012000c48d8800f50a041e1463000001b24c61766335312e35302e30 
/GstPipeline:pipeline0/ffdec_mpeg4:ffdec_mpeg40.GstPad:src: caps = video/x-raw-yuv, width=(int)320, height=(int)240, framerate=(fraction)30/1, format=(fourcc)I420, pixel-aspect-ratio=(fraction)1/1 /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstXvImageSink:autovideosink0-actual-sink-xvimage.GstPad:sink: caps = video/x-raw-yuv, width=(int)320, height=(int)240, framerate= (fraction)30/1, format=(fourcc)I420, 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)30/1, format=(fourcc)I420, 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)30/1, format=(fourcc)I420, pixel-aspect-ratio= (fraction)1/1 
/GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = video/x-raw-yuv, width=(int)320, height=(int)240, framerate=(fraction)30/1, format= (fourcc)I420, pixel-aspect-ratio=(fraction)1/1

 

 

Be sure to place a blank space around !

 

 

The command line takes just ONE line

 

 

SDP File

When streaming to VLC, create a SDP file with CAPS.

For MPEG4 streaming, use the following template:

v=0
o=- 1223457093460663 1 IN IP4 127.0.0.1 
s=RTSP Server 
i=Codec00 
t=0 0 
a=tool:LIVE555 Streaming Media v2008.07.24 
a=type broadcast b=AS:21 
a=control:* 
a=source-filter: incl IN IP4 127.0.0.1 
a=rtcp-unicast: reflection 
m=video A RTP/AVP B 
a=rtpmap:B MP4V-ES/90000 
a=framerate=C 
a=fmtp:B profile-level-id=D; config=E;
  • A = port number (5000 in the example)
  • B = payload (96)
  • C = framerate (supose 30 for default)
  • D = profile-level-id (1)
  • E = config (000001b001000001b58913000001000000012000c48d8800f50a041e1463000001b24c61766335312e35302e30)

The SDP file for the example, has the content above:

 

v=0 
o=- 1223457093460663 1 IN IP4 127.0.0.1 
s=RTSP Server 
i=Codec00 
t=0 0 
a=tool:LIVE555 Streaming Media v2008.07.24 
a=type broadcast 
b=AS:21 
a=control:* 
a=source-filter: incl IN IP4 127.0.0.1 
a=rtcp-unicast: reflection 
m=video 5000 RTP/AVP 96 
a=rtpmap:96 MP4V-ES/90000 
a=framerate=30 
a=fmtp:96 profile-level-id=1; config=000001b001000001b58913000001000000012000c48d8800f50a041e1463000001b24c61766335312e35302e30;

 

For H264 streaming, use the following template:

v=0 
o=- 1223457093460663 1 IN IP4 127.0.0.1 
s=RTSP Server 
i=Codec00 
t=0 0 
a=tool:LIVE555 Streaming Media v2008.07.24 
a=type broadcast 
b=AS:21 
a=control:* 
a=source-filter: incl IN IP4 127.0.0.1 
a=rtcp-unicast: reflection 
m=video 5000 RTP/AVP 96 
a=rtpmap:96 H264/90000 
a=framerate=30 
a=fmtp:96 profile-level-id=42001e; sprop-parameter-sets=Z0IAHqaAoD2Q;

 

 

The bold values must be changed

Attachments

    Outcomes