<?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=Mithro</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=Mithro"/>
	<link rel="alternate" type="text/html" href="https://wiki.xiph.org/Special:Contributions/Mithro"/>
	<updated>2026-05-15T07:24:02Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=GST_cookbook&amp;diff=16130</id>
		<title>GST cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=GST_cookbook&amp;diff=16130"/>
		<updated>2015-10-29T00:01:28Z</updated>

		<summary type="html">&lt;p&gt;Mithro: /* hdmi2usb capture (timvideos.us) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GStreamer is a powerful multimedia infrastructure for applications—providing a number of programming language constructs and bindings—but also provides easy-to-use rapid prototyping tools to test new multimedia pipelines.  Additionally, Gstreamer 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.  This page is a collection of gst-launch pipelines that can be used on an as-needed basis.  [http://gentrans.sourceforge.net/ GEntrans] is a command-line tool helpful in visualizing queue states (i.e., static/under/overfilled), dynamically, for a given gst-launch pipeline.  Queues can have a large impact on &amp;quot;even&amp;quot; pipeline performance, for example in avoiding intermittent frame pauses as the pipeline blocks on some other operation.&lt;br /&gt;
&lt;br /&gt;
Texas Instruments offers a [http://processors.wiki.ti.com/index.php/Example_GStreamer_Pipelines list of example pipelines] for TI mobile devices.&lt;br /&gt;
&lt;br /&gt;
Hold down the &#039;control&#039; key in combination with BASH cursor-left (left arrow) or cursor-right (right arrow) to quickly edit the commands listed here.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #ffffff; border: 1px solid #000000; color: black; font-weight: bold; margin: 2em 0 1em; padding: .5em 1em; vertical-align: middle;&amp;quot;&amp;gt;Note that some examples are &amp;quot;high-performance&amp;quot; pipelines which require purpose-built systems.&amp;lt;br&amp;gt;[https://gitorious.org/openvideo_reference_build &#039;Open Video&#039; Reference Build Script]&amp;lt;/div&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&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/Theora+Vorbis and send to a icecast server:===&lt;br /&gt;
(may require purchasing Fluendo plugins for decoding the encumbered codecs)&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; Dual Ogg Theora + Ogg Vorbis Streams -&amp;gt; Icecast ===&lt;br /&gt;
*dov4l -i [0|1] -m NTSC&lt;br /&gt;
*gst-launch-0.10 --eos-on-shutdown v4l2src device=/dev/video0 ! queue max-size-bytes=100000000 max-size-time=0 ! deinterlace mode=interlaced ! 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 ! videoscale ! video/x-raw-yuv,width=360,height=240,pixel-aspect-ratio=1/1 ! 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 ! queue max-size-bytes=100000000 max-size-time=0 ! 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:0,0 latency-time=100 ! queue max-size-bytes=100000000 max-size-time=0 ! audioconvert ! queue max-size-bytes=100000000 max-size-time=0 ! audioamplify amplification=[1-6 or so] ! queue max-size-bytes=100000000 max-size-time=0 ! vorbisenc ! queue max-size-bytes=100000000 max-size-time=0 ! tee name=vorbisaudio ! queue max-size-bytes=100000000 max-size-time=0 ! mux. mux. ! queue max-size-bytes=100000000 max-size-time=0 ! shout2send ip=server.com port=[80|8000] password=hackme mount=/mountpoint.ogv  vorbisaudio. ! queue max-size-bytes=100000000 max-size-time=0 ! oggmux ! queue max-size-bytes=100000000 max-size-time=0 ! shout2send ip=server.com port=[80|8000] password=hackme mount=/mountpoint.oga&lt;br /&gt;
&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 1280x800 (1680x1050) GNOME Desktop -&amp;gt; Ogg Theora -&amp;gt; Icecast===&lt;br /&gt;
gst-launch-1.0 --eos-on-shutdown ximagesrc ! capsfilter caps=video/x-raw,framerate=4/1,width=1280,height=800  ! queue max-size-bytes=100000000 max-size-time=0 ! videoscale ! video/x-raw, width=1056, height=660 ! queue max-size-bytes=100000000 max-size-time=0 ! videoconvert ! queue max-size-bytes=100000000 max-size-time=0 ! theoraenc bitrate=400 keyframe-auto=false keyframe-force=12 keyframe-freq=12 speed-level=1 drop-frames=false ! queue max-size-bytes=100000000 max-size-time=0 ! oggmux ! queue max-size-bytes=100000000 max-size-time=0 ! shout2send ip=host.com port=[80|8000] password=hackme mount=/mountpoint.ogv&lt;br /&gt;
&lt;br /&gt;
===Capture from a 1680x1050 GNOME Desktop, Combine with Desktop Audio (Pulse) -&amp;gt; Ogg Theora + Vorbis -&amp;gt; Icecast===&lt;br /&gt;
*gst-launch-1.0 --eos-on-shutdown ximagesrc use-damage=false ! capsfilter caps=video/x-raw,framerate=4/1,width=1680,height=1050 ! queue max-size-bytes=100000000 max-size-time=0 ! videoconvert ! queue max-size-bytes=100000000 max-size-time=0 ! theoraenc bitrate=350 keyframe-auto=false keyframe-force=12 keyframe-freq=12 speed-level=1 drop-frames=false ! queue max-size-bytes=100000000 max-size-time=0 ! oggmux name=mux  pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! queue max-size-bytes=100000000 ! audioconvert ! queue max-size-bytes=100000000 max-size-time=0 ! vorbisenc ! queue max-size-bytes=100000000 max-size-time=0 ! mux. mux. ! queue max-size-bytes=100000000 max-size-time=0 ! shout2send ip=host.com port=[80|8000] password=hackme mount=/mountpoint.ogv&lt;br /&gt;
&lt;br /&gt;
*The pulseaudio/pulsesrc device may need to be changed depending on the machine: run &#039;pactl list short sources | cut -f2&#039; to see options&lt;br /&gt;
*Viewers will need better-than-average internet connectivity (around 1.2Mbits/sec)&lt;br /&gt;
&lt;br /&gt;
===Live-stream a high-resolution Mac OSX Desktop at 1 FPS===&lt;br /&gt;
*Tested on Version 10.6.8, newer releases not compatible with [https://github.com/davibe/osximagesrc osximagesrc]&lt;br /&gt;
&lt;br /&gt;
gst-launch --eos-on-shutdown osximagesrc ! queue max-size-bytes=100000000 max-size-time=0 ! ffmpegcolorspace ! videoscale method=4-tap ! video/x-raw-yuv, width=960, height=600 ! queue max-size-bytes=100000000 max-size-time=0 ! theoraenc bitrate=360 keyframe-auto=false keyframe-force=3 keyframe-freq=3 speed-level=0 drop-frames=false ! queue max-size-bytes=100000000 max-size-time=0 ! oggmux ! queue max-size-bytes=100000000 max-size-time=0 ! shout2send ip=host.com password=hackme mount=/mountpoint.ogv&lt;br /&gt;
&lt;br /&gt;
If the screen resolution is set to mirrored 1024x640 (?), start the following &#039;&#039;then&#039;&#039; plug in the video display cable:&lt;br /&gt;
*gst-launch --eos-on-shutdown osximagesrc ! queue max-size-time=0 max-size-bytes=100000000 ! ffmpegcolorspace ! queue max-size-time=0 max-size-bytes=100000000 ! videocrop right=256 top=32 ! queue max-size-time=0 max-size-bytes=100000000 ! videoscale ! video/x-raw-yuv, width=658, height=486 ! queue max-size-time=0 max-size-bytes=100000000 ! theoraenc bitrate=300 keyframe-auto=false keyframe-force=3 keyframe-freq=3 speed-level=0 drop-frames=false ! queue max-size-time=0 max-size-bytes=100000000 ! oggmux ! queue  max-size-time=0 max-size-bytes=100000000 ! shout2send ip=host.com port=8000 password=hackme mount=/mountpoint.ogv&lt;br /&gt;
&lt;br /&gt;
*Streamed Keynote talks will stream the Presenter&#039;s View -- no switching between display mirrors&lt;br /&gt;
*Full-screen Flash video doesn&#039;t stream, but doesn&#039;t halt the pipeline&lt;br /&gt;
&lt;br /&gt;
===Live-stream an Elphel 353L camera, combine with on-laptop audio capture, save a high-res copy to disk, and view live audio+video on-screen===&lt;br /&gt;
*Tested on an 2.4GHz Core i3 running at ≥2.0GHz.  Both CPU cores should be at ~50% continuously-smooth utilization after the first ~15 seconds; battery-only power or overheating may throttle the CPU leading to dropped frames.&lt;br /&gt;
*Set the camera to 2592x1120 @ 18FPS.  Adjust camera controls to ensure the camera achieves this framerate.&lt;br /&gt;
*Kill/renice any resource-competitive applications (file indexing services, Firefox, Audacity, etc.)&lt;br /&gt;
*qjackctl &amp;amp;  → Start JACK in realtime priority&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*gst-launch-&#039;&#039;&#039;1.0&#039;&#039;&#039; -e  rtspsrc location=rtsp://192.168.0.9:554 latency=100 ! queue max-size-bytes=100000000 max-size-time=0 ! rtpjpegdepay ! queue max-size-bytes=100000000 max-size-time=0 ! jpegdec max-errors=-1 ! queue max-size-bytes=100000000 max-size-time=0 ! videorate ! video/x-raw,framerate=18/1 ! queue max-size-bytes=100000000 max-size-time=0 ! videoscale ! video/x-raw, width=1296, height=560 ! queue max-size-bytes=100000000 max-size-time=0 ! tee name=halfres ! queue max-size-bytes=100000000 max-size-time=0 ! jpegenc ! queue max-size-bytes=100000000 max-size-time=0 ! matroskamux name=mux jackaudiosrc connect=1 client-name=&amp;quot;GStreamer Input&amp;quot; ! queue max-size-bytes=100000000 max-size-time=0 !  tee name=jackaudio ! queue max-size-bytes=100000000 max-size-time=0 ! vorbisenc ! queue max-size-bytes=100000000 max-size-time=0 ! tee name=vorbisaudio !  queue max-size-bytes=100000000 max-size-time=0 ! mux. mux. ! queue max-size-bytes=100000000 max-size-time=0 ! filesink location=elphel_recording_`date +%s`.mkv sync=false halfres. ! queue max-size-bytes=100000000 max-size-time=0 ! videoscale ! video/x-raw,width=648, height=280 ! queue max-size-bytes=100000000 max-size-time=0 ! theoraenc bitrate=500 speed-level=1 ! queue max-size-bytes=100000000 max-size-time=0  ! oggmux name=livestream vorbisaudio. !  queue max-size-bytes=100000000 max-size-time=0 ! livestream. livestream. ! queue max-size-bytes=0 max-size-time=0 ! shout2send ip=host.com port=[80|8000] password=hackme mount=/mountpoint.ogv  halfres. ! videoscale add-borders=true ! queue max-size-bytes=100000000 max-size-time=0 ! videoconvert ! queue max-size-bytes=100000000 max-size-time=0 ! xvimagesink sync=false  jackaudio. ! queue max-size-bytes=100000000 max-size-time=0 ! audioconvert ! queue max-size-bytes=100000000 max-size-time=0 ! alsasink&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*Expect a ~50GB recording for 8hrs. of recording depending on image complexity.  The Matroska recording may be viewed directly in VLC (≥2.0 recommended) and may be transcoded to commonly-used formats &#039;&#039;via&#039;&#039; [http://www.mirovideoconverter.com/ Miro Video Converter] or [http://firefogg.org/ Firefogg].&lt;br /&gt;
:Alternatively: ffmpeg -i elphel_recording.mkv -acodec libfaac -ab 128k -pass 1 -vcodec libx264 -vpre slow -vpre main -b 8000k -threads 8 -f mp4 -y elphel_recording.mp4 &lt;br /&gt;
&lt;br /&gt;
====Same as above, but simultaneously broadcast in H.264 ====&lt;br /&gt;
Tested with [http://www.rtmpd.com/ crtmpserver] (works) and [https://gitorious.org/moment-archive Moment Video Server] (in theory)&lt;br /&gt;
&lt;br /&gt;
For crtmpserver:&lt;br /&gt;
*Remove a &#039;tags_written++&#039; line from &#039;./gst/flv/gstflvmux.c&#039; as per [https://bugzilla.gnome.org/show_bug.cgi?id=661624 Bug 661624]&lt;br /&gt;
*crtmpserver.lua should be customized for the streaming application (a mostly undocumented step...)&lt;br /&gt;
&lt;br /&gt;
For Moment:&lt;br /&gt;
*Remove &#039;pingTimerTick&#039; &#039;from moment/rtmp_connection.cpp&#039; to avoid stream resets&lt;br /&gt;
&lt;br /&gt;
For both:&lt;br /&gt;
*Toggle &#039;byte-stream=[true|false]&#039; and &#039;[tcpclientsink|rtmpsink]&#039; as necessary, possibly &#039;[flvmux|mp4mux]&#039; if needed.&lt;br /&gt;
*Test stream availability with [http://dl.dropbox.com/u/2918563/flvplayback.swf this tool.]&lt;br /&gt;
*Substitute &#039;videotestsrc is-live=true&#039; for &#039;rtspsrc ... jpegdec&#039; and &#039;audiotestsrc freq=432&#039; for &#039;jackaudiosrc connect=1&#039; for testing.&lt;br /&gt;
*&#039;rtmpsink&#039; isn&#039;t yet(?) compatible with Akamai&lt;br /&gt;
&lt;br /&gt;
*gst-launch-0.10 -e rtspsrc location=rtsp://192.168.0.9:554 latency=100 ! queue max-size-bytes=100000000 max-size-time=0 ! rtpjpegdepay ! queue max-size-bytes=100000000 max-size-time=0 ! jpegdec ! queue max-size-bytes=100000000 max-size-time=0 ! videorate ! video/x-raw-yuv,framerate=18/1 ! queue max-size-bytes=100000000 max-size-time=0 ! videoscale ! video/x-raw-yuv, width=1296, height=560 ! queue max-size-bytes=100000000 max-size-time=0 ! tee name=halfres ! queue max-size-bytes=100000000 max-size-time=0 ! jpegenc ! queue max-size-bytes=100000000 max-size-time=0 ! matroskamux name=mkvmux jackaudiosrc connect=1 ! queue max-size-bytes=100000000 max-size-time=0 ! tee name=jackaudio ! queue max-size-bytes=100000000 max-size-time=0 ! vorbisenc ! queue max-size-bytes=100000000 max-size-time=0 ! tee name=vorbisaudio ! queue max-size-bytes=100000000 max-size-time=0 ! mkvmux. mkvmux. ! queue max-size-bytes=100000000 max-size-time=0 ! filesink location=elphel_recording_`date +%F_%T`.mkv  halfres. ! queue max-size-bytes=100000000 max-size-time=0 ! videoscale ! video/x-raw-yuv, width=648, height=280 ! queue max-size-bytes=100000000 max-size-time=0 ! tee name=quarterres !  queue max-size-bytes=100000000 max-size-time=0 ! x264enc sliced-threads=true cabac=true intra-refresh=false quantizer=22 rc-lookahead=15 bitrate=600 tune=zerolatency byte-stream=false ! queue max-size-bytes=100000000 max-size-time=0 ! flvmux streamable=true name=flvmux jackaudio. ! queue max-size-bytes=100000000 max-size-time=0 ! audioconvert ! queue max-size-bytes=100000000 max-size-time=0 ! faac ! queue max-size-bytes=100000000 max-size-time=0 ! flvmux.  flvmux. ! queue max-size-bytes=0 max-size-time=0 ! tcpclientsink host=127.0.0.1 port=6666  quarterres. ! queue max-size-bytes=100000000 max-size-time=0 ! theoraenc bitrate=600 speed-level=1 ! queue max-size-bytes=100000000 max-size-time=0  ! oggmux name=livestream jackaudio. ! queue max-size-bytes=100000000 max-size-time=0 ! vorbisenc ! queue max-size-bytes=100000000 max-size-time=0 ! livestream. livestream. ! queue max-size-bytes=0 max-size-time=0 ! shout2send ip=host.com port=[80|8000] password=hackme mount=/mountpoint.ogv  halfres. ! queue max-size-bytes=100000000 max-size-time=0 ! ffmpegcolorspace ! queue max-size-bytes=100000000 max-size-time=0 ! xvimagesink sync=false&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;div id=ElphelJP46&amp;gt;Live-stream an Elphel 353L camera set at &#039;FullHD&#039; JP46, combine with realtime audio, save a high-res copy to disk, and monitor live audio+video on-screen&amp;lt;/div&amp;gt;===&lt;br /&gt;
*[https://media.xiph.org/jp46_cookbook/ Video samples]&lt;br /&gt;
*Setup a high-performance system: tested on Gigabyte GA-MA785GMT-UD2H + (non-overclocked) Phenom II X4 [[GST_cookbook/gNewSense|built using gNewSense.]]  CPU utilization approaches 100%, continuously, across all four 3.2GHz cores.&lt;br /&gt;
*Set the camera to 1920x1088, JPEG Image Quality @ 90%, JP46 color mode&lt;br /&gt;
In separate tabs:&lt;br /&gt;
*jackd -R -d alsa -C -d hw:2 -r 48000 -i 1&lt;br /&gt;
*gst-launch-0.10 -e rtspsrc location=rtsp://192.168.1.50:554 protocols=0x00000001 latency=100 ! rtpjpegdepay ! queue max-size-bytes=1000000000 max-size-time=0 ! videorate force-fps=18 ! queue max-size-bytes=1000000000 max-size-time=0 ! jpegdec max-errors=-1 idct-method=2 ! queue max-size-bytes=1000000000 max-size-time=0 ! jp462bayer threads=4 ! &amp;quot;video/x-raw-bayer, width=(int)1920, height=(int)1088, format=(string)grbg&amp;quot; ! queue max-size-bytes=1000000000 max-size-time=0 ! bayer2rgb2 method=0 ! queue max-size-bytes=1000000000 max-size-time=0 ! ffmpegcolorspace ! &amp;quot;video/x-raw-yuv, format=(fourcc)I420&amp;quot; ! queue max-size-bytes=1000000000 max-size-time=0 ! videobalance saturation=1.9 ! queue max-size-bytes=1000000000 max-size-time=0 ! tee name=fullHD ! queue max-size-bytes=100000000 max-size-time=0 ! jpegenc idct-method=2 ! queue max-size-bytes=100000000 max-size-time=0 ! matroskamux name=mux  jackaudiosrc connect=1 ! queue max-size-time=0 ! audio/x-raw-float,channels=1 ! queue max-size-time=0 ! tee name=jackaudio ! queue max-size-time=0 ! vorbisenc max-bitrate=80000 ! queue max-size-time=0 ! tee name=vorbisaudio ! queue max-size-time=0 ! mux.  mux. ! queue max-size-bytes=1000000000 max-size-time=0 ! filesink location=elphel_recording_`date +%s`.mkv sync=false  fullHD. ! queue max-size-bytes=1000000000 max-size-time=0 ! videoscale ! &amp;quot;video/x-raw-yuv, width=640, height=363, aspect-ratio=(fraction)1/1&amp;quot; ! queue max-size-bytes=1000000000 max-size-time=0 ! tee name=downsample ! queue max-size-bytes=1000000000 max-size-time=0 ! ffmpegcolorspace ! queue max-size-bytes=1000000000 max-size-time=0 ! ximagesink pixel-aspect-ratio=1/1 sync=false downsample. ! queue max-size-bytes=100000000 max-size-time=0 ! queue max-size-bytes=1000000000 max-size-time=0 ! theoraenc bitrate=550 speed-level=1 ! queue max-size-bytes=100000000 max-size-time=0 ! oggmux name=livestream  vorbisaudio. ! queue max-size-time=0 ! livestream.  livestream. ! queue max-size-bytes=0 max-size-time=0 ! shout2send ip=host.com port=[80|8000] password=hackme mount=/mountpoint.ogv  jackaudio. ! queue max-size-time=0 ! audioconvert ! queue max-size-time=0 ! alsasink&lt;br /&gt;
&lt;br /&gt;
===Select an Elphel 353L camera as the video source, widescreen, in Google[+] Video Chat/Hangouts (Linux only)===&lt;br /&gt;
*Requires a [https://www.google.com/tools/dlpage/hangoutplugin/download.html proprietary Google plugin]&lt;br /&gt;
*Also requires the [https://github.com/umlaeute/v4l2loopback v4l2loopback kernel module] loaded (w/o parameters).  Note an unresolved [https://github.com/umlaeute/v4l2loopback/issues/60 v4l2loopback bug] may trigger GStreamer &amp;quot;Internal data flow error&amp;quot; pipeline failures.&lt;br /&gt;
*Set the camera to 2592x1120 @ 18FPS.  Adjust camera controls to ensure the camera achieves this framerate.&lt;br /&gt;
*gst-launch-1.0 -e rtspsrc location=rtsp://192.168.0.9:554 latency=100 ! queue max-size-bytes=100000000 max-size-time=0 ! rtpjpegdepay !  queue max-size-bytes=100000000 max-size-time=0 ! jpegdec ! queue max-size-bytes=100000000 max-size-time=0 ! videorate ! &amp;quot;video/x-raw,framerate=(fraction)30/1&amp;quot; ! queue max-size-bytes=100000000 max-size-time=0 ! videoscale ! &amp;quot;video/x-raw,width=640,height=480&amp;quot; ! queue max-size-bytes=100000000 max-size-time=0 ! videoconvert ! &amp;quot;video/x-raw,format=(string)YUY2,pixel-aspect-ratio=(fraction)1/1&amp;quot; ! v4l2sink  device=/dev/video0&lt;br /&gt;
*Launch Google Talk/Google+ Hangout and select &#039;Loopback video device 0&#039; as the video input source.  Syncroniced audio &#039;&#039;via&#039;&#039; the v4l2 API is untested -- select an ALSA audio source as appropriate.&lt;br /&gt;
*Re-nice &#039;GoogleTalkPlugin&#039; and both &#039;plugin-container&#039; processes to &#039;-15&#039;.  Tested on  Abrowser 26.0 + Trisquel + linux-libre-3.12 + google-talkplugin ver. 4.9.1.0-1.&lt;br /&gt;
&lt;br /&gt;
===Debayer + convert to RGB a single JP46 frame using Elphel 353L===&lt;br /&gt;
*Use the following to extracting the highest-quality image possible (save JP4):&lt;br /&gt;
*Set the Elphel camera to operate in JP46 mode using full-frame imaging (&#039;&#039;i.e.&#039;&#039;, 2592x1936)&lt;br /&gt;
*&amp;quot;Shift+Click&amp;quot; on the &amp;quot;view image&amp;quot; icon in the Elphel Camera Control Interface to save an image still&lt;br /&gt;
*gst-launch-0.10 filesrc location=&amp;quot;/path/to/elphelimg_nnnnnnn.jp46&amp;quot;  ! queue max-size-bytes=1000000000 ! jpegdec idct-method=2  ! queue max-size-bytes=1000000000 !  jp462bayer ! &amp;quot;video/x-raw-bayer, width=(int)2592, height=(int)1936, format=(string)grbg&amp;quot; ! queue max-size-bytes=1000000000 ! bayer2rgb2 method=4 ! queue max-size-bytes=1000000000 ! pngenc compression-level=9 ! queue max-size-bytes=1000000000 ! filesink location=&amp;quot;/path/to/outputimage.png&amp;quot;&lt;br /&gt;
*Open with GIMP&lt;br /&gt;
&lt;br /&gt;
===Extract a series of individual JPEGs from Matroska+M-JPEG into a folder===&lt;br /&gt;
*GST_DEBUG=GST_BUS:5 gst-launch-0.10  filesrc location=recording.mkv ! queue ! matroskademux ! queue ! videorate ! image/jpeg,framerate=1/10 ! queue ! multifilesink post-messages=true location=&amp;quot;image%04d.jpg&amp;quot; sync=false 2&amp;gt;gst-bus-debug.log&lt;br /&gt;
*Remove any colons input filenames to avoid BASH issues&lt;br /&gt;
*Change the framerate to control the time interval between image stills and number of produced stills&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*After the above command is run the images should be generated.  To add EXIF timestamps to each JPG:&lt;br /&gt;
*cat gst-bus-debug.log | grep timestamp | grep dispatch | sed -e s/^.*filename[=].string.//g  -e s/..stream.time.*//g -e s/[,].*\)/=/g -e s/000000000//g &amp;gt;timestamps.log&lt;br /&gt;
*[TODO: create a BASH script or similar for the next step]&lt;br /&gt;
*exiftool -DateTimeOriginal=&amp;quot;`date -d @start-of-recording_unixtimestamp+offset-for-this-image-from-log-file --rfc-3339=seconds`&amp;quot; -overwrite_original *.jpg&lt;br /&gt;
&lt;br /&gt;
====Run color-correction on the extracted JPEGs with G&#039;MIC====&lt;br /&gt;
*for i in *jpg; do mv $i tmp.jpg ; gmic tmp.jpg --apply_curve 0,1,1,10,1,116,172,183,204,255,255 -o[1] $i,90; done&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*for i in *jpg; do mv $i tmp.jpg ; gmic tmp.jpg --balance_gamma 68,68,68 -o[1] $i,90; done&lt;br /&gt;
*The specified reference color must be in RGB, not hex.  Use the gimp-gmic plugin to interactively find values that work well for your photoset.&lt;br /&gt;
&lt;br /&gt;
===Add EXIF Metadata to generated image stills===&lt;br /&gt;
*This command will &#039;&#039;replace&#039;&#039; images in a directory with the same image, metadata included - be sure to have backup copies.&lt;br /&gt;
*&amp;quot;-flash#=0x0020&amp;quot; indicates that the camera has no flash capability.&lt;br /&gt;
*Generally compatible with [http://mediagoblin.org/ MediaGoblin]&lt;br /&gt;
*exiftool  -Author=&#039;Your name&#039; -Copyright=&#039;copyright license + URL&#039; -make=&#039;Elphel Inc.&#039; -model=&#039;Elphel NC353L-12V&#039;  -Xresolution=72 -Yresolution=72  -resolutionunit=inches -flash#=0x0020 -DateTimeOriginal=&#039;2012:05:04 10:00:00-5&#039; -exposuremode=&#039;Manual&#039; -FNumber=&#039;1.4&#039; -UserComment=&#039;Lens or adapter used, or other notes&#039; -GPSLatitude=42.36160 -GPSLatitudeRef=N -GPSLongitude=71.09064 -GPSLongitudeRef=W  -overwrite_original *.jpg&lt;br /&gt;
&lt;br /&gt;
===HDMI2USB.tv capture (timvideos.us)===&lt;br /&gt;
*Big recording; a/v sync not yet addressed.  Prototyping pipeline:&lt;br /&gt;
*Thing here wasn&#039;t HDMI2USB related at all&lt;br /&gt;
&lt;br /&gt;
===Mix Three Video Sources Side-by-Side-by-Side===&lt;br /&gt;
*May be sensitive to internal element-construction race conditions using gst-launch -- this is largely a proof-of-concept template for programming applications.&lt;br /&gt;
*gst-launch-1.0 --eos-on-shutdown videotestsrc pattern=6 is-live=true ! queue max-size-bytes=100000000 max-size-time=0 ! videorate ! video/x-raw,framerate=15/1 ! queue max-size-bytes=100000000 max-size-time=0 ! videoscale ! video/x-raw,width=320,height=240 ! queue max-size-bytes=100000000 max-size-time=0 ! clockoverlay halignment=1 valignment=1 shaded-background=true font-desc=&amp;quot;Sans Bold 80&amp;quot; ypad=80 ! queue max-size-bytes=100000000 max-size-time=0  ! videobox border-alpha=0 fill=green left=-320 ! queue max-size-bytes=100000000 max-size-time=0 ! videomixer name=mix ! queue max-size-bytes=100000000 max-size-time=0 ! tee name=trivideo ! queue max-size-bytes=100000000 max-size-time=0 ! ximagesink sync=false  videotestsrc pattern=22 ! queue max-size-bytes=100000000 max-size-time=0 ! videorate ! video/x-raw,framerate=15/1 ! queue max-size-bytes=100000000 max-size-time=0 ! videoscale ! video/x-raw,width=320,height=240 ! queue max-size-bytes=100000000 max-size-time=0 ! mix.  videotestsrc is-live=true ! queue max-size-bytes=100000000 max-size-time=0 ! videorate ! video/x-raw,framerate=15/1 ! queue max-size-bytes=100000000 max-size-time=0 ! videoscale ! video/x-raw,width=320,height=240 ! queue max-size-bytes=100000000 max-size-time=0 ! videobox border-alpha=0 fill=blue left=-640 ! queue max-size-bytes=100000000 max-size-time=0 ! mix.&lt;/div&gt;</summary>
		<author><name>Mithro</name></author>
	</entry>
</feed>