Difference between revisions of "Example GStreamer Pipelines"

From IGEP - ISEE Wiki

Jump to: navigation, search
(Created page with '== Purpose == This page provides example pipelines that can be copied to the command line to demonstrate various GStreamer operations. Some of the pipelines may need modificatio…')
 
m (Loopback: Audio)
 
(29 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Purpose ==
+
== Notes ==
This page provides example pipelines that can be copied to the command line to demonstrate various GStreamer operations.  Some of the pipelines may need modification for things such as file names, ip addresses, etc.
 
  
It is our hope that people using this page will add new interesting pipelines that they themselves are using. For example, on DM6467 if you are decoding a 1080 video and outputing to component please include your pipeline for others to use as a reference.
+
In order to make the next examples work I had to install (apt-get install <package>) the following packages on the target
 +
*gstreamer0.10-tools
 +
*gstreamer0.10-plugins-base
 +
*gstreamer0.10-alsa for alsasrc and alsasink
 +
*gstreamer0.10-plugins-ugly for mad
 +
Perhaps also install gstreamer0.10-plugins-good and gstreamer0.10-plugins-bad...
  
Refer to [[GStreamer|this Gstreamer article]] for more information on downloading and building TI Gstreamer elements. The project is hosted at http://gstreamer.ti.com. If you are interested in understanding the design details then watch video presentation http://software-dl.ti.com/sdo/sdo_apps_public_sw/GStreamer_On_TI/FLV1/GStreamer_On_TI.htm
+
For all examples I had to perform gst-launch-0.10 in stead of gst-launch.
 +
<br>When using the pipelines that use the TI codecs on the DSP, make sure you execute the
 +
gst-launch command in the directory were the codec server (cs.x64P) is present.
 +
<br>You may also make a link to the codecserver in the directory were you execute your command.
 +
<br>
 +
If you do not do this you will get an error like ''gst-launch-0.10: BufTab.c:440: BufTab_getNumBufs: Assertion `hBufTab' failed''
  
== Testing ==
+
== Purpose ==
Currently these pipelines have not undergone any extensive testing. If you find an error in a pipeline please correct it.
 
== Media files ==
 
You should be able to use any audio and video media file that conforms to the appropriate standard.
 
=== Creating an AVI file ===
 
  
The following <tt>ffmpeg</tt> command takes a .mov file (say from the Apple movie trailers site) and make an AVI file.  Run the command on your host computer.
+
This page provides example pipelines that can be copied to the command line to demonstrate various GStreamer operations. Some of the pipelines may need modification for things such as file names, ip addresses, etc.  
  
<pre>
+
Refer to [[GStreamer|this Gstreamer article]] for more information on downloading and building TI Gstreamer elements.  
ffmpeg -i tropic_thunder-tlr1a_720p.mov -r 60 -b 6000000 -vcodec mpeg2video -ab 48000000 -acodec libmp3lame -s 1280x544 tropic.avi
 
</pre>
 
  
== Supported Platforms ==
+
== Testing  ==
Following are a list of supported platforms, with links that jump directly to pipeline examples for each platform.
 
*[[#DM355|DM355]]
 
*[[#DM357|DM357]]
 
*[[#DM644x|DM644x]]
 
*[[#DM365|DM365]]
 
*[[#DM6467|DM6467]]
 
*[[#DM6467T|DM6467T]]
 
*[[#OMAP35x|OMAP35x]]
 
*[[#All|All (commonly requested examples)]]
 
  
== DM355 ==
+
Currently these pipelines have not undergone any extensive testing. If you find an error in a pipeline please correct it.  
This section covers pipelines for common use cases for the DM355 processor.
 
  
=== Environment Requirements ===
+
== Media files  ==
{{ti_gst_env|processor=dm355|fbdev=/dev/fb2}}
 
  
=== Loopback: Video ===
+
You should be able to use any audio and video media file that conforms to the appropriate standard.
'''v4l2src (Capture):'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite contiguousInputFrame=TRUE sync=false
 
</pre>
 
  
'''videotestsrc (generated video test-bars):'''
+
=== Creating an AVI file  ===
<pre>
 
gst-launch -v videotestsrc ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite accelFrameCopy=FALSE sync=false
 
</pre>
 
  
=== Loopback: Audio ===
+
The following <tt>ffmpeg</tt> command takes a .mov file (say from the Apple movie trailers site) and make an AVI file. Run the command on your host computer.
No pipelines here yet.  Please feel free to add your own.
+
<pre>ffmpeg -i tropic_thunder-tlr1a_720p.mov -r 60 -b 6000000 -vcodec mpeg2video -ab 48000000 -acodec libmp3lame -s 1280x544 tropic.avi
 +
</pre>
 +
== Supported Platforms  ==
  
=== Loopback:  Audio + Video ===
+
Following are a list of supported platforms, with links that jump directly to pipeline examples for each platform.[[#DM6467T|<br>]]
No pipelines here yet.  Please feel free to add your own.
 
  
=== Decode Video Files ===
+
*[[#OMAP35x|OMAP35x]]
'''NTSC:'''
+
*[[#All|All (commonly requested examples)]]
<pre>
 
gst-launch -v filesrc location=sample.m4v ! TIViddec2 codecName=mpeg4dec engineName=codecServer ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false
 
</pre>
 
 
 
'''PAL:'''
 
<pre>
 
gst-launch -v filesrc location=sample.m4v ! TIViddec2 codecName=mpeg4dec engineName=codecServer ! TIDmaiVideoSink videoStd=D1_PAL videoOutput=composite sync=false
 
</pre>
 
  
=== Decode Audio Files ===
+
== OMAP35x  ==
<span style="color: red">This platform does not have an accelerated audio decoder element.  You can use the ARM based audio decoders "mad", "ffdec_mp3" or [http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-plugin-faad.html "faad"]</span>
 
  
MP3 pipelines:
+
This section covers pipelines for common use cases for the OMAP3530 or DM3730 processor.
  
<pre>
+
=== Environment Requirements  ===
gst-launch filesrc location=sample.mp3 ! mad ! alsasink
+
<blockquote>
gst-launch filesrc location=sample.mp3 ! mp3parse ! ffdec_mp3 ! alsasink
+
{| cellspacing="0" cellpadding="5" border="2" style="color: lightgreen; background-color: black;"
</pre>
+
|-
 +
|
 +
<tt>cd /opt/gstreamer_demo/{{{processor|dm''xxx''}}}/<br> ./loadmodules.sh<br> export GST_REGISTRY=/tmp/gst_registry.bin<br> export LD_LIBRARY_PATH=/opt/gstreamer/lib<br> export GST_PLUGIN_PATH=/opt/gstreamer/lib/gstreamer-0.10<br> export PATH=/opt/gstreamer/bin:$PATH<br> {{{nofbdev|cat /dev/zero > {{{fbdev|/dev/fb''x''}}} 2> /dev/null<br/>}}} </tt>  
  
AAC pipeline:
+
|}
 +
</blockquote>
 +
<span style="color: blue;">''' If you use [http://labs.igep.es/index.php/IGEP_GST_FRAMEWORK_2.00.20 IGEP GST FRAMEWORK 2.00.20] you can use "omapdmaifbsink" instead of "TIDmaiVideoSink" to display the video inside the X windowing system. ''' </span>
  
<pre>
+
=== Loopback: Video  ===
gst-launch filesrc location=sample.aac ! faad ! alsasink
+
<pre>gst-launch -v videotestsrc&nbsp;! TIDmaiVideoSink videoStd=VGA videoOutput=LCD accelFrameCopy=FALSE sync=false
</pre>
+
</pre>  
 +
=== Loopback: Audio  ===
  
=== Decode .AVI Files ===
+
In order to have access to the alsasrc and alsasink plugins perform a 'apt-get install gstreamer0.10-alsa' on the igep board.
The following pipeline assumes you have an AVI file with MPEG-4 Video and MP1L2 or MP3 Audio.  Note that not all MPEG-4 video streams can be played using the DM355 MPEG-4 decoder -- make sure the MPEG-4 stream was encoded with the DM355 MPEG-4 encoder or another compatible encoder.
+
<br>
 
+
<pre>gst-launch audiotestsrc freq=1000 num-buffers=100&nbsp;! alsasink
<pre>
+
</pre>  
gst-launch -v filesrc location=sample.avi ! avidemux name=demux demux.audio_00 ! queue max-size-buffers=8000 max-size-time=0 max-size-bytes=0 ! mad ! alsasink demux.video_00 ! queue ! TIViddec2 ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite
+
If you want to route audio in to audio out (your very own P.A. system), try:
</pre>
+
<pre>gst-launch alsasrc num-buffers=1000&nbsp;! alsasink
 
+
</pre>  
=== Encode Video Files ===
+
If you get a ''Could not open audio device for recording.'' error, likely your ALSA configuration is incorrect. I fixed it with
 
+
<pre>mv /etc/asound.conf /etc/asound.conf.orig
'''videotestsrc (generated video test-bars):'''
+
</pre>  
<pre>
+
to move the ALSA configuration file out of the way.
gst-launch -v videotestsrc num-buffers=2000 ! TIVidenc1 codecName=mpeg4enc engineName=codecServer ! filesink location=output.m4v
 
</pre>
 
 
 
'''v4l2src (Capture):'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=2000 ! TIVidenc1 codecName=mpeg4enc engineName=codecServer contiguousInputFrame=TRUE ! filesink location=output.m4v
 
</pre>
 
 
 
=== Encode Audio Files ===
 
<span style="color: red">This platform does not have an accelerated audio encoder element.  You can use the ARM based audio encoders "lame" or [http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-plugin-faac.html "faac"]</span>
 
 
 
No pipelines here yet.  Please feel free to add your own.
 
 
 
=== Image Encode ===
 
A simple pipeline that converts a UYVY image into JPEG format.
 
 
 
<pre>
 
gst-launch -v filesrc location=sample.yuv ! TIImgenc1 resolution=720x480 iColorSpace=UYVY oColorSpace=YUV420P qValue=75 ! filesink location=output.jpg
 
</pre>
 
 
 
=== Image Decode ===
 
A simple pipeline that converts a JPEG image into UYVY format.
 
 
 
<pre>
 
gst-launch -v filesrc location=sample.jpg ! TIImgdec1 resolution=720x480 ! filesink location=sample.yuv
 
</pre>
 
 
 
=== Resize ===
 
A simple pipeline capturing from v4l2src and resizing to CIF.
 
 
 
<pre>
 
gst-launch v4l2src always-copy=FALSE ! TIVidResize contiguousInputFrame=TRUE ! 'video/x-raw-yuv,width=352,height=288' ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false
 
</pre>
 
 
 
=== Network Streaming ===
 
This section gives example where EVM acts as streaming server, which captures, encodes and transmit via udp. Host PC can be used as client to decode.  
 
 
 
'''MPEG-4 Encode/Stream/Decode:'''<br/>
 
A simple RTP server to encode and transmit MPEG-4
 
 
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE ! TIVidenc1 codecName=mpeg4enc engineName=encode contiguousInputFrame=TRUE ! rtpmp4vpay pt=96 ! udpsink host=<HOST IP ADDRESS> port=5000
 
</pre>
 
When the pipeline starts to run, you'll see something that looks like this:
 
<pre>
 
/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)000001010000012000845d4c28b421e0a21f, payload=(int)96, ssrc=(guint)3412089386, clock-base=(guint)945410414, seqnum-base=(guint)27711
 
</pre>
 
 
 
'''Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this string in client below '''
 
 
 
A simple RTP client to decode MPEG-4 and display on HOST machine
 
 
 
<pre>
 
gst-launch -v udpsrc port=5000 caps="<PASS_CAPS_FROM_SERVER>" ! rtpmp4vdepay ! ffdec_mpeg4 ! xvimagesink
 
</pre>
 
 
 
'''For sending and receiving MPEG-4 with DM355 EVM you can use these 2 pipelines :'''
 
 
 
RTP server side :
 
 
 
<pre>
 
gst-launch -v videotestsrc !  TIVidenc1 codecName=mpeg4enc engineName=encode  ! rtpmp4vpay send-config=true ! udpsink host=<HOST IP ADDRESS> port=5000
 
</pre>
 
 
 
Don't forget to set the "send-config" property to true
 
 
 
 
 
 
 
RTP client side :
 
<pre>
 
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)000001010000012000845d4c285020f0a21f, payload=(int)96, ssrc=(guint)3319524202, clock-base=(guint)4012564513, seqnum-base=(guint)25833" ! rtpmp4vdepay  ! TIViddec2 codecName=mpeg4dec engineName=decode ! TIDmaiVideoSink videoStd=D1_PAL videoOutput=composite sync=false
 
</pre>
 
 
 
Note that client should be started before server
 
  
== DM357 ==
+
=== Loopback: Audio+Video  ===
This section covers pipelines for common use cases for the DM357 processor.
 
  
=== Environment Requirements ===
+
No pipelines here yet. Please feel free to add your own.
{{ti_gst_env|processor=dm357|fbdev=/dev/fb2}}
 
  
'''Notes on DM357 Performance:''' There is a known issue on DM357 where there are intermittent freezes in video and audio playback in some cases.  If you experience this, nicing your gst-launch command to 15 as follows may resolve the issue:
+
=== Decode Video files ===
<pre>
 
nice -n 15 gst-launch .... (rest of gst-launch command)
 
</pre>
 
  
=== Loopback: Video ===
+
'''H.264/VGA:'''
'''v4l2src (Capture):'''
+
<pre>gst-launch -v filesrc location=sample.264&nbsp;! TIViddec2 codecName=h264dec engineName=codecServer&nbsp;! TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false
<pre>
+
</pre>
gst-launch -v v4l2src always-copy=FALSE ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite contiguousInputFrame=TRUE sync=false
+
'''MPEG-4/VGA:'''
</pre>
+
<pre>gst-launch -v filesrc location=sample.m4v&nbsp;! TIViddec2 codecName=mpeg4dec engineName=codecServer&nbsp;! TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false
 +
</pre>
 +
'''MPEG-2/VGA:'''  
 +
<pre>gst-launch -v filesrc location=sample.m2v&nbsp;! TIViddec2 codecName=mpeg2dec engineName=codecServer&nbsp;! TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false
 +
</pre>  
 +
=== Decode Audio Files  ===
  
'''videotestsrc (generated video test-bars):'''
+
'''AAC:'''  
<pre>
+
<pre>gst-launch -v filesrc location=sample.aac&nbsp;! TIAuddec1 codecName=aachedec engineName=codecServer&nbsp;! alsasink sync=false
gst-launch -v videotestsrc ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite accelFrameCopy=FALSE sync=false
+
</pre>  
</pre>
+
=== Decode .MP4 Files  ===
  
=== Loopback: Audio ===
+
The following pipeline assumes you have a VGA .MP4 file with H.264 Video and AAC Audio.
No pipelines here yetPlease feel free to add your own.
+
<pre>gst-launch -v filesrc location=sample.mp4&nbsp;! qtdemux name=demux demux.audio_00&nbsp;! queue max-size-buffers=8000 max-size-time=0 max-size-bytes=0&nbsp;! TIAuddec1&nbsp;! alsasink demux.video_00&nbsp;! queue&nbsp;! TIViddec2&nbsp;! TIDmaiVideoSink videoStd=VGA videoOutput=LCD
 +
</pre>
 +
=== Decode .AVI Files ===
  
=== Loopback: Audio + Video ===
+
The following pipeline assumes you have VGA .AVI file with MPEG-2 or MPEG-4 Video and MP1L2 or MP3 Audio.
No pipelines here yetPlease feel free to add your own.
+
<pre>gst-launch -v filesrc location=sample.avi&nbsp;! avidemux name=demux demux.audio_00&nbsp;! queue max-size-buffers=1200 max-size-time=0 max-size-bytes=0&nbsp;! mad&nbsp;! alsasink demux.video_00&nbsp;! queue&nbsp;! TIViddec2&nbsp;! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0&nbsp;! TIDmaiVideoSink videoStd=VGA videoOutput=LCD
 +
</pre>
 +
=== Decode .TS Files ===
  
=== Decode Video Files ===
+
The following pipeline assumes you have VGA .TS file with H.264 Video and MP1L2 or MP3 Audio.
'''H.264/NTSC:'''
+
<pre>gst-launch filesrc location=sample.ts&nbsp;! typefind&nbsp;! mpegtsdemux name=demux demux.&nbsp;! queue max-size-buffers=1200 max-size-time=0 max-size-bytes=0&nbsp;! typefind&nbsp;! mad&nbsp;! alsasink demux.&nbsp;! typefind&nbsp;! TIViddec2&nbsp;! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0&nbsp;! TIDmaiVideoSink videoStd=VGA videoOutput=LCD
<pre>
+
</pre>  
gst-launch -v filesrc location=sample.264 ! TIViddec codecName=h264dec engineName=hmjcp ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false
+
=== Encode Video Files  ===
</pre>
 
  
'''MPEG-4/NTSC:'''
+
'''H.264/QVGA:'''
<pre>
+
<pre>gst-launch -v videotestsrc num-buffers=2000&nbsp;! TIVidenc1 codecName=h264enc engineName=codecServer&nbsp;! filesink location=sample.264
gst-launch -v filesrc location=sample.m4v ! TIViddec codecName=mpeg4dec engineName=hmjcp ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false
+
</pre>
</pre>
+
'''MPEG-4/QVGA:'''  
 +
<pre>gst-launch -v videotestsrc num-buffers=2000&nbsp;! TIVidenc1 codecName=mpeg4enc engineName=codecServer&nbsp;! filesink location=sample.m4v
 +
</pre>  
 +
=== Encode Video in Container  ===
  
=== Decode Audio Files ===
+
'''Encode H.264 in quicktime container (Capture):'''
<span style="color: red">This platform does not have an accelerated audio decoder element.  You can use the ARM based audio decoders "mad" or [http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-plugin-faad.html "faac"]</span>
+
<pre>gst-launch -v videotestsrc num-buffers=2000&nbsp;! TIVidenc1 codecName=h264enc engineName=codecServer byteStream=FALSE&nbsp;! qtmux&nbsp;! filesink location=sample.mp4
 +
</pre>
 +
<br>  
  
No pipelines here yet. Please feel free to add your own.
+
=== Image Encode ===
  
=== Decode .MP4 Files ===
+
A simple pipeline to encode YUV420P image
No pipelines here yet. Please feel free to add your own.
+
<pre>gst-launch filesrc location=sample.yuv&nbsp;! TIImgenc1 resolution=720x480 iColorSpace=UYVY oColorSpace=YUV420P qValue=75&nbsp;! filesink location=sample.jpeg
 +
</pre>
 +
=== Image Decode ===
  
=== Decode .AVI Files ===
 
The following pipeline assumes you have an AVI file with MPEG-2 or MPEG-4 Video and MP1L2 or MP3 Audio.
 
 
<pre>
 
gst-launch -v filesrc location=sample.avi ! avidemux name=demux demux.audio_00 ! queue max-size-buffers=8000 max-size-time=0 max-size-bytes=0 ! mad ! alsasink demux.video_00 ! queue ! TIViddec ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite
 
</pre>
 
 
=== Encode Video Files ===
 
'''H.264/v4l2src (Capture):'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=2000 ! TIVidenc codecName=h264enc engineName=hmjcp contiguousInputFrame=TRUE ! filesink location=sample.264
 
</pre>
 
 
'''MPEG-4/v4l2src (Capture):'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=2000 ! TIVidenc codecName=mpeg4enc engineName=hmjcp contiguousInputFrame=TRUE ! filesink location=sample.m4v
 
</pre>
 
 
'''H.264/videotestsrc (generated video test-bars):'''
 
<pre>
 
gst-launch -v videotestsrc num-buffers=2000 ! TIVidenc codecName=h264enc engineName=hmjcp ! filesink location=sample.264
 
</pre>
 
 
'''MPEG-4/videotestsrc (generated video test-bars):'''
 
<pre>
 
gst-launch -v videotestsrc num-buffers=2000 ! TIVidenc codecName=mpeg4enc engineName=hmjcp ! filesink location=sample.m4v
 
</pre>
 
 
=== Encode Video in Container ===
 
''' Encode H.264 in quicktime container (Capture):'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=2000 ! TIVidenc codecName=h264enc engineName=hmjcp contiguousInputFrame=TRUE byteStream=FALSE ! qtmux ! filesink location=sample.mp4
 
</pre>
 
 
<pre>
 
gst-launch -v videotestsrc num-buffers=2000 ! TIVidenc codecName=h264enc engineName=hmjcp byteStream=FALSE ! qtmux ! filesink location=sample.mp4
 
</pre>
 
 
 
=== Image Encode ===
 
A simple pipeline that converts a YUV422P image into JPEG format.
 
<pre>
 
gst-launch filesrc location=sample.yuv ! TIImgenc resolution=720x480 iColorSpace=UYVY oColorSpace=YUV422P qValue=75 ! filesink location=sample.jpg
 
</pre>
 
 
=== Image Decode ===
 
 
A simple pipeline that converts a JPEG image into UYVY format.  
 
A simple pipeline that converts a JPEG image into UYVY format.  
<pre>
+
<pre>gst-launch filesrc location=sample.jpeg&nbsp;! TIImgdec1 codecName=jpegdec engineName=codecServer &nbsp;! filesink location=sample.uyvy
gst-launch filesrc location=sample.jpg ! TIImgdec resolution=720x480 ! filesink location=sample.yuv
+
</pre>  
</pre>
+
=== Resize ===
 
 
=== Resize ===
 
A simple pipeline capturing from v4l2src and resizing to CIF.
 
 
 
<pre>
 
gst-launch v4l2src always-copy=FALSE ! TIVidResize contiguousInputFrame=TRUE ! 'video/x-raw-yuv,width=352,height=288' ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite accelFrameCopy=FALSE sync=false
 
</pre>
 
 
 
=== Network Streaming ===
 
This section gives example where EVM acts as streaming server, which captures, encodes and transmit via udp. Host PC can be used as client to decode.
 
  
'''H.264 Encode/Stream/Decode:'''<br/>
+
A simple pipeline receiving CIF from videotestsrc and resizing to VGA.  
A simple RTP server to be run on EVM.
+
<pre>gst-launch videotestsrc&nbsp;! 'video/x-raw-yuv,width=352,height=288'&nbsp;! TIVidResize&nbsp;! 'video/x-raw-yuv,width=640,height=480'&nbsp;! TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false
<pre>
+
</pre>  
gst-launch -v v4l2src always-copy=FALSE ! TIVidenc codecName=h264enc engineName=hmjcp contiguousInputFrame=TRUE ! rtph264pay pt=96 ! udpsink host=<HOST_PC_IP> port=5000
+
=== Network Streaming  ===
</pre>
 
When the pipeline starts to run, you'll see something that looks like this:
 
<pre>
 
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, profile-level-id=(string)42801e, sprop-parameter-sets=(string)\"Z0KAHtoC0PRA\\,aM48gA\\=\\=\", payload=(int)96, ssrc=(guint)895989858, clock-base=(guint)3971488929, seqnum-base=(guint)34821
 
</pre>
 
  
'''Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this string in client below '''
+
==== Audio RTP Streaming  ====
  
A simple RTP client to be run on Host PC (Linux).
+
Although these examples are using a target device and a host PC, you could use two target devices as well.  
  
<pre>
+
Case 1: sending audio from target (BeagleBoard in my case) to Ubuntu host:
gst-launch -v udpsrc port=5000 caps="<CAPS_FROM_SERVER>" ! rtph264depay ! ffdec_h264 ! xvimagesink
 
</pre>
 
  
== DM644x ==
+
On target:
This section covers pipelines for common use cases for the DM644x processor.
+
<pre>gst-launch audiotestsrc freq=1000&nbsp;! mulawenc&nbsp;! rtppcmupay&nbsp;! udpsink host=&lt;HOST_PC_IP&gt; port=5555
 +
</pre>
 +
On host:
 +
<pre>gst-launch udpsrc port=5555 caps="application/x-rtp"&nbsp;! queue&nbsp;! rtppcmudepay&nbsp;! mulawdec&nbsp;! audioconvert&nbsp;! alsasink
 +
</pre>
  
=== Environment Requirements ===
+
<br> Case 2: sending audio from Ubuntu host to target (BeagleBoard)
{{ti_gst_env|processor=dm6446|fbdev=/dev/fb2}}
 
  
=== Loopback: Video ===
+
On host:  
'''v4l2src (Capture):'''
+
<pre>gst-launch audiotestsrc freq=1000&nbsp;! mulawenc&nbsp;! rtppcmupay&nbsp;! udpsink host=&lt;TARGET_PC_IP&gt;  port=5555
<pre>
+
</pre>
gst-launch -v v4l2src always-copy=FALSE ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite contiguousInputFrame=TRUE sync=false
+
On target
</pre>
+
<pre>gst-launch udpsrc port=5555 caps="application/x-rtp"&nbsp;! queue&nbsp;! rtppcmudepay&nbsp;! mulawdec&nbsp;! audioconvert&nbsp;! alsasink
 +
</pre>  
 +
The above example experienced dropped audio, please update pipeline when you get it working properly.<br>
 +
I had the same problem using my IGEP WLAN interface. After direct connect with Ethernet cable the dropped audio problem was solved.
  
'''videotestsrc (generated video test-bars):'''
+
I also used these pipelines:<br>
<pre>
+
On host:
gst-launch -v videotestsrc ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite accelFrameCopy=FALSE sync=false
+
<pre>gst-launch filesrc location=DownUnder.mp3 ! mad ! audioconvert ! audio/x-raw-int,channels=1,depth=16,width=16,\
</pre>
+
rate=44100 ! rtpL16pay ! udpsink host=192.168.2.8 port=5000
 
 
=== Loopback: Audio ===
 
No pipelines here yet.  Please feel free to add your own.
 
 
 
=== Loopback:  Audio + Video ===
 
No pipelines here yet.  Please feel free to add your own.
 
 
 
=== Decode Video Files ===
 
'''H.264/NTSC:'''
 
<pre>
 
gst-launch -v filesrc location=sample.264 ! TIViddec2 codecName=h264dec engineName=decode ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false
 
</pre>
 
 
 
'''MPEG-2/NTSC:'''
 
<pre>
 
gst-launch -v filesrc location=sample.m2v ! TIViddec2 codecName=mpeg2dec engineName=decode ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false
 
</pre>
 
 
 
'''MPEG-4/NTSC:'''
 
<pre>
 
gst-launch -v filesrc location=sample.m4v ! TIViddec2 codecName=mpeg4dec engineName=decode ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false
 
</pre>
 
 
 
=== Decode Audio Files ===
 
'''AAC:'''
 
<pre>
 
gst-launch -v filesrc location=sample.aac ! TIAuddec1 codecName=aachedec engineName=decode ! alsasink sync=false
 
</pre>
 
 
 
=== Decode .MP4 Files ===
 
The following pipeline assumes you have an .MP4 file with H.264 Video and AAC Audio.
 
 
 
<pre>
 
gst-launch -v filesrc location=sample.mp4 ! qtdemux name=demux demux.audio_00 ! queue max-size-buffers=8000 max-size-time=0 max-size-bytes=0 ! TIAuddec1 ! alsasink demux.video_00 !  queue ! TIViddec2 ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite
 
</pre>
 
 
 
=== Decode .AVI Files ===
 
The following pipeline assumes you have an .AVI file with MPEG-2 or MPEG-4 Video and MP1L2 or MP3 Audio.
 
<pre>
 
gst-launch -v filesrc location=sample.avi ! avidemux name=demux demux.audio_00 ! queue max-size-buffers=1200 max-size-time=0 max-size-bytes=0 ! mad ! alsasink demux.video_00 ! queue ! TIViddec2 ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite
 
</pre>
 
 
 
=== Decode .TS Files ===
 
The following pipeline assumes you have an transport stream file with H.264 Video and MP1L2 or MP3 Audio.
 
<pre>
 
gst-launch filesrc location=sample.ts ! typefind ! mpegtsdemux name=demux demux. ! queue max-size-buffers=1200 max-size-time=0 max-size-bytes=0 ! typefind ! mad ! alsasink demux. ! typefind ! TIViddec2 ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=COMPOSITE
 
</pre>
 
 
 
=== Encode Video Files ===
 
'''H.264/v4l2src (Capture):'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=2000 ! TIVidenc1 codecName=h264enc engineName=encode contiguousInputFrame=TRUE ! filesink location=sample.264
 
</pre>
 
 
 
'''MPEG-4/v4l2src (Capture):'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=2000 ! TIVidenc1 codecName=mpeg4enc engineName=encode contiguousInputFrame=TRUE ! filesink location=sample.m4v
 
</pre>
 
 
 
'''H.264/videotestsrc (generated video test-bars):'''
 
<pre>
 
gst-launch -v videotestsrc num-buffers=2000 ! TIVidenc1 codecName=h264enc engineName=encode ! filesink location=sample.264
 
</pre>
 
 
 
'''MPEG-4/videotestsrc (generated video test-bars):'''
 
<pre>
 
gst-launch -v videotestsrc num-buffers=2000 ! TIVidenc1 codecName=mpeg4enc engineName=encode ! filesink location=sample.m4v
 
</pre>
 
 
 
=== Encode Video in Container ===
 
''' Encode H.264 in quicktime container (Capture):'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=2000 ! TIVidenc1 codecName=h264enc engineName=encode contiguousInputFrame=TRUE byteStream=FALSE ! qtmux ! filesink location=sample.mp4
 
</pre>
 
 
 
<pre>
 
gst-launch -v videotestsrc num-buffers=2000 ! TIVidenc1 codecName=h264enc engineName=encode byteStream=FALSE ! qtmux ! filesink location=sample.mp4
 
</pre>
 
 
 
 
 
=== Resize ===
 
A simple pipeline capturing from v4l2src and resizing to CIF.
 
 
 
<pre>
 
gst-launch v4l2src always-copy=FALSE ! TIVidResize contiguousInputFrame=TRUE ! 'video/x-raw-yuv,width=352,height=288' ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false accelFrameCopy=FALSE
 
</pre>
 
 
 
=== Network Streaming ===
 
This section gives example where EVM acts as streaming server, which captures, encodes and transmit via udp. Host PC can be used as client to decode.
 
 
 
'''H.264 Encode/Stream/Decode:'''<br/>
 
A simple RTP server to be run on EVM.
 
 
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE ! TIVidenc1 codecName=h264enc engineName=encode contiguousInputFrame=TRUE ! rtph264pay pt=96 ! udpsink host=<HOST_PC_IP> port=5000
 
</pre>
 
When the pipeline starts to run, you'll see something that looks like this:
 
<pre>
 
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, profile-level-id=(string)42801e, sprop-parameter-sets=(string)\"Z0KAHtoC0PRA\\,aM48gA\\=\\=\", payload=(int)96, ssrc=(guint)895989858, clock-base=(guint)3971488929, seqnum-base=(guint)34821
 
</pre>
 
 
 
'''Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this string in client below '''
 
 
 
A simple RTP client to be run on Host PC (Linux).
 
 
 
<pre>
 
gst-launch -v udpsrc port=5000 caps="<PASS_CAPS_FROM_SERVER>" ! rtph264depay ! ffdec_h264 ! xvimagesink
 
</pre>
 
 
 
'''MPEG-4 Encode/Stream/Decode:'''<br/>
 
A simple RTP server to encode and transmit MPEG-4
 
 
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE ! TIVidenc1 codecName=mpeg4enc engineName=encode contiguousInputFrame=TRUE ! rtpmp4vpay pt=96 ! udpsink host=128.247.105.80 port=5000
 
</pre>
 
When the pipeline starts to run, you'll see something that looks like this:
 
<pre>
 
/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)5, config=(string)000001b005000001b509000001000000012000847a9828b421e0a31f, payload=(int)96, ssrc=(guint)302303174, clock-base=(guint)347576712, seqnum-base=(guint)48616
 
</pre>
 
 
 
'''Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this string in client below '''
 
 
 
A simple RTP client to decodes MPEG-4 and display on HOST machine
 
 
 
<pre>
 
gst-launch -v udpsrc port=5000 caps="<PASS_CAPS_FROM_SERVER>" ! rtpmp4vdepay ! ffdec_mpeg4 ! xvimagesink
 
</pre>
 
 
 
'''MPEG-4 Receive/Decode/Display:'''<br/>
 
 
 
This section gives example where EVM acts as RTP client, which receives encoded stream via udp then decodes and display output. Host PC can be used as server to transmit encoded stream.
 
 
 
A simple RTP server which encodes and transmits MPEG-4 on DM6446 EVM.
 
<pre>
 
gst-launch-0.10 videotestsrc  ! 'video/x-raw-yuv,width=720,height=480' ! ffenc_mpeg4 ! rtpmp4vpay ! udpsink host=<EVM_IP_ADDR> port=5000  -v
 
</pre>
 
 
 
'''Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this string in client below '''
 
 
 
A simple RTP client to receive and decode the MPEG-4 encoded stream.
 
 
 
<pre>
 
gst-launch -v udpsrc port=5000 caps="<CAPS_FROM_SERVER>" ! rtpmp4vdepay  ! TIViddec2 !  TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false
 
</pre>
 
 
 
== DM365 ==
 
This section covers pipelines for common use cases for the DM365 processor.
 
 
 
=== Environment Requirements ===
 
{{ti_gst_env|processor=dm365|fbdev=/dev/fb2}}
 
 
 
Please see some special notes while playing 720P clip [https://gstreamer.ti.com/gf/project/gstreamer_ti/wiki/?pagename=NotesOnDM365Performance here]
 
 
 
=== Loopback: Video ===
 
'''Generated_D1 (videotestsrc):'''
 
<pre>
 
gst-launch -v videotestsrc ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite accelFrameCopy=FALSE sync=false
 
</pre>
 
 
 
''' Capture_D1 (v4l2src):'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE input-src=composite ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite contiguousInputFrame=TRUE sync=false
 
</pre>
 
 
 
'''Capture_720P (v4l2src):'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE  ! TIDmaiVideoSink videoStd=720P_60 videoOutput=component contiguousInputFrame=TRUE sync=false
 
</pre>
 
 
 
=== Loopback: Audio ===
 
 
 
'''Generated audio tone (audiotestsrc):'''
 
<pre>
 
gst-launch audiotestsrc num-buffers=1000 ! alsasink
 
</pre>
 
 
 
'''Captured audio (alsasrc):'''
 
<pre>
 
gst-launch -v alsasrc ! alsasink sync=false
 
</pre>
 
 
 
=== Loopback:  Audio + Video ===
 
No pipelines here yet.  Please feel free to add your own.
 
 
 
=== Decode Video Files ===
 
'''MPEG-4 -> NTSC_D1:'''
 
<pre>
 
gst-launch -v filesrc location=sample_ntsc_D1.mpeg4 !  TIViddec2 engineName=codecServer codecName=mpeg4dec ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=COMPOSITE sync=FALSE
 
</pre>
 
 
 
'''MPEG-4 -> PAL_D1:'''
 
<pre>
 
gst-launch -v filesrc location=sample_pal_D1.mpeg4 !  TIViddec2 engineName=codecServer codecName=mpeg4dec ! TIDmaiVideoSink videoStd=D1_PAL videoOutput=COMPOSITE sync=FALSE
 
</pre>
 
 
 
'''MPEG-4 -> NTSC_720P:'''
 
<pre>
 
gst-launch -v filesrc location=sample_720p.mpeg4 ! TIViddec2 codecName=mpeg4dec engineName=codecServer ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 !TIDmaiVideoSink videoStd=720P_60 videoOutput=COMPONENT sync=FALSE hideOSD=TRUE
 
 
</pre>
 
</pre>
 
 
'''H.264 -> NTSC_D1:'''
 
<pre>
 
gst-launch -v filesrc location=sample_D1.264 ! TIViddec2 engineName=codecServer codecName=h264dec ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=COMPOSITE sync=FALSE
 
</pre>
 
 
'''H.264 -> NTSC_720P:'''
 
<pre>
 
gst-launch -v filesrc location=sample_720P.264 ! TIViddec2 codecName=h264dec engineName=codecServer ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 ! TIDmaiVideoSink videoStd=720P_60 videoOutput=component sync=false hideOSD=TRUE
 
</pre>
 
 
 
'''MPEG-2 -> NTSC_D1:'''
 
<pre>
 
gst-launch filesrc location=sample_D1.m2v ! TIViddec2 engineName=codecServer codecName=mpeg2dec ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=COMPOSITE sync=FALSE
 
</pre>
 
 
'''MPEG-2 -> NTSC_720P:'''
 
<pre>
 
gst-launch filesrc location=sample_720p.m2v ! TIViddec2 engineName=codecServer codecName=mpeg2dec ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 ! TIDmaiVideoSink videoStd=720P_60 videoOutput=component sync=false hideOSD=TRUE
 
</pre>
 
 
=== Decode Audio Files ===
 
'''AAC:'''<br/>
 
<pre>
 
gst-launch -v filesrc location=sample.aac ! TIAuddec1 codecName=aacdec engineName=codecServer ! alsasink sync=false
 
</pre>
 
 
=== Decode Container Files ===
 
'''AVI (MPEG-4 / MP3):'''<br/>
 
<pre>
 
gst-launch filesrc location=sample.avi ! avidemux name=demux demux.audio_00 ! queue max-size-buffers=1200 max-size-time=0 max-size-bytes=0 ! mad ! alsasink demux.video_00 ! TIViddec2 engineName=codecServer codecName=mpeg4dec ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=COMPOSITE sync=FALSE
 
</pre>
 
 
=== Encode Video Files ===
 
 
'''Generated_D1 (videotestsrc) -> MPEG-4:'''<br/>
 
<pre>
 
gst-launch videotestsrc num-buffers=1000 ! video/x-raw-yuv, format=(fourcc)NV12 ! TIVidenc1 codecName=mpeg4enc engineName=codecServer ! filesink location=output_gen_D1.m4v
 
</pre>
 
 
'''YUV_D1 -> MPEG-4:'''<br/>
 
<pre>
 
gst-launch filesrc location=sample_nv12.yuv ! video/x-raw-yuv, format=(fourcc)NV12, width=320, height=240, framerate=(fraction)30/1 ! TIVidenc1 codecName=mpeg4enc engineName=codecServer ! filesink location=output_yuv_D1.m4v
 
</pre>
 
 
'''Captured_D1 (v4l2src) -> MPEG-4:'''<br/>
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=800 input-src=composite ! video/x-raw-yuv,format=(fourcc)NV12,width=720,height=480 ! TIVidenc1 codecName=mpeg4enc engineName=codecServer ! filesink location=output_cap_D1.m4v
 
</pre>
 
 
'''Captured_720P (v4l2src) -> MPEG-4:'''<br/>
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=800 input-src=COMPONENT ! video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720 ! TIVidenc1 codecName=mpeg4enc engineName=codecServer contiguousInputFrame=TRUE ! filesink location=output_cap_720P.m4v
 
</pre>
 
 
 
'''Generated_D1 (videotestsrc) -> H.264:'''<br/>
 
<pre>
 
gst-launch videotestsrc num-buffers=1000 ! video/x-raw-yuv, format=(fourcc)NV12 ! TIVidenc1 codecName=h264enc engineName=codecServer ! filesink location=output_gen_D1.264
 
</pre>
 
 
'''YUV_D1 -> H.264:'''<br/>
 
<pre>
 
gst-launch filesrc location=sample_nv12.yuv ! video/x-raw-yuv, format=(fourcc)NV12, width=320, height=240, framerate=(fraction)30/1 ! TIVidenc1 codecName=h264enc engineName=codecServer ! filesink location=output_yuv_D1.264
 
</pre>
 
 
'''Captured_D1 (v4l2src) -> H.264:'''<br/>
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=800 input-src=composite ! video/x-raw-yuv,format=(fourcc)NV12,width=720,height=480 ! TIVidenc1 codecName=h264enc engineName=codecServer ! filesink location=output_cap_D1.264
 
</pre>
 
 
'''Captured_720P (v4l2src) -> H.264:'''<br/>
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=800 input-src=COMPONENT ! video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720 ! TIVidenc1 codecName=h264enc engineName=codecServer contiguousInputFrame=TRUE ! filesink location=output_cap_720P.264
 
</pre>
 
 
 
'''Generated_D1 (videotestsrc) -> MPEG-2:'''<br/>
 
<pre>
 
gst-launch videotestsrc num-buffers=1000 ! video/x-raw-yuv, format=(fourcc)NV12 ! TIVidenc1 codecName=mpeg2enc engineName=codecServer ! filesink location=output_gen_D1.m2v
 
</pre>
 
 
'''YUV_D1 -> MPEG-2:'''<br/>
 
<pre>
 
gst-launch filesrc location=sample_nv12.yuv ! video/x-raw-yuv, format=(fourcc)NV12, width=320, height=240, framerate=(fraction)30/1 ! TIVidenc1 codecName=mpeg2enc engineName=codecServer ! filesink location=output_yuv_D1.m2v
 
</pre>
 
 
'''Captured_D1 (v4l2src) -> MPEG-2:'''<br/>
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=800 input-src=composite ! video/x-raw-yuv,format=(fourcc)NV12,width=720,height=480 ! TIVidenc1 codecName=mpeg2enc engineName=codecServer ! filesink location=output_cap_D1.m2v
 
</pre>
 
 
'''Captured_720P (v4l2src) -> MPEG-2:'''<br/>
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=800 input-src=COMPONENT ! video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720 ! TIVidenc1 codecName=mpeg2enc engineName=codecServer contiguousInputFrame=TRUE ! filesink location=output_cap_720P.m2v
 
</pre>
 
 
=== Encode Audio Files ===
 
''' Captured (alsasrc) -> AAC:'''
 
<pre>
 
gst-launch -v alsasrc num-buffers=1000 ! TIAudenc1 codecName=aaclcenc engineName=codecServer ! filesink location=output.aac
 
</pre>
 
 
''' Captured (alsasrc) -> AAC + PlayBack:'''
 
<pre>
 
gst-launch -v alsasrc num-buffers=1000 ! audio/x-raw-int, endianness=1234, signed=true, width=16, depth=16, rate=44100, channels=2 ! tee name=t ! queue ! TIAudenc1 bitrate=64000 engineName=codecServer codecName=aaclcenc ! filesink location=output.aac t. ! queue ! alsasink sync=false
 
</pre>
 
 
''' PCM File -> AAC + PlayBack:'''
 
<pre>
 
gst-launch filesrc location=sample.pcm ! audio/x-raw-int, endianness=1234, signed=true, width=16, depth=16, rate=44100, channels=2 ! tee name=t ! queue ! TIAudenc1 bitrate=64000 engineName=codecServer codecName=aaclcenc ! filesink location=output.aac t. ! queue ! alsasink sync=false
 
</pre>
 
 
=== Encode Video in Container ===
 
''' Generated_D1 (videotestsrc) -> H.264 -> Quicktime container:'''
 
<pre>
 
gst-launch -v videotestsrc num-buffers=2000 ! 'video/x-raw-yuv,format=(fourcc)NV12' ! TIVidenc1 codecName=h264enc engineName=codecServer byteStream=FALSE ! qtmux ! filesink location=output_gen_.mp4
 
</pre>
 
 
''' Captured_D1 (v4l2src) -> H.264 -> Quicktime container:'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=2000 input-src=composite ! video/x-raw-yuv,format=(fourcc)NV12,width=720,height=480 ! TIVidenc1 codecName=h264enc engineName=codecServer byteStream=FALSE ! qtmux ! filesink location=output_cap_.mp4
 
</pre>
 
 
=== Image Encode ===
 
''' UYVY -> JPEG:'''
 
<pre>
 
gst-launch filesrc location=sample_720x480.yuv ! TIImgenc1 resolution=720x480 iColorSpace=UYVY oColorSpace=YUV420P qValue=75 engineName=codecServer ! filesink location=output.jpg
 
</pre>
 
 
=== Image Decode ===
 
''' JPEG -> UYVY:'''
 
<pre>
 
gst-launch filesrc location=sample_720x480.jpg ! TIImgdec1 resolution=720x480 engineName=codecServer ! filesink location=output.yuv
 
</pre>
 
 
=== Resize ===
 
''' Generated_CIF (videotestsrc) -> D1:'''
 
<pre>
 
gst-launch videotestsrc ! video/x-raw-yuv, width=352, height=288, framerate=(fraction)30/1 ! TIVidResize ! video/x-raw-yuv,width=640,height=480, framerate=(fraction)30/1 ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=COMPOSITE sync=false
 
</pre>
 
 
''' Captured_D1 (v4l2src) -> CIF:'''
 
<pre>
 
gst-launch v4l2src always-copy=FALSE input-src=composite ! TIVidResize contiguousInputFrame=TRUE ! 'video/x-raw-yuv,width=352,height=288' !  TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false
 
</pre>
 
 
'''''Note:  To use the resize element as shown above, the IPIPE module must be configured in single-shot modeby setting "dm365_imp.oper_mode=1" in the kernel bootargs.'''''
 
 
=== Network Streaming ===
 
This section gives example where EVM acts as streaming server, which captures, encodes and transmit via udp. Host PC can be used as client to decode.
 
 
'''MPEG-4 Encode/Stream/Decode:'''<br/>
 
A simple RTP server to encode and transmit MPEG-4
 
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE ! TIVidenc1 codecName=mpeg4enc engineName=encode contiguousInputFrame=TRUE ! rtpmp4vpay pt=96 ! udpsink host=<HOST_PC_IP> port=5000
 
</pre>
 
When the pipeline starts to run, you'll see something that looks like this:
 
<pre>
 
/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)000001010000012000845d4c28b42240a21f, payload=(int)96, ssrc=(guint)543171998, clock-base=(guint)1153531416, seqnum-base=(guint)45441
 
</pre>
 
 
'''Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this string in client below '''
 
 
A simple RTP client to decodes MPEG-4 and display on HOST machine
 
 
<pre>
 
gst-launch-0.10 -v udpsrc port=5000 caps="<CAP_FROM_SERVER>" ! rtpmp4vdepay ! ffdec_mpeg4 ! xvimagesink
 
</pre>
 
 
 
'''H.264 Receive/Decode/Display:'''<br/>
 
 
This section gives example where EVM acts as RTP client, which receives encoded stream via udp then decodes and display output. Host PC can be used as server to transmit encoded stream.
 
 
A simple RTP client to recieve and decode the H.264 encoded stream.
 
 
<pre>
 
gst-launch -v udpsrc port=5000 ! 'application/x-rtp, media=video, payload=96, clock-rate=90000, encoding-name=H264' ! rtph264depay  ! TIViddec2 !  TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false
 
</pre>
 
 
A simple RTP server which encodes and transmits H.264 to the DM365 EVM ('''Note''': this is a command for a host Linux PC).
 
<pre>
 
gst-launch-0.10 -vvv videotestsrc ! x264enc byte-stream=true bitrate=300 ! rtph264pay ! udpsink port=5000 host=<EVM_IP_ADDR> sync=false
 
</pre>
 
 
'''Note: first run the client then server'''
 
 
== DM6467 ==
 
This section covers pipelines for common use cases for the DM6467 processor.
 
 
=== Environment Requirements ===
 
{{ti_gst_env|processor=dm6467|nofbdev=}}
 
 
=== Loopback: Video ===
 
'''v4l2src (Capture):'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE  ! TIDmaiVideoSink videoStd=720P_60 videoOutput=component contiguousInputFrame=TRUE sync=false
 
</pre>
 
 
'''videotestsrc (generated video test-bars):'''<br/>
 
<span style="color: red">TIDmaiVideoSink does not support videotestsrc for DM6467.</span>
 
 
=== Loopback: Audio ===
 
'''alsasrc (Capture):'''
 
<pre>
 
gst-launch alsasrc ! alsasink
 
</pre>
 
 
'''audiotestsrc (generated audio tone):'''
 
<pre>
 
gst-launch audiotestsrc num-buffers=1000 ! alsasink
 
</pre>
 
 
=== Loopback:  Audio + Video ===
 
No pipelines here yet.  Please feel free to add your own.
 
 
=== Decode Video Files ===
 
'''H.264/1080i30:'''
 
<pre>
 
gst-launch filesrc use-mmap=true blocksize=40960 location=sample.264 ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=2097152 ! TIViddec2 genTimeStamps=FALSE engineName=decode codecName=h264dec ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 ! TIDmaiVideoSink videoStd=1080I_30
 
</pre>
 
 
'''MPEG-2/1080i30:'''
 
<pre>
 
gst-launch filesrc use-mmap=true blocksize=40960 location=sample.m2v ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=2097152 ! TIViddec2 genTimeStamps=FALSE engineName=decode codecName=mpeg2dec ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 ! TIDmaiVideoSink videoStd=1080I_30
 
</pre>
 
 
=== Decode Audio Files ===
 
'''AAC:'''
 
<pre>
 
gst-launch -v filesrc location=sample.aac ! TIAuddec1 codecName=aachedec engineName=decode ! alsasink sync=false
 
</pre>
 
 
=== Decode .MP4 Files ===
 
The following pipeline assumes you have an .MP4 file with H.264 Video and AAC Audio.
 
<pre>
 
gst-launch -v filesrc location=sample.mp4 ! qtdemux name=demux demux.audio_00 ! queue max-size-buffers=8000 max-size-time=0 max-size-bytes=0 ! TIAuddec1 ! alsasink demux.video_00 ! queue ! TIViddec2 ! TIDmaiVideoSink videoStd=1080P_30
 
</pre>
 
 
=== Decode .AVI Files ===
 
The following pipeline assumes you have an .AVI file with MPEG-2 Video and MP1L2 or MP3 Audio.
 
<pre>
 
gst-launch -v filesrc location=sample.avi ! avidemux name=demux demux.audio_00 ! queue max-size-buffers=8000 max-size-time=0 max-size-bytes=0 ! mad ! alsasink demux.video_00 ! queue ! TIViddec2 ! TIDmaiVideoSink videoStd=1080P_30
 
</pre>
 
 
=== Decode .TS Files ===
 
The following pipeline assumes you have an transport stream file with H.264 Video and MP1L2 or MP3 Audio.
 
<pre>
 
gst-launch -v filesrc location=sample.ts ! typefind ! mpegtsdemux name=demux demux. ! audio/mpeg ! queue max-size-buffers=1200 max-size-time=0 max-size-bytes=0 ! typefind ! mad ! alsasink demux. ! video/x-h264 ! typefind ! TIViddec2 ! TIDmaiVideoSink videoStd=1080P_30
 
</pre>
 
 
=== Encode Video Files ===
 
'''H.264/v4l2src (Capture):'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=2000 ! TIVidenc1 codecName=h264enc engineName=encode contiguousInputFrame=TRUE ! filesink location=sample.264
 
</pre>
 
 
'''H.264/videotestsrc (generated video test-bars):'''
 
<pre>
 
gst-launch -v videotestsrc num-buffers=2000 ! 'video/x-raw-yuv,format=(fourcc)NV12' ! TIVidenc1 codecName=h264enc engineName=encode ! filesink location=sample.264
 
</pre>
 
 
=== Encode Video in Container ===
 
''' Encode H.264 in quicktime container (Capture):'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=2000 ! TIVidenc1 codecName=h264enc engineName=encode contiguousInputFrame=TRUE byteStream=FALSE ! qtmux ! filesink location=sample.mp4
 
</pre>
 
 
<pre>
 
gst-launch -v videotestsrc num-buffers=2000 ! 'video/x-raw-yuv,format=(fourcc)NV12' ! TIVidenc1 codecName=h264enc engineName=encode byteStream=FALSE ! qtmux ! filesink location=sample.mp4
 
</pre>
 
 
=== Encode Audio Files ===
 
'''AAC/alsasrc (Capture):'''
 
<pre>
 
gst-launch -v alsasrc ! TIAudenc1 codecName=aacheenc engineName=encode ! filesink location=sample.aac
 
</pre>
 
 
'''AAC/alsasrc (Capture+Playback):'''
 
This pipeline encodes 2000 buffers of audio data before exiting.
 
<pre>
 
gst-launch -v alsasrc num-buffers=2000 ! audio/x-raw-int, endianness=1234, signed=true, width=16, depth=16, rate=44100, channels=2 ! tee name=t ! queue ! TIAudenc1 bitrate=64000 engineName=encode codecName=aacheenc ! filesink location=sample.aac t. ! queue ! alsasink sync=false
 
</pre>
 
 
'''AAC/filesrc (PCM input file):'''
 
This pipeline encodes 2000 buffers of audio data before exiting. You will need to create a PCM file. You can do so by decoding an audio file and sending the output to the filesink.
 
 
<pre>
 
gst-launch filesrc location=sample.pcm ! audio/x-raw-int, endianness=1234, signed=true, width=16, depth=16, rate=44100, channels=2 ! tee name=t ! queue ! TIAudenc1 bitrate=64000 engineName=encode codecName=aacheenc ! filesink location=sample.aac t. ! queue ! alsasink sync=false
 
</pre>
 
 
=== Resize ===
 
A simple pipeline capturing from v4l2src and resizing to CIF.
 
 
<pre>
 
gst-launch v4l2src always-copy=FALSE ! TIVidResize contiguousInputFrame=TRUE ! 'video/x-raw-yuv,width=352,height=288,format=(fourcc)Y8C8' ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false
 
</pre>
 
 
=== Network Streaming ===
 
This section gives example where EVM acts as streaming server, which captures, encodes and transmit via udp. Host PC can be used as client to decode.
 
 
'''H.264 Encode/Stream/Decode:'''<br/>
 
A simple RTP server to be run on EVM.
 
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE ! TIVidenc1 codecName=h264enc engineName=encode contiguousInputFrame=TRUE ! rtph264pay pt=96 ! udpsink host=<HOST_PC_IP> port=5000
 
</pre>
 
When the pipeline starts to run, you'll see something that looks like this:
 
<pre>
 
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, profile-level-id=(string)42801f, sprop-parameter-sets=(string)\"Z0KAH/QFoeiA\\,aN48gA\\=\\=\", payload=(int)96, ssrc=(guint)521259813, clock-base=(guint)1231006457, seqnum-base=(guint)2761
 
</pre>
 
 
'''Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this string in client below '''
 
 
A simple RTP client to be run on Host PC (Linux).
 
<pre>
 
gst-launch-0.10 -v udpsrc port=5000 caps="<CAP_FROM_SERVER>" ! rtph264depay ! ffdec_h264 ! xvimagesink
 
</pre>
 
 
== DM6467T ==
 
This section covers pipelines for common use cases for the DM6467T processor.
 
 
=== Environment Requirements ===
 
{{ti_gst_env|processor=dm6467|nofbdev=}}
 
 
=== Loopback: Video ===
 
'''Generated (videotestsrc):'''<br/>
 
<span style="color: red">TIDmaiVideoSink does not support videotestsrc for DM6467T.</span>
 
 
'''Capture_720P (v4l2src):'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE  ! TIDmaiVideoSink videoStd=720P_60 videoOutput=component contiguousInputFrame=TRUE sync=false
 
</pre>
 
 
=== Loopback: Audio ===
 
'''Generated audio tone (audiotestsrc):'''
 
<pre>
 
gst-launch audiotestsrc num-buffers=1000 ! alsasink
 
</pre>
 
 
'''Captured audio (alsasrc):'''
 
<pre>
 
gst-launch -v alsasrc ! alsasink sync=FALSE
 
</pre>
 
 
=== Loopback:  Audio + Video ===
 
No pipelines here yet.  Please feel free to add your own.
 
 
=== Decode Video Files ===
 
 
'''H.264 -> NTSC_D1:'''
 
<pre>
 
gst-launch -v filesrc location=sample_D1.264 ! TIViddec2 engineName=codecServer codecName=h264dec ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=COMPONENT sync=FALSE
 
</pre>
 
 
'''H.264 -> NTSC_720P:'''
 
<pre>
 
gst-launch -v filesrc location=sample_720P.264 ! TIViddec2 codecName=h264dec engineName=codecServer ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 ! TIDmaiVideoSink videoStd=720P_60 videoOutput=component sync=false hideOSD=TRUE
 
</pre>
 
 
'''H.264 -> NTSC_1080I30:'''
 
<pre>
 
gst-launch -v filesrc use-mmap=true blocksize=40960 location=sample_1080i_30.264 ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=2097152 ! TIViddec2 genTimeStamps=FALSE engineName=codecServer codecName=h264dec ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 ! TIDmaiVideoSink videoStd=1080I_30
 
</pre>
 
 
'''H.264 -> NTSC_1080P60:'''
 
<pre>
 
gst-launch -v filesrc use-mmap=true blocksize=40960 location=sample_1080p_60.264 ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=2097152 ! video/x-h264, framerate=60/1, width=1920, height=1080 ! TIViddec2 genTimeStamps=FALSE codecName=h2641080p60vdec ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 ! TIDmaiVideoSink videoStd=1080P_60 sync=false
 
</pre>
 
 
 
'''MPEG-2 -> NTSC_D1:'''
 
<pre>
 
gst-launch filesrc location=sample_D1.m2v ! TIViddec2 engineName=codecServer codecName=mpeg2dec ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=COMPONENT sync=FALSE
 
</pre>
 
 
'''MPEG-2 -> NTSC_720P:'''
 
<pre>
 
gst-launch filesrc location=sample_720p.m2v ! TIViddec2 engineName=codecServer codecName=mpeg2dec ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 ! TIDmaiVideoSink videoStd=720P_60 videoOutput=component sync=false hideOSD=TRUE
 
</pre>
 
 
'''MPEG-2 -> NTSC_1080I30:'''
 
<pre>
 
gst-launch filesrc use-mmap=true blocksize=40960 location=sample_1080i_30.m2v ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=2097152 ! TIViddec2 genTimeStamps=FALSE engineName=codecServer codecName=mpeg2dec ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 ! TIDmaiVideoSink videoStd=1080I_30
 
</pre>
 
 
=== Decode Audio Files ===
 
'''AAC:'''
 
<pre>
 
gst-launch -v filesrc location=sample.aac ! TIAuddec1 codecName=aachedec engineName=codecServer ! alsasink sync=false
 
</pre>
 
 
=== Decode Container Files ===
 
 
'''AVI (MPEG-2 / MP3) -> NTSC_1080I30:'''<br/>
 
<pre>
 
gst-launch -v filesrc location=sample_1080i.avi ! avidemux name=demux demux.audio_00 ! queue max-size-buffers=8000 max-size-time=0 max-size-bytes=0 ! mad ! alsasink demux.video_00 ! queue ! TIViddec2 ! TIDmaiVideoSink videoStd=1080I_30
 
</pre>
 
 
'''MP4 (H.264 / AAC) -> NTSC_1080I30:'''<br/>
 
<pre>
 
gst-launch -v filesrc location=sample_1080i.mp4 ! qtdemux name=demux demux.audio_00 ! queue max-size-buffers=8000 max-size-time=0 max-size-bytes=0 ! TIAuddec1 ! alsasink demux.video_00 ! queue ! TIViddec2 ! TIDmaiVideoSink videoStd=1080I_30
 
</pre>
 
 
'''TS (H.264 / MP3) -> NTSC_1080I30:'''<br/>
 
<pre>
 
gst-launch -v filesrc location=sample_1080i.ts ! typefind ! mpegtsdemux name=demux demux. ! audio/mpeg ! queue max-size-buffers=1200 max-size-time=0 max-size-bytes=0 ! typefind ! mad ! alsasink demux. ! video/x-h264 ! typefind ! TIViddec2 TIDmaiVideoSink videoStd=1080I_30
 
</pre>
 
 
=== Encode Video Files ===
 
 
'''Generated_D1 (videotestsrc) -> H.264:'''<br/>
 
<pre>
 
gst-launch -v videotestsrc num-buffers=1000 ! video/x-raw-yuv,format=(fourcc)NV12 ! TIVidenc1 codecName=h264enc engineName=codecServer ! filesink location=output_gen_D1.264
 
</pre>
 
 
'''Captured_720P (v4l2src) -> H.264:'''<br/>
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=1000 ! TIVidenc1 codecName=h264enc engineName=codecServer contiguousInputFrame=TRUE ! filesink location=output_cap_720p.264
 
</pre>
 
 
=== Encode Video in Container ===
 
 
''' Generated_D1 (videotestsrc) -> H.264 -> Quicktime container:'''
 
<pre>
 
gst-launch -v videotestsrc num-buffers=2000 ! 'video/x-raw-yuv,format=(fourcc)NV12' ! TIVidenc1 codecName=h264enc engineName=codecServer byteStream=FALSE !  qtmux ! filesink location=output_gen_.mp4
 
</pre>
 
 
''' Captured_720P (v4l2src) -> H.264 -> Quicktime container:'''
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE num-buffers=2000 ! TIVidenc1 codecName=h264enc engineName=codecServer ! qtmux ! filesink location=output_cap_.mp4
 
</pre>
 
 
=== Encode Audio Files ===
 
<span style="color: red">There's no AAC encoder included in DVSDK 3.10 due to licensing restrictions.</span>
 
 
=== Resize ===
 
''' Captured_D1 (v4l2src) -> CIF:'''
 
<pre>
 
gst-launch v4l2src always-copy=FALSE ! TIVidResize contiguousInputFrame=TRUE ! video/x-raw-yuv,width=352,height=288,format=(fourcc)Y8C8 ! TIDmaiVideoSink
 
</pre>
 
 
=== Network Streaming ===
 
This section gives example where EVM acts as streaming server, which captures, encodes and transmit via udp. Host PC can be used as client to decode.
 
 
'''H.264 Encode/Stream/Decode:'''<br/>
 
A simple RTP server to be run on EVM.
 
 
<pre>
 
gst-launch -v v4l2src always-copy=FALSE ! TIVidenc1 codecName=h264enc engineName=encode contiguousInputFrame=TRUE ! rtph264pay pt=96 ! udpsink host=<HOST_PC_IP> port=5000
 
</pre>
 
When the pipeline starts to run, you'll see something that looks like this:
 
<pre>
 
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, profile-level-id=(string)42801f, sprop-parameter-sets=(string)\"Z0KAH/QFoeiA\\,aN48gA\\=\\=\", payload=(int)96, ssrc=(guint)521259813, clock-base=(guint)1231006457, seqnum-base=(guint)2761
 
</pre>
 
 
'''Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this string in client below '''
 
 
A simple RTP client to be run on Host PC (Linux).
 
<pre>
 
gst-launch-0.10 -v udpsrc port=5000 caps="<CAP_FROM_SERVER>" ! rtph264depay ! ffdec_h264 ! xvimagesink
 
</pre>
 
 
== OMAP35x ==
 
This section covers pipelines for common use cases for the OMAP3530 processor.
 
 
=== Environment Requirements ===
 
{{ti_gst_env|processor=omap3530|fbdev=/dev/fb2}}
 
 
<span style="color: blue">''' If you are using Angstrom distribution on beagleboard then you  can use "omapdmaifbsink" instead of "TIDmaiVideoSink" to display the video inside the X windowing system. ''' </span>
 
 
=== Loopback: Video ===
 
<pre>
 
gst-launch -v videotestsrc ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD accelFrameCopy=FALSE sync=false
 
</pre>
 
 
=== Loopback: Audio ===
 
 
<pre>
 
gst-launch audiotestsrc freq=1000 num-buffers=100 ! alsasink
 
</pre>
 
 
If you want to route audio in to audio out (your very own P.A. system), try:
 
 
<pre>
 
gst-launch alsasrc num-buffers=1000 ! alsasink
 
</pre>
 
 
If you get a ''Could not open audio device for recording.'' error, likely your ALSA configuration is incorrect.  I fixed it with
 
 
<pre>
 
mv /etc/asound.conf /etc/asound.conf.orig
 
</pre>
 
 
to move the ALSA configuration file out of the way.
 
 
=== Loopback: Audio+Video ===
 
No pipelines here yet.  Please feel free to add your own.
 
 
=== Decode Video files ===
 
'''H.264/VGA:'''
 
<pre>
 
gst-launch -v filesrc location=sample.264 ! TIViddec2 codecName=h264dec engineName=codecServer ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false
 
</pre>
 
 
'''MPEG-4/VGA:'''
 
<pre>
 
gst-launch -v filesrc location=sample.m4v ! TIViddec2 codecName=mpeg4dec engineName=codecServer ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false
 
</pre>
 
 
'''MPEG-2/VGA:'''
 
<pre>
 
gst-launch -v filesrc location=sample.m2v ! TIViddec2 codecName=mpeg2dec engineName=codecServer ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false
 
</pre>
 
 
=== Decode Audio Files ===
 
'''AAC:'''
 
<pre>
 
gst-launch -v filesrc location=sample.aac ! TIAuddec1 codecName=aachedec engineName=codecServer ! alsasink sync=false
 
</pre>
 
 
===Decode .MP4 Files ===
 
The following pipeline assumes you have a VGA .MP4 file with H.264 Video and AAC Audio.
 
 
<pre>
 
gst-launch -v filesrc location=sample.mp4 ! qtdemux name=demux demux.audio_00 ! queue max-size-buffers=8000 max-size-time=0 max-size-bytes=0 ! TIAuddec1 ! alsasink demux.video_00 ! queue ! TIViddec2 ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD
 
</pre>
 
 
=== Decode .AVI Files ===
 
The following pipeline assumes you have VGA .AVI file with MPEG-2 or MPEG-4 Video and MP1L2 or MP3 Audio.
 
 
<pre>
 
gst-launch -v filesrc location=sample.avi ! avidemux name=demux demux.audio_00 ! queue max-size-buffers=1200 max-size-time=0 max-size-bytes=0 ! mad ! alsasink demux.video_00 ! queue !  TIViddec2 ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD
 
</pre>
 
 
=== Decode .TS Files ===
 
The following pipeline assumes you have VGA .TS file with H.264 Video and MP1L2 or MP3 Audio.
 
 
<pre>
 
gst-launch filesrc location=sample.ts ! typefind ! mpegtsdemux name=demux demux. ! queue max-size-buffers=1200 max-size-time=0 max-size-bytes=0 ! typefind ! mad ! alsasink demux. ! typefind ! TIViddec2 ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD
 
</pre>
 
 
=== Encode Video Files ===
 
'''H.264/QVGA:'''
 
<pre>
 
gst-launch -v videotestsrc num-buffers=2000 ! TIVidenc1 codecName=h264enc engineName=codecServer ! filesink location=sample.264
 
</pre>
 
 
'''MPEG-4/QVGA:'''
 
<pre>
 
gst-launch -v videotestsrc num-buffers=2000 ! TIVidenc1 codecName=mpeg4enc engineName=codecServer ! filesink location=sample.m4v
 
</pre>
 
 
=== Encode Video in Container ===
 
''' Encode H.264 in quicktime container (Capture):'''
 
<pre>
 
gst-launch -v videotestsrc num-buffers=2000 ! TIVidenc1 codecName=h264enc engineName=codecServer byteStream=FALSE ! qtmux ! filesink location=sample.mp4
 
</pre>
 
 
 
=== Image Encode ===
 
A simple pipeline to encode YUV420P image
 
 
<pre>
 
gst-launch filesrc location=sample.yuv ! TIImgenc1 resolution=720x480 iColorSpace=UYVY oColorSpace=YUV420P qValue=75 ! filesink location=sample.jpeg
 
</pre>
 
 
=== Image Decode ===
 
A simple pipeline that converts a JPEG image into UYVY format.
 
 
<pre>
 
gst-launch filesrc location=sample.jpeg ! TIImgdec1 codecName=jpegdec engineName=codecServer  ! filesink location=sample.uyvy
 
</pre>
 
 
=== Resize ===
 
A simple pipeline receiving CIF from videotestsrc and resizing to VGA.
 
 
<pre>
 
gst-launch videotestsrc ! 'video/x-raw-yuv,width=352,height=288' ! TIVidResize ! 'video/x-raw-yuv,width=640,height=480' ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false
 
</pre>
 
 
=== Network Streaming ===
 
 
==== Audio RTP Streaming ====
 
 
Although these examples are using a target device and a host PC, you could use two target devices as well.
 
 
Case 1: sending audio from target (BeagleBoard in my case) to Ubuntu host:
 
 
 
On target:
 
On target:
<pre>
+
<pre>gst-launch udpsrc port=5000 ! “application/x-rtp, media=(string)audio, clock-rate=44100, width=16, height=16, \
gst-launch audiotestsrc freq=1000 ! mulawenc ! rtppcmupay ! udpsink host=<HOST_PC_IP> port=5555
+
encoding-name=(string)L16,encoding-params=(string)1, channels=(int)1, channel-position=(int)1, payload=(int)96” ! \
 +
gstrtpjitterbuffer do-lost=true ! rtpL16depay ! audioconvert ! alsasink sync=false
 
</pre>
 
</pre>
  
On host:
+
And if you want to multicast your stream to multiple computers try this one:
<pre>
 
gst-launch udpsrc port=5555 caps="application/x-rtp" ! queue ! rtppcmudepay ! mulawdec ! audioconvert ! alsasink
 
</pre>
 
 
 
The above example experienced dropped audio, please update pipeline when you get it working properly.
 
 
 
 
 
Case 2: sending audio from Ubuntu host to target (BeagleBoard)
 
  
 
On host:
 
On host:
<pre>
+
<pre>gst-launch filesrc location=DownUnder.mp3 ! mad ! audioconvert ! audio/x-raw-int,channels=1,depth=16,width=16, \
gst-launch audiotestsrc freq=1000 ! mulawenc ! rtppcmupay ! udpsink host=<TARGET_PC_IP>  port=5555
+
rate=44100 ! rtpL16pay  ! udpsink host=224.0.0.15 port=5000
 
</pre>
 
</pre>
  
On target
+
On multiple targets:
<pre>
+
<pre>gst-launch-0.10 udpsrc port=5000 ! "application/x-rtp,media=(string)audio, clock-rate=(int)44100, width=16, height=16,\
gst-launch udpsrc port=5555 caps="application/x-rtp" ! queue ! rtppcmudepay ! mulawdec ! audioconvert ! alsasink
+
encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, channel-positions=(int)1, payload=(int)96" ! \
 +
gstrtpjitterbuffer do-lost=true ! rtpL16depay ! audioconvert ! alsasink sync=false
 
</pre>
 
</pre>
  
 
+
==== H.264 RTP Streaming ====
==== H.264 RTP Streaming ====
 
  
 
This section gives example where EVM acts as streaming server, which captures, encodes and transmit via udp. Host PC can be used as client to decode.  
 
This section gives example where EVM acts as streaming server, which captures, encodes and transmit via udp. Host PC can be used as client to decode.  
  
'''H.264 Encode/Stream/Decode '''
+
'''H.264 Encode/Stream/Decode ''' A simple RTP server to encode and transmit H.264.  
A simple RTP server to encode and transmit H.264.
+
<pre>gst-launch -v videotestsrc&nbsp;! TIVidenc1 codecName=h264enc engineName=codecServer&nbsp;! rtph264pay pt=96&nbsp;! udpsink host=&lt;HOST_PC_IP&gt; port=5000
 +
</pre>
 +
When the pipeline starts to run, you'll see something that looks like this:
 +
<pre> /GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, profile-level-id=(string)42801e, sprop-parameter-sets=(string)\"Z0KAHukCg+QgAAB9AAAdTACA\\,aM48gA\\=\\=\", payload=(int)96, ssrc=(guint)3417130276, clock-base=(guint)2297521617, seqnum-base=(guint)48503
 +
</pre>
 +
'''Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this string in client below '''
  
<pre>
+
A simple RTP client to decodes H.264 and display on HOST machine  
gst-launch -v videotestsrc ! TIVidenc1 codecName=h264enc engineName=codecServer ! rtph264pay pt=96 ! udpsink host=<HOST_PC_IP> port=5000
+
<pre>gst-launch -v udpsrc port=5000 caps="&lt;CAPS_FROM_SERVER&gt;"&nbsp;! rtph264depay&nbsp;! ffdec_h264&nbsp;! xvimagesink
</pre>
+
</pre>  
When the pipeline starts to run, you'll see something that looks like this:
+
<br> '''MPEG-4 Receive/Decode/Display:'''<br>  
<pre>
 
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, profile-level-id=(string)42801e, sprop-parameter-sets=(string)\"Z0KAHukCg+QgAAB9AAAdTACA\\,aM48gA\\=\\=\", payload=(int)96, ssrc=(guint)3417130276, clock-base=(guint)2297521617, seqnum-base=(guint)48503
 
</pre>
 
 
 
'''Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this string in client below '''
 
 
 
A simple RTP client to decodes H.264 and display on HOST machine
 
 
 
<pre>
 
gst-launch -v udpsrc port=5000 caps="<CAPS_FROM_SERVER>" ! rtph264depay ! ffdec_h264 ! xvimagesink
 
</pre>
 
 
 
 
 
'''MPEG-4 Receive/Decode/Display:'''<br/>
 
  
 
This section gives example where EVM acts as RTP client, which receives encoded stream via udp then decodes and display output. Host PC can be used as server to transmit encoded stream.  
 
This section gives example where EVM acts as RTP client, which receives encoded stream via udp then decodes and display output. Host PC can be used as server to transmit encoded stream.  
  
A simple RTP server which encodes and transmits MPEG-4 on OMAP3530 EVM.
+
A simple RTP server which encodes and transmits MPEG-4 on OMAP3530 EVM.  
<pre>
+
<pre>gst-launch-0.10  videotestsrc &nbsp;! 'video/x-raw-yuv,width=640,height=480'&nbsp;! ffenc_mpeg4&nbsp;! rtpmp4vpay&nbsp;! udpsink host=&lt;EVM_IP_ADDR&gt; port=5000  -v
gst-launch-0.10  videotestsrc ! 'video/x-raw-yuv,width=640,height=480' ! ffenc_mpeg4 ! rtpmp4vpay ! udpsink host=<EVM_IP_ADDR> port=5000  -v
+
</pre>  
</pre>
+
'''Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this string in client below '''  
 
 
'''Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this string in client below '''
 
 
 
A simple RTP client to receive and decode the MPEG-4 encoded stream.
 
 
 
<pre>
 
gst-launch -v udpsrc port=5000 caps="<CAPS_FROM_SERVER>" ! rtpmp4vdepay  ! TIViddec2 !  TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false
 
</pre>
 
  
== All ==
+
A simple RTP client to receive and decode the MPEG-4 encoded stream.
This section covers pipelines that should work for all processors. These pipelines should work on any other platform too (such as your desktop Linux machine).  They are included because we have been asked for these examples previously.
+
<pre>gst-launch -v udpsrc port=5000 caps="&lt;CAPS_FROM_SERVER&gt;"&nbsp;! rtpmp4vdepay &nbsp;! TIViddec2&nbsp;!  TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false
 +
</pre>
 +
== All ==
  
=== Debugging ===
+
This section covers pipelines that should work for all processors. These pipelines should work on any other platform too (such as your desktop Linux machine). They are included because we have been asked for these examples previously.
  
* [http://gstreamer.freedesktop.org/data/doc/gstreamer/devel/manual/html/section-checklist-debug.html General GStreamer debugging information]
+
=== Debugging  ===
  
==== Verbose output ====
+
*[http://gstreamer.freedesktop.org/data/doc/gstreamer/devel/manual/html/section-checklist-debug.html General GStreamer debugging information]
  
If you want to see what capabilities are being used or are expected, add <tt>-v</tt>.
+
==== Verbose output  ====
  
<pre>
+
If you want to see what capabilities are being used or are expected, add <tt>-v</tt>.
gst-launch -v alsasrc ! alsasink
+
<pre>gst-launch -v alsasrc&nbsp;! alsasink
</pre>
+
</pre>  
 +
==== Element debug output  ====
  
==== Element debug output ====
+
To enable debug output for a specific element:
 +
<pre>gst-launch --gst-debug=audiotestsrc:4  audiotestsrc&nbsp;! alsasink
 +
</pre>
 +
Adjust the element name and debug level until you get the data you are looking for.
  
To enable debug output for a specific element:
+
To enable debug output for a more than one element:  
 +
<pre>gst-launch --gst-debug=audio*:3  audiotestsrc&nbsp;! audioconvert&nbsp;! alsasink
 +
</pre>
 +
or for all elements
 +
<pre>gst-launch --gst-debug=*:3  alsasrc&nbsp;! alsasink
 +
</pre>
 +
You can see the list of element names that support debug output using
 +
<pre>gst-launch --gst-debug-help
 +
</pre>
 +
=== Audio pipelines  ===
  
<pre>
+
==== Controlling the sample rate and bit depth  ====
gst-launch --gst-debug=audiotestsrc:4  audiotestsrc ! alsasink
 
</pre>
 
  
Adjust the element name and debug level until you get the data you are looking for.
+
Find the default audio capabilities:
 +
<pre>gst-launch -v alsasrc&nbsp;! alsasink
 +
</pre>
 +
The output will be similar to
 +
<pre>caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)44100, channels=(int)2
 +
</pre>
 +
Using that pattern (minus the data type indication, which is not needed with gst-launch):
 +
<pre>gst-launch -v alsasrc&nbsp;! audio/x-raw-int, endianness=1234, signed=true, width=32, depth=32, rate=44100, channels=2&nbsp;! alsasink
 +
</pre>
 +
Adjust the capabilities as needed.  
  
To enable debug output for a more than one element:
+
==== Generic network audio streaming example  ====
  
<pre>
+
These pipelines do not depend on the TI DMAI GSteamer plug-in.
gst-launch --gst-debug=audio*:3  audiotestsrc ! audioconvert ! alsasink
 
</pre>
 
  
or for all elements  
+
Sender (host):
 +
<pre>TARGET_IP=10.111.0.194
 +
gst-launch audiotestsrc freq=1000&nbsp;! mulawenc&nbsp;! rtppcmupay&nbsp;! queue&nbsp;! udpsink host=$TARGET_IP port=5555
 +
</pre>
 +
Receiver (target):
 +
<pre>gst-launch udpsrc port=5555 caps="application/x-rtp"&nbsp;! queue&nbsp;! rtppcmudepay&nbsp;! mulawdec &nbsp;! alsasink
 +
</pre>
 +
<br>
  
<pre>
+
== DSS2 Video Driver ==
gst-launch --gst-debug=*:3 alsasrc ! alsasink
 
</pre>
 
  
You can see the list of element names that support debug output using
+
The DSS2 video driver documentation can be found [http://git.igep.es/?p=pub/scm/linux-omap-2.6.git;a=blob;f=Documentation/arm/OMAP/DSS;h=0af0e9eed5d6c1281433b4c0bc26f7c6577fe8a6;hb=refs/heads/linux-2.6.35.y here] for kernel 2.6.35.y
  
<pre>
+
Some useful examples:
gst-launch --gst-debug-help
 
</pre>
 
  
=== Audio pipelines ===
+
omapfb.mode=dvi:1024x768MR-16@60<br>omapfb.mode=dvi:1280x720MR-16@60 (for 720p HDTV with 1:1 pixel mapping)<br>omapfb.mode=dvi:1360x768MR-16@60 (works nice on 720p HDMI TV which crops edges due to overscan)<br>
  
==== Controlling the sample rate and bit depth ====
+
Note: the M indicates the kernel will calculate a VESA mode on-the-fly instead of using modedb lookup. The R indicates reduced blanking which is for LCD monitors. Most HDTV will probably only operate with a VESA mode.<br>
  
Find the default audio capabilities:
+
omapfb.mode should be passed in the kernel command line, this is the uboot example:
 +
<pre>bootargs-base=mem=430M console=ttyS2,115200n8 console=tty0 omapfb.mode=dvi:1280x720MR-16@60 vram=32M omapfb.vram=0:8M,1:16M,2:8M
 +
</pre>
 +
<br>
  
<pre>
+
== Performance  ==
gst-launch -v alsasrc ! alsasink
 
</pre>
 
  
The output will be similar to
+
Here are some test results I measured on my IGEPV2 board.<br>
 +
Decoding an aac music file using software decoder (faad) requires 60% load (top output).<br>
 +
Decoding the same file using the DSP TI framework results in 4% CPU load (top output) and 176kbps / 21 fps DSP "load" (dmaiperf output).<br>
 +
<br>
 +
To get performance figures from the DSP add dmaiperf in the pipeline.<br>
 +
<br>
 +
I used the following pipelines:<br>
  
<pre>
+
*gst-launch -v filesrc location=sample.aac ! faad ! audioconvert ! audioresample ! alsasink
caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)44100, channels=(int)2
 
</pre>
 
 
 
Using that pattern (minus the data type indication, which is not needed with gst-launch):
 
 
 
<pre>
 
gst-launch -v alsasrc ! audio/x-raw-int, endianness=1234, signed=true, width=32, depth=32, rate=44100, channels=2 ! alsasink
 
</pre>
 
 
 
Adjust the capabilities as needed.
 
 
 
==== Generic network audio streaming example ====
 
 
 
These pipelines do not depend on the TI DMAI GSteamer plug-in.
 
 
 
Sender (host):
 
 
 
<pre>
 
TARGET_IP=10.111.0.194
 
gst-launch audiotestsrc freq=1000 ! mulawenc ! rtppcmupay ! queue ! udpsink host=$TARGET_IP port=5555
 
</pre>
 
 
 
Receiver (target):
 
 
 
<pre>
 
gst-launch udpsrc port=5555 caps="application/x-rtp" ! queue ! rtppcmudepay ! mulawdec  ! alsasink
 
</pre>
 
  
 +
*gst-launch -v filesrc location=sample.aac ! TIAuddec1 codecName=aachedec engineName=codecServer ! dmaiperf ! alsasink sync=false
  
[[Category:DMAI GStreamer Plug-In]]
 
 
[[Category:Gstreamer]]
 
[[Category:Gstreamer]]
 +
[[Category:Software applications]]

Latest revision as of 10:16, 31 December 2013

Notes

In order to make the next examples work I had to install (apt-get install <package>) the following packages on the target

  • gstreamer0.10-tools
  • gstreamer0.10-plugins-base
  • gstreamer0.10-alsa for alsasrc and alsasink
  • gstreamer0.10-plugins-ugly for mad

Perhaps also install gstreamer0.10-plugins-good and gstreamer0.10-plugins-bad...

For all examples I had to perform gst-launch-0.10 in stead of gst-launch.
When using the pipelines that use the TI codecs on the DSP, make sure you execute the gst-launch command in the directory were the codec server (cs.x64P) is present.
You may also make a link to the codecserver in the directory were you execute your command.
If you do not do this you will get an error like gst-launch-0.10: BufTab.c:440: BufTab_getNumBufs: Assertion `hBufTab' failed

Purpose

This page provides example pipelines that can be copied to the command line to demonstrate various GStreamer operations. Some of the pipelines may need modification for things such as file names, ip addresses, etc.

Refer to this Gstreamer article for more information on downloading and building TI Gstreamer elements.

Testing

Currently these pipelines have not undergone any extensive testing. If you find an error in a pipeline please correct it.

Media files

You should be able to use any audio and video media file that conforms to the appropriate standard.

Creating an AVI file

The following ffmpeg command takes a .mov file (say from the Apple movie trailers site) and make an AVI file. Run the command on your host computer.

ffmpeg -i tropic_thunder-tlr1a_720p.mov -r 60 -b 6000000 -vcodec mpeg2video -ab 48000000 -acodec libmp3lame -s 1280x544 tropic.avi

Supported Platforms

Following are a list of supported platforms, with links that jump directly to pipeline examples for each platform.

OMAP35x

This section covers pipelines for common use cases for the OMAP3530 or DM3730 processor.

Environment Requirements

cd /opt/gstreamer_demo/dmxxx/
./loadmodules.sh
export GST_REGISTRY=/tmp/gst_registry.bin
export LD_LIBRARY_PATH=/opt/gstreamer/lib
export GST_PLUGIN_PATH=/opt/gstreamer/lib/gstreamer-0.10
export PATH=/opt/gstreamer/bin:$PATH
cat /dev/zero > /dev/fbx 2> /dev/null

If you use IGEP GST FRAMEWORK 2.00.20 you can use "omapdmaifbsink" instead of "TIDmaiVideoSink" to display the video inside the X windowing system.

Loopback: Video

gst-launch -v videotestsrc ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD accelFrameCopy=FALSE sync=false

Loopback: Audio

In order to have access to the alsasrc and alsasink plugins perform a 'apt-get install gstreamer0.10-alsa' on the igep board.

gst-launch audiotestsrc freq=1000 num-buffers=100 ! alsasink

If you want to route audio in to audio out (your very own P.A. system), try:

gst-launch alsasrc num-buffers=1000 ! alsasink

If you get a Could not open audio device for recording. error, likely your ALSA configuration is incorrect. I fixed it with

mv /etc/asound.conf /etc/asound.conf.orig

to move the ALSA configuration file out of the way.

Loopback: Audio+Video

No pipelines here yet. Please feel free to add your own.

Decode Video files

H.264/VGA:

gst-launch -v filesrc location=sample.264 ! TIViddec2 codecName=h264dec engineName=codecServer ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false

MPEG-4/VGA:

gst-launch -v filesrc location=sample.m4v ! TIViddec2 codecName=mpeg4dec engineName=codecServer ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false

MPEG-2/VGA:

gst-launch -v filesrc location=sample.m2v ! TIViddec2 codecName=mpeg2dec engineName=codecServer ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false

Decode Audio Files

AAC:

gst-launch -v filesrc location=sample.aac ! TIAuddec1 codecName=aachedec engineName=codecServer ! alsasink sync=false

Decode .MP4 Files

The following pipeline assumes you have a VGA .MP4 file with H.264 Video and AAC Audio.

gst-launch -v filesrc location=sample.mp4 ! qtdemux name=demux demux.audio_00 ! queue max-size-buffers=8000 max-size-time=0 max-size-bytes=0 ! TIAuddec1 ! alsasink demux.video_00 ! queue ! TIViddec2 ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD

Decode .AVI Files

The following pipeline assumes you have VGA .AVI file with MPEG-2 or MPEG-4 Video and MP1L2 or MP3 Audio.

gst-launch -v filesrc location=sample.avi ! avidemux name=demux demux.audio_00 ! queue max-size-buffers=1200 max-size-time=0 max-size-bytes=0 ! mad ! alsasink demux.video_00 ! queue !  TIViddec2 ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD

Decode .TS Files

The following pipeline assumes you have VGA .TS file with H.264 Video and MP1L2 or MP3 Audio.

gst-launch filesrc location=sample.ts ! typefind ! mpegtsdemux name=demux demux. ! queue max-size-buffers=1200 max-size-time=0 max-size-bytes=0 ! typefind ! mad ! alsasink demux. ! typefind ! TIViddec2 ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD

Encode Video Files

H.264/QVGA:

gst-launch -v videotestsrc num-buffers=2000 ! TIVidenc1 codecName=h264enc engineName=codecServer ! filesink location=sample.264

MPEG-4/QVGA:

gst-launch -v videotestsrc num-buffers=2000 ! TIVidenc1 codecName=mpeg4enc engineName=codecServer ! filesink location=sample.m4v

Encode Video in Container

Encode H.264 in quicktime container (Capture):

gst-launch -v videotestsrc num-buffers=2000 ! TIVidenc1 codecName=h264enc engineName=codecServer byteStream=FALSE ! qtmux ! filesink location=sample.mp4


Image Encode

A simple pipeline to encode YUV420P image

gst-launch filesrc location=sample.yuv ! TIImgenc1 resolution=720x480 iColorSpace=UYVY oColorSpace=YUV420P qValue=75 ! filesink location=sample.jpeg

Image Decode

A simple pipeline that converts a JPEG image into UYVY format.

gst-launch filesrc location=sample.jpeg ! TIImgdec1 codecName=jpegdec engineName=codecServer  ! filesink location=sample.uyvy

Resize

A simple pipeline receiving CIF from videotestsrc and resizing to VGA.

gst-launch videotestsrc ! 'video/x-raw-yuv,width=352,height=288' ! TIVidResize ! 'video/x-raw-yuv,width=640,height=480' ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false

Network Streaming

Audio RTP Streaming

Although these examples are using a target device and a host PC, you could use two target devices as well.

Case 1: sending audio from target (BeagleBoard in my case) to Ubuntu host:

On target:

gst-launch audiotestsrc freq=1000 ! mulawenc ! rtppcmupay ! udpsink host=<HOST_PC_IP> port=5555

On host:

gst-launch udpsrc port=5555 caps="application/x-rtp" ! queue ! rtppcmudepay ! mulawdec ! audioconvert ! alsasink


Case 2: sending audio from Ubuntu host to target (BeagleBoard)

On host:

gst-launch audiotestsrc freq=1000 ! mulawenc ! rtppcmupay ! udpsink host=<TARGET_PC_IP>  port=5555

On target

gst-launch udpsrc port=5555 caps="application/x-rtp" ! queue ! rtppcmudepay ! mulawdec ! audioconvert ! alsasink

The above example experienced dropped audio, please update pipeline when you get it working properly.
I had the same problem using my IGEP WLAN interface. After direct connect with Ethernet cable the dropped audio problem was solved.

I also used these pipelines:
On host:

gst-launch filesrc location=DownUnder.mp3 ! mad ! audioconvert ! audio/x-raw-int,channels=1,depth=16,width=16,\
rate=44100 ! rtpL16pay  ! udpsink host=192.168.2.8 port=5000

On target:

gst-launch udpsrc port=5000 ! “application/x-rtp, media=(string)audio, clock-rate=44100, width=16, height=16, \
encoding-name=(string)L16,encoding-params=(string)1, channels=(int)1, channel-position=(int)1, payload=(int)96” ! \
gstrtpjitterbuffer do-lost=true ! rtpL16depay ! audioconvert ! alsasink sync=false

And if you want to multicast your stream to multiple computers try this one:

On host:

gst-launch filesrc location=DownUnder.mp3 ! mad ! audioconvert ! audio/x-raw-int,channels=1,depth=16,width=16, \
rate=44100 ! rtpL16pay  ! udpsink host=224.0.0.15 port=5000

On multiple targets:

gst-launch-0.10 udpsrc port=5000 ! "application/x-rtp,media=(string)audio, clock-rate=(int)44100, width=16, height=16,\
 encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, channel-positions=(int)1, payload=(int)96" ! \
gstrtpjitterbuffer do-lost=true ! rtpL16depay ! audioconvert ! alsasink sync=false

H.264 RTP Streaming

This section gives example where EVM acts as streaming server, which captures, encodes and transmit via udp. Host PC can be used as client to decode.

H.264 Encode/Stream/Decode A simple RTP server to encode and transmit H.264.

gst-launch -v videotestsrc ! TIVidenc1 codecName=h264enc engineName=codecServer ! rtph264pay pt=96 ! udpsink host=<HOST_PC_IP> port=5000

When the pipeline starts to run, you'll see something that looks like this:

 /GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, profile-level-id=(string)42801e, sprop-parameter-sets=(string)\"Z0KAHukCg+QgAAB9AAAdTACA\\,aM48gA\\=\\=\", payload=(int)96, ssrc=(guint)3417130276, clock-base=(guint)2297521617, seqnum-base=(guint)48503

Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this string in client below

A simple RTP client to decodes H.264 and display on HOST machine

gst-launch -v udpsrc port=5000 caps="<CAPS_FROM_SERVER>" ! rtph264depay ! ffdec_h264 ! xvimagesink


MPEG-4 Receive/Decode/Display:

This section gives example where EVM acts as RTP client, which receives encoded stream via udp then decodes and display output. Host PC can be used as server to transmit encoded stream.

A simple RTP server which encodes and transmits MPEG-4 on OMAP3530 EVM.

gst-launch-0.10  videotestsrc  ! 'video/x-raw-yuv,width=640,height=480' ! ffenc_mpeg4 ! rtpmp4vpay ! udpsink host=<EVM_IP_ADDR> port=5000  -v

Make a note of caps="application/x-rtp, media=(string)video ................" string and pass this string in client below

A simple RTP client to receive and decode the MPEG-4 encoded stream.

gst-launch -v udpsrc port=5000 caps="<CAPS_FROM_SERVER>" ! rtpmp4vdepay  ! TIViddec2 !  TIDmaiVideoSink videoStd=VGA videoOutput=LCD sync=false

All

This section covers pipelines that should work for all processors. These pipelines should work on any other platform too (such as your desktop Linux machine). They are included because we have been asked for these examples previously.

Debugging

Verbose output

If you want to see what capabilities are being used or are expected, add -v.

gst-launch -v alsasrc ! alsasink

Element debug output

To enable debug output for a specific element:

gst-launch --gst-debug=audiotestsrc:4   audiotestsrc ! alsasink

Adjust the element name and debug level until you get the data you are looking for.

To enable debug output for a more than one element:

gst-launch --gst-debug=audio*:3  audiotestsrc ! audioconvert ! alsasink

or for all elements

gst-launch --gst-debug=*:3  alsasrc ! alsasink

You can see the list of element names that support debug output using

gst-launch --gst-debug-help

Audio pipelines

Controlling the sample rate and bit depth

Find the default audio capabilities:

gst-launch -v alsasrc ! alsasink

The output will be similar to

caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)44100, channels=(int)2

Using that pattern (minus the data type indication, which is not needed with gst-launch):

gst-launch -v alsasrc ! audio/x-raw-int, endianness=1234, signed=true, width=32, depth=32, rate=44100, channels=2 ! alsasink

Adjust the capabilities as needed.

Generic network audio streaming example

These pipelines do not depend on the TI DMAI GSteamer plug-in.

Sender (host):

TARGET_IP=10.111.0.194
gst-launch audiotestsrc freq=1000 ! mulawenc ! rtppcmupay ! queue ! udpsink host=$TARGET_IP port=5555

Receiver (target):

gst-launch udpsrc port=5555 caps="application/x-rtp" ! queue ! rtppcmudepay !  mulawdec  ! alsasink


DSS2 Video Driver

The DSS2 video driver documentation can be found here for kernel 2.6.35.y

Some useful examples:

omapfb.mode=dvi:1024x768MR-16@60
omapfb.mode=dvi:1280x720MR-16@60 (for 720p HDTV with 1:1 pixel mapping)
omapfb.mode=dvi:1360x768MR-16@60 (works nice on 720p HDMI TV which crops edges due to overscan)

Note: the M indicates the kernel will calculate a VESA mode on-the-fly instead of using modedb lookup. The R indicates reduced blanking which is for LCD monitors. Most HDTV will probably only operate with a VESA mode.

omapfb.mode should be passed in the kernel command line, this is the uboot example:

bootargs-base=mem=430M console=ttyS2,115200n8 console=tty0 omapfb.mode=dvi:1280x720MR-16@60 vram=32M omapfb.vram=0:8M,1:16M,2:8M


Performance

Here are some test results I measured on my IGEPV2 board.
Decoding an aac music file using software decoder (faad) requires 60% load (top output).
Decoding the same file using the DSP TI framework results in 4% CPU load (top output) and 176kbps / 21 fps DSP "load" (dmaiperf output).

To get performance figures from the DSP add dmaiperf in the pipeline.

I used the following pipelines:

  • gst-launch -v filesrc location=sample.aac ! faad ! audioconvert ! audioresample ! alsasink
  • gst-launch -v filesrc location=sample.aac ! TIAuddec1 codecName=aachedec engineName=codecServer ! dmaiperf ! alsasink sync=false