<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.xiph.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nidia+Layson</id>
	<title>XiphWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.xiph.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nidia+Layson"/>
	<link rel="alternate" type="text/html" href="https://wiki.xiph.org/Special:Contributions/Nidia_Layson"/>
	<updated>2026-04-24T08:35:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=GST_cookbook&amp;diff=12825</id>
		<title>GST cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=GST_cookbook&amp;diff=12825"/>
		<updated>2011-04-07T15:40:19Z</updated>

		<summary type="html">&lt;p&gt;Nidia Layson: /* Pull from a windows media stream, transcode to Ogg/Thera+Vorbis and send to a icecast server: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In addition to being a powerful multimedia infrastructure for applications Gstreamer is also a useful tool for general manipulations of multimedia data.  By invoking gst-launch from the command-line with a custom pipeline many useful processing steps are possible.&lt;br /&gt;
&lt;br /&gt;
Gstreamer also usually has good support for Xiph-related formats. &lt;br /&gt;
&lt;br /&gt;
Unfortunately, it can be rather difficult to figure out an appropriate pipeline without a starting point.&lt;br /&gt;
&lt;br /&gt;
Here are some useful examples: &amp;lt;!-- Don&#039;t complain about the selection of examples, I started this simply by grepping my shell history. Feel free to submit more and/or improve the existing ones --gmaxwell --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Encode a .wav to Vorbis:===&lt;br /&gt;
*gst-launch filesrc location=&amp;quot;INPUT.wav&amp;quot;  ! wavparse ! audioconvert ! vorbisenc ! oggmux ! filesink location=&amp;quot;OUTPUT.ogg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Dump a Theora video to PNGs:===&lt;br /&gt;
*gst-launch filesrc location=&amp;quot;INPUT.ogv&amp;quot; !  oggdemux ! theoradec ! ffmpegcolorspace ! pngenc snapshot=false ! multifilesink location=&amp;quot;OUTPUT%04d.png&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Transmux a MKV (containing vorbis and theora) to Ogg:===&lt;br /&gt;
*gst-launch filesrc location=&amp;quot;INPUT.mkv&amp;quot; ! matroskademux name=d ! video/x-theora ! queue ! theoraparse ! oggmux name=mux ! filesink location=&amp;quot;OUTPUT.ogv&amp;quot; d. ! audio/x-vorbis ! queue ! vorbisparse ! queue ! mux.&lt;br /&gt;
&lt;br /&gt;
===Encode a y4m to lossless Dirac in Ogg:===&lt;br /&gt;
*gst-launch filesrc location=&amp;quot;INPUT.y4m&amp;quot; ! decodebin ! schroenc force-profile=vc2_main rate-control=lossless ! oggmux ! filesink location=&amp;quot;OUTPUT.ogv&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Pull from a windows media stream, transcode to Ogg/Thera+Vorbis and send to a icecast server:===&lt;br /&gt;
(requires purchasing fluendo plugins for decoding the encumbered codecs)    [http://www.registry-repair-tools.net registry repair download]&lt;br /&gt;
*gst-launch uridecodebin uri=mms://SOURCE.SERVER.COM/path name=d ! queue max-size-time=100000000 ! ffmpegcolorspace ! theoraenc bitrate=800 ! oggmux name=mux ! shout2send ip=YOURICECAST.SERVER.COM port=8000 password=YOURPASSWORD mount=/OUTPUTFILENAME.ogv d. ! queue max-size-time=100000000 ! audioconvert ! vorbisenc ! mux.&lt;br /&gt;
&lt;br /&gt;
===Capture video from a webcam, encode to an Ogg Theora file, decode and display on screen, write to a file whose name is the current date+time, and stream to an IceCast server===&lt;br /&gt;
*gst-launch-0.10 --eos-on-shutdown v4l2src ! &#039;video/x-raw-yuv, width=640, height=480&#039; ! videorate ! &#039;video/x-raw-yuv, framerate=15/1&#039; ! queue max-size-bytes=100000000 max-size-time=0 ! theoraenc bitrate=150 ! oggmux ! tee name=ogged ! queue max-size-bytes=100000000 max-size-time=0 ! oggdemux ! theoradec ! xvimagesink sync=false force-aspect-ratio=true ogged. ! queue max-size-bytes=100000000 max-size-time=0 ! filesink location=`date +%F_%T`.ogv ogged. ! queue max-size-bytes=100000000 max-size-time=0 ! shout2send ip=YOURICECAST.SERVER.COM port=8000 password=YOURPASSWORD mount=/OUTPUTFILENAME.ogv streamname=YOURSTREAMNAME description=YOURDESCRIPTION genre=YOURGENRE url=YOURSTREAMURL ogged.&lt;br /&gt;
&lt;br /&gt;
===A v4l2 source + ALSA source -&amp;gt; Ogg Theora -&amp;gt; IceCast===&lt;br /&gt;
*dov4l -i [0|1] -m NTSC&lt;br /&gt;
*gst-launch-0.10 --eos-on-shutdown v4l2src ! videoscale ! video/x-raw-yuv,width=320,height=240,framerate=30000/1001,interlaced=true ! queue max-size-bytes=100000000 max-size-time=0 ! gamma gamma=1.2 ! queue max-size-bytes=100000000 max-size-time=0 ! videobalance saturation=1.9 brightness=0.00 contrast=1.4 hue=0.06 ! ffmpegcolorspace ! queue max-size-bytes=100000000 max-size-time=0 ! theoraenc bitrate=400 ! queue max-size-bytes=100000000 max-size-time=0 ! oggmux name=mux alsasrc device=hw:1,0 latency-time=100 ! audioconvert ! vorbisenc ! queue max-size-bytes=100000000 max-size-time=0 ! mux. mux. ! queue max-size-bytes=100000000 max-size-time=0 ! shout2send ip=icecast-server.com  password=hackme mount=/mountpoint.ogv&lt;br /&gt;
:Note that the above pipeline will slowly lose audio/video synchronization due to hardware-level limitations in audio vs. video capture of media samples.  FireWire and SDI-based capture does not have these limitations.&lt;br /&gt;
&lt;br /&gt;
===Two v4l2 sources combined side-by-side into rectangular video + ALSA -&amp;gt; Ogg Theora -&amp;gt; IceCast===&lt;br /&gt;
*mplayer tv:// -tv device=/dev/video0:driver=v4l2:norm=NTSC:width=320:height=240:outfmt=uyvy:input=1:buffersize=16: -ao null&lt;br /&gt;
*mplayer tv:// -tv device=/dev/video1:driver=v4l2:norm=NTSC:width=320:height=240:outfmt=uyvy:input=1:buffersize=16: -ao null&lt;br /&gt;
*gst-launch --eos-on-shutdown v4l2src device=/dev/video0 ! videoscale ! video/x-raw-yuv,width=320,height=240,interlaced=true ! queue max-size-bytes=100000000 max-size-time=0 ! gamma gamma=1.2 ! queue max-size-bytes=100000000 max-size-time=0 ! videobalance saturation=1.9 brightness=0.00 contrast=1.4 hue=0.06 ! ffmpegcolorspace ! queue max-size-bytes=100000000 max-size-time=0 ! videorate ! video/x-raw-yuv,framerate=15/1 ! queue max-size-bytes=100000000 max-size-time=0  ! ffmpegcolorspace ! queue max-size-bytes=100000000 max-size-time=0  ! videomixer name=mix ! queue max-size-bytes=100000000 max-size-time=0 ! ffmpegcolorspace ! queue max-size-bytes=100000000 max-size-time=0 ! theoraenc bitrate=600 ! queue max-size-bytes=100000000 max-size-time=0 ! oggmux name=mux alsasrc device=hw:1,0 latency-time=100 ! queue max-size-bytes=100000000 max-size-time=0 ! audioconvert ! vorbisenc ! queue max-size-bytes=100000000 max-size-time=0 ! mux. mux. ! queue max-size-bytes=100000000 max-size-time=0  ! shout2send ip=icecast-server.com password=hackme mount=/mountpoint.ogv  v4l2src device=/dev/video1 ! videoscale ! video/x-raw-yuv,width=320,height=240,interlaced=true ! gamma gamma=1.2 ! queue max-size-bytes=100000000 max-size-time=0 ! videobalance saturation=1.9 brightness=0.00 contrast=1.4 hue=0.06 !  queue max-size-bytes=100000000 max-size-time=0 ! videorate ! video/x-raw-yuv,framerate=5/1 ! queue max-size-bytes=100000000 max-size-time=0 ! ffmpegcolorspace ! queue max-size-bytes=100000000 max-size-time=0  ! videobox border-alpha=0 fill=green left=-320 ! mix.&lt;br /&gt;
&lt;br /&gt;
===Create a video with an alpha channel from a sequence of PNG files===&lt;br /&gt;
*gst-launch-0.10 multifilesrc location=images%05d.png caps=&amp;quot;image/png,framerate=1/1,pixel-aspect-ratio=1/1&amp;quot; num-buffers=95 ! pngdec ! videorate ! alphacolor ! &amp;quot;video/x-raw-yuv,format=(fourcc)AYUV&amp;quot; ! matroskamux ! filesink location=images_raw.mkv&lt;br /&gt;
&lt;br /&gt;
===Capture from a 1680x1050 GNOME Desktop, Combine with ALSA -&amp;gt; Ogg Theora + Vorbis -&amp;gt; Icecast===&lt;br /&gt;
*gst-launch  --eos-on-shutdown ximagesrc ! queue max-size-bytes=100000000 max-size-time=0 ! videorate ! video/x-raw-rgb,framerate=3/1 ! queue max-size-bytes=100000000 max-size-time=0 ! videoscale ! video/x-raw-rgb, width=1056, height=660 ! queue max-size-bytes=100000000 max-size-time=0 ! ffmpegcolorspace ! queue max-size-bytes=100000000 max-size-time=0 ! theoraenc bitrate=450 keyframe-auto=false keyframe-force=12 keyframe-freq=12 speed-level=0 drop-frames=false ! queue max-size-bytes=100000000 max-size-time=0 ! oggmux name=mux alsasrc device=hw:0,0 ! audio/x-raw-init,rate=44100,channels=1 ! queue max-size-bytes=100000000 ! audioconvert ! vorbisenc ! queue max-size-bytes=100000000 max-size-time=0 ! mux. mux. ! queue max-size-bytes=100000000 max-size-time=0 ! shout2send ip=icecast-server.com  password=hackme mount=/mountpoint.ogv&lt;br /&gt;
*Icecast will need to be built from SVN (ver. 2.3.2 fails to relay data due to a bug)&lt;br /&gt;
*Viewers will need better-than-average internet connectivity (at least 1.5Mbits/sec down?)&lt;br /&gt;
*The simplest way to capture audio events is to place a mic next to computer speakers&lt;br /&gt;
*Avoid pipeline underruns by launching &#039;gnome-at-properties&#039;, uncheck &#039;Enable assistive technologies&#039;, launch &#039;gconf-editor&#039;, navigate to &#039;apps/metacity/general&#039; and uncheck &#039;reduced_resources&#039;.  This will enable wireframes while dragging windows and reduce other window animations.&lt;/div&gt;</summary>
		<author><name>Nidia Layson</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=GST_cookbook&amp;diff=12824</id>
		<title>GST cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=GST_cookbook&amp;diff=12824"/>
		<updated>2011-04-07T15:40:02Z</updated>

		<summary type="html">&lt;p&gt;Nidia Layson: /* Pull from a windows media stream, transcode to Ogg/Thera+Vorbis and send to a icecast server: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In addition to being a powerful multimedia infrastructure for applications Gstreamer is also a useful tool for general manipulations of multimedia data.  By invoking gst-launch from the command-line with a custom pipeline many useful processing steps are possible.&lt;br /&gt;
&lt;br /&gt;
Gstreamer also usually has good support for Xiph-related formats. &lt;br /&gt;
&lt;br /&gt;
Unfortunately, it can be rather difficult to figure out an appropriate pipeline without a starting point.&lt;br /&gt;
&lt;br /&gt;
Here are some useful examples: &amp;lt;!-- Don&#039;t complain about the selection of examples, I started this simply by grepping my shell history. Feel free to submit more and/or improve the existing ones --gmaxwell --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Encode a .wav to Vorbis:===&lt;br /&gt;
*gst-launch filesrc location=&amp;quot;INPUT.wav&amp;quot;  ! wavparse ! audioconvert ! vorbisenc ! oggmux ! filesink location=&amp;quot;OUTPUT.ogg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Dump a Theora video to PNGs:===&lt;br /&gt;
*gst-launch filesrc location=&amp;quot;INPUT.ogv&amp;quot; !  oggdemux ! theoradec ! ffmpegcolorspace ! pngenc snapshot=false ! multifilesink location=&amp;quot;OUTPUT%04d.png&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Transmux a MKV (containing vorbis and theora) to Ogg:===&lt;br /&gt;
*gst-launch filesrc location=&amp;quot;INPUT.mkv&amp;quot; ! matroskademux name=d ! video/x-theora ! queue ! theoraparse ! oggmux name=mux ! filesink location=&amp;quot;OUTPUT.ogv&amp;quot; d. ! audio/x-vorbis ! queue ! vorbisparse ! queue ! mux.&lt;br /&gt;
&lt;br /&gt;
===Encode a y4m to lossless Dirac in Ogg:===&lt;br /&gt;
*gst-launch filesrc location=&amp;quot;INPUT.y4m&amp;quot; ! decodebin ! schroenc force-profile=vc2_main rate-control=lossless ! oggmux ! filesink location=&amp;quot;OUTPUT.ogv&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Pull from a windows media stream, transcode to Ogg/Thera+Vorbis and send to a icecast server:===&lt;br /&gt;
(requires purchasing fluendo plugins for decoding the encumbered codecs)[http://www.registry-repair-tools.net registry repair download]&lt;br /&gt;
*gst-launch uridecodebin uri=mms://SOURCE.SERVER.COM/path name=d ! queue max-size-time=100000000 ! ffmpegcolorspace ! theoraenc bitrate=800 ! oggmux name=mux ! shout2send ip=YOURICECAST.SERVER.COM port=8000 password=YOURPASSWORD mount=/OUTPUTFILENAME.ogv d. ! queue max-size-time=100000000 ! audioconvert ! vorbisenc ! mux.&lt;br /&gt;
&lt;br /&gt;
===Capture video from a webcam, encode to an Ogg Theora file, decode and display on screen, write to a file whose name is the current date+time, and stream to an IceCast server===&lt;br /&gt;
*gst-launch-0.10 --eos-on-shutdown v4l2src ! &#039;video/x-raw-yuv, width=640, height=480&#039; ! videorate ! &#039;video/x-raw-yuv, framerate=15/1&#039; ! queue max-size-bytes=100000000 max-size-time=0 ! theoraenc bitrate=150 ! oggmux ! tee name=ogged ! queue max-size-bytes=100000000 max-size-time=0 ! oggdemux ! theoradec ! xvimagesink sync=false force-aspect-ratio=true ogged. ! queue max-size-bytes=100000000 max-size-time=0 ! filesink location=`date +%F_%T`.ogv ogged. ! queue max-size-bytes=100000000 max-size-time=0 ! shout2send ip=YOURICECAST.SERVER.COM port=8000 password=YOURPASSWORD mount=/OUTPUTFILENAME.ogv streamname=YOURSTREAMNAME description=YOURDESCRIPTION genre=YOURGENRE url=YOURSTREAMURL ogged.&lt;br /&gt;
&lt;br /&gt;
===A v4l2 source + ALSA source -&amp;gt; Ogg Theora -&amp;gt; IceCast===&lt;br /&gt;
*dov4l -i [0|1] -m NTSC&lt;br /&gt;
*gst-launch-0.10 --eos-on-shutdown v4l2src ! videoscale ! video/x-raw-yuv,width=320,height=240,framerate=30000/1001,interlaced=true ! queue max-size-bytes=100000000 max-size-time=0 ! gamma gamma=1.2 ! queue max-size-bytes=100000000 max-size-time=0 ! videobalance saturation=1.9 brightness=0.00 contrast=1.4 hue=0.06 ! ffmpegcolorspace ! queue max-size-bytes=100000000 max-size-time=0 ! theoraenc bitrate=400 ! queue max-size-bytes=100000000 max-size-time=0 ! oggmux name=mux alsasrc device=hw:1,0 latency-time=100 ! audioconvert ! vorbisenc ! queue max-size-bytes=100000000 max-size-time=0 ! mux. mux. ! queue max-size-bytes=100000000 max-size-time=0 ! shout2send ip=icecast-server.com  password=hackme mount=/mountpoint.ogv&lt;br /&gt;
:Note that the above pipeline will slowly lose audio/video synchronization due to hardware-level limitations in audio vs. video capture of media samples.  FireWire and SDI-based capture does not have these limitations.&lt;br /&gt;
&lt;br /&gt;
===Two v4l2 sources combined side-by-side into rectangular video + ALSA -&amp;gt; Ogg Theora -&amp;gt; IceCast===&lt;br /&gt;
*mplayer tv:// -tv device=/dev/video0:driver=v4l2:norm=NTSC:width=320:height=240:outfmt=uyvy:input=1:buffersize=16: -ao null&lt;br /&gt;
*mplayer tv:// -tv device=/dev/video1:driver=v4l2:norm=NTSC:width=320:height=240:outfmt=uyvy:input=1:buffersize=16: -ao null&lt;br /&gt;
*gst-launch --eos-on-shutdown v4l2src device=/dev/video0 ! videoscale ! video/x-raw-yuv,width=320,height=240,interlaced=true ! queue max-size-bytes=100000000 max-size-time=0 ! gamma gamma=1.2 ! queue max-size-bytes=100000000 max-size-time=0 ! videobalance saturation=1.9 brightness=0.00 contrast=1.4 hue=0.06 ! ffmpegcolorspace ! queue max-size-bytes=100000000 max-size-time=0 ! videorate ! video/x-raw-yuv,framerate=15/1 ! queue max-size-bytes=100000000 max-size-time=0  ! ffmpegcolorspace ! queue max-size-bytes=100000000 max-size-time=0  ! videomixer name=mix ! queue max-size-bytes=100000000 max-size-time=0 ! ffmpegcolorspace ! queue max-size-bytes=100000000 max-size-time=0 ! theoraenc bitrate=600 ! queue max-size-bytes=100000000 max-size-time=0 ! oggmux name=mux alsasrc device=hw:1,0 latency-time=100 ! queue max-size-bytes=100000000 max-size-time=0 ! audioconvert ! vorbisenc ! queue max-size-bytes=100000000 max-size-time=0 ! mux. mux. ! queue max-size-bytes=100000000 max-size-time=0  ! shout2send ip=icecast-server.com password=hackme mount=/mountpoint.ogv  v4l2src device=/dev/video1 ! videoscale ! video/x-raw-yuv,width=320,height=240,interlaced=true ! gamma gamma=1.2 ! queue max-size-bytes=100000000 max-size-time=0 ! videobalance saturation=1.9 brightness=0.00 contrast=1.4 hue=0.06 !  queue max-size-bytes=100000000 max-size-time=0 ! videorate ! video/x-raw-yuv,framerate=5/1 ! queue max-size-bytes=100000000 max-size-time=0 ! ffmpegcolorspace ! queue max-size-bytes=100000000 max-size-time=0  ! videobox border-alpha=0 fill=green left=-320 ! mix.&lt;br /&gt;
&lt;br /&gt;
===Create a video with an alpha channel from a sequence of PNG files===&lt;br /&gt;
*gst-launch-0.10 multifilesrc location=images%05d.png caps=&amp;quot;image/png,framerate=1/1,pixel-aspect-ratio=1/1&amp;quot; num-buffers=95 ! pngdec ! videorate ! alphacolor ! &amp;quot;video/x-raw-yuv,format=(fourcc)AYUV&amp;quot; ! matroskamux ! filesink location=images_raw.mkv&lt;br /&gt;
&lt;br /&gt;
===Capture from a 1680x1050 GNOME Desktop, Combine with ALSA -&amp;gt; Ogg Theora + Vorbis -&amp;gt; Icecast===&lt;br /&gt;
*gst-launch  --eos-on-shutdown ximagesrc ! queue max-size-bytes=100000000 max-size-time=0 ! videorate ! video/x-raw-rgb,framerate=3/1 ! queue max-size-bytes=100000000 max-size-time=0 ! videoscale ! video/x-raw-rgb, width=1056, height=660 ! queue max-size-bytes=100000000 max-size-time=0 ! ffmpegcolorspace ! queue max-size-bytes=100000000 max-size-time=0 ! theoraenc bitrate=450 keyframe-auto=false keyframe-force=12 keyframe-freq=12 speed-level=0 drop-frames=false ! queue max-size-bytes=100000000 max-size-time=0 ! oggmux name=mux alsasrc device=hw:0,0 ! audio/x-raw-init,rate=44100,channels=1 ! queue max-size-bytes=100000000 ! audioconvert ! vorbisenc ! queue max-size-bytes=100000000 max-size-time=0 ! mux. mux. ! queue max-size-bytes=100000000 max-size-time=0 ! shout2send ip=icecast-server.com  password=hackme mount=/mountpoint.ogv&lt;br /&gt;
*Icecast will need to be built from SVN (ver. 2.3.2 fails to relay data due to a bug)&lt;br /&gt;
*Viewers will need better-than-average internet connectivity (at least 1.5Mbits/sec down?)&lt;br /&gt;
*The simplest way to capture audio events is to place a mic next to computer speakers&lt;br /&gt;
*Avoid pipeline underruns by launching &#039;gnome-at-properties&#039;, uncheck &#039;Enable assistive technologies&#039;, launch &#039;gconf-editor&#039;, navigate to &#039;apps/metacity/general&#039; and uncheck &#039;reduced_resources&#039;.  This will enable wireframes while dragging windows and reduce other window animations.&lt;/div&gt;</summary>
		<author><name>Nidia Layson</name></author>
	</entry>
</feed>