Difference between revisions of "Gstreamer cheat sheet"

From MyLabWiki
Jump to: navigation, search
(Time Overlay)
(Time Overlay)
Line 34: Line 34:
 
   gst-launch -v videotestsrc ! timeoverlay ! xvimagesink
 
   gst-launch -v videotestsrc ! timeoverlay ! xvimagesink
  
<code>Timeoverlay<code> inherits the properties of <code>textoverlay</code> so ....
+
<code>Timeoverlay</code> inherits the properties of <code>textoverlay</code> so ....
  
 
   gst-launch -v videotestsrc ! timeoverlay halign=right valign=bottom text="Stream time:" shaded-background=true ! xvimagesink
 
   gst-launch -v videotestsrc ! timeoverlay halign=right valign=bottom text="Stream time:" shaded-background=true ! xvimagesink
 
  
 
Alternatively, <code>cairotimeoverlay</code><ref>GStreamer Good Plugins 0.10 Plugins Reference Manual &ndash; [http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-cairotimeoverlay.html cairotimeoverlay]</ref> can be used but it doesn't seem to have any properties:
 
Alternatively, <code>cairotimeoverlay</code><ref>GStreamer Good Plugins 0.10 Plugins Reference Manual &ndash; [http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-cairotimeoverlay.html cairotimeoverlay]</ref> can be used but it doesn't seem to have any properties:
  
 
   gst-launch videotestsrc ! cairotimeoverlay ! xvimagesink
 
   gst-launch videotestsrc ! cairotimeoverlay ! xvimagesink
 +
 +
Instead of elapsed time, the system date and time can be added using the <code>clockoverlay</code><ref>GStreamer Base Plugins 0.10 Plugins Reference Manual - [http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-clockoverlay.html clockoverlay]</ref> plugin:
 +
 +
  gst-launch -v videotestsrc ! clockoverlay ! xvimagesink
 +
 +
<code>Clockloverlay</code> also inherits the properties of <code>[[#Text Overlay|textoverlay]]</code>
  
 
== References ==
 
== References ==

Revision as of 13:55, 19 June 2010

This page contains various shortcuts to achieving specific functionality using Gstreamer. These functionalities are mostly related to my Digital Video Transmission experiments. There is no easy to read "user manual" for gstreamerbut the online the plugin documentation[1] often contains command line examples in addition to the API docs. Other sources of documentation:

  • The manual page for gst-launch
  • The gst-inspect tool
  • Online tutorials


Video Test Source

Webcam Capture

The aspectratiocrop[2] plugin can be used to convert the video stream to a specific aspect ratio:

 gst-launch v4l2src ! video/x-raw-yuv,width=640,height=480,framerate=15/1 ! aspectratiocrop aspect-ratio=16/9 ! ffmpegcolorspace ! xvimagesink

Network Streaming

Encoding and Muxing

Decoding and Demuxing

Compositing

Text Overlay

Time Overlay

Elapsed time can be added using the timeoverlay[3] plugin:

 gst-launch -v videotestsrc ! timeoverlay ! xvimagesink

Timeoverlay inherits the properties of textoverlay so ....

 gst-launch -v videotestsrc ! timeoverlay halign=right valign=bottom text="Stream time:" shaded-background=true ! xvimagesink

Alternatively, cairotimeoverlay[4] can be used but it doesn't seem to have any properties:

 gst-launch videotestsrc ! cairotimeoverlay ! xvimagesink

Instead of elapsed time, the system date and time can be added using the clockoverlay[5] plugin:

 gst-launch -v videotestsrc ! clockoverlay ! xvimagesink

Clockloverlay also inherits the properties of textoverlay

References

  1. Gstreamer documentation http://gstreamer.freedesktop.org/documentation/
  2. GStreamer Good Plugins 0.10 Plugins Reference Manual – aspectratiocrop
  3. GStreamer Base Plugins 0.10 Plugins Reference Manual – timeoverlay
  4. GStreamer Good Plugins 0.10 Plugins Reference Manual – cairotimeoverlay
  5. GStreamer Base Plugins 0.10 Plugins Reference Manual - clockoverlay