-
Notifications
You must be signed in to change notification settings - Fork 3
GStreamer notes
List outstanding questions here. We may be able to consult with some experts.
- @Omwah is looking on how to package up the GStreamer stuff we are using.
List helpful notes here
A gstreamer pipeline is created by connecting various data sources, sinks and processing blocks (bins) in a data flow graph.
-
Example pipeline:
gst-launch -v filesrc location="videotestsrc.ogg" ! oggdemux name="demux" demux. ! queue ! theoradec ! xvimagesink demux. ! vorbisdec ! audioconvert ! pulsesink
-
GStreamer has a concept of "tee" that is similar to Unix "tee". This should allow us to stream to a live stream and archive the video. However, since the monitoring computer uses the RTSP stream directly, this feature might not be necessary for us.
-
Here is a sample commandline that seems to work to capture the stream and saving it to a file:
gst-launch-0.10 rtspsrc location=rtsp://192.168.2.155:554/profile3/media.smp latency=0 ! decodebin ! jpegenc ! avimux ! filesink location=output.avi
-
Here is another version of that command that might dumping the audio out to a file
gst-launch-1.0 -v rtspsrc location=rtsp://192.168.2.155:554/profile3/media.smp latency=0 ! rtppcmudepay ! filesink location=test.out
-
To use wavenc, it seems to work with gst-launch-0.10, but not gst-launch-1.0
gst-launch-1.0 -v rtspsrc location=rtsp://192.168.2.155:554/profile3/media.smp latency=0 ! rtppcmudepay ! wavenc ! filesink location=test.wav
-
Using GStreamer 1.0 - note, this saves the audio as a WAV (16-bit PCM araw, 8000Khz mono)
gst-launch-1.0 rtspsrc location=rtsp://192.168.2.155:554/profile3/media.smp latency=0 ! queue ! rtppcmudepay ! mulawdec ! audioconvert ! wavenc ! filesink location=test.wav
-
Using GStreamer 0.10 - audio resampling
gst-launch-0.10 rtspsrc location=$STREAM_URI latency=0 ! rtppcmudepay ! mulawdec ! audioconvert ! audioresample ! wavenc ! filesink location=test.wav
-
Using GStreamer 0.10 - resample 16-bit, 16 KHz PCM
gst-launch-0.10 rtspsrc location=rtsp://192.168.2.155:554/profile3/media.smp latency=0 ! rtppcmudepay ! mulawdec ! audioconvert ! audio/x-raw-int, channels=1 ! audioresample ! audio/x-raw-int, rate=16000,depth=16 ! wavenc ! filesink location=test.wav
-
Using GStreamer 1.0 - Read from camera resample and encode as AAC-LC 44.1K 128k bbps pass video unchanged write mpeg4 transport stream to disk.
gst-launch-1.0 mpegtsmux name=muxer ! filesink location=video.ts rtspsrc location=rtspt://192.168.2.155:554/profile3/media.smp latency=0 name=camera camera. ! rtph264depay ! queue ! muxer. camera. ! rtppcmudepay ! queue name=cam ! mulawdec ! audioconvert ! audioresample ! audio/x-raw, rate=44100 ! voaacenc bitrate=128000 ! muxer.
-
Push video/audio to youtube live. Ilan's note is that he was able to push a test pattern stream using gstreamer's videotestsrc, and also the Big Bunny video, too.
gst-launch-1.0 -v --gst-debug=flvmux:0,rtmpsink:0 videotestsrc pattern=0 is-live=true ! video/x-raw, framerate=30/1, width=1280, height=720 ! queue ! videoconvert ! x264enc bitrate=4000 key-int-max=60 bframes=0 byte-stream=false aud=true tune=zerolatency ! h264parse ! video/x-h264,level=(string)4.1,profile=main ! queue ! mux. audiotestsrc is-live=true ! audio/x-raw, format=(string)S16LE, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2 ! queue ! voaacenc bitrate=128000 ! aacparse ! audio/mpeg,mpegversion=4,stream-format=raw ! queue ! flvmux streamable=true name=mux ! queue ! rtmpsink location=rtmp://a.rtmp.youtube.com/live2/x/southern-califo-0973.ttxj-67da-4s1m-9hgh?videoKeyframeFrequency=1&totalDatarate=4128 app=live2 flashVer="FME/3.0%20(compatible;%20FMSc%201.0)" swfUrl=rtmp://a.rtmp.youtube.com/live2
List helpful links here
- A Weekend with GStreamer
- More Gstreamer Tips: Picture in Picture Compositing
- GStreamer Cheat Sheet
- Webcam and Linux GStreamer Tutorial
- Setting up Jack Audio for GStreamer
- Texas Instruments Example GStreamer Pipelines - may be specific to TI boards
- Example GStreamer Pipelines - may be specific to TI hardware
-
Stackoverflow:GStreamer RTSP Playing with Sound - this might help with our search to grab the audio so we can do convert and reencode it.
-
GStreamer mulaw plugin - Information regarding a plugin that will convert between 8-bit mulaw and 16-bit PCM and vice versa.
-
Forum thread on muxing and demuxing - This example code is a hint of how we can process audio and video separately and remux it. gst-launch filesrc location=Kennedy_inauguration_footage.ogg ! oggdemux name=demux { avimux name=mux ! filesink location=output.avi } { demux. ! queue ! vorbisdec ! audioconvert ! lame ! queue ! mux. } { demux. ! queue ! theoradec ! xvidenc ! mux. }
-
gst-switch - interactive live mixing of incoming video streams, designed to meet the needs of conference recording.
-
speaker-track - extensions to gst-switch and GStreamer to track speakers using PTZ rather than needing a camera operator
-
Snowmix - video mixer tool for mixing live and recorded video and audio feeds. It supports clipping, scaling and transparent overlay of video, png graphics and text. It supports animation of video, images and texts through native commands changing scale, placement, transparency and rotation. Animation and actions can also be controlled through native scripting and an embedded Tcl interpreter. Snowmix is designed for control over low bandwidth links and can work as a standalone CLI based program. Control over both CLI and a TCP connections. Live and recorded video feeds can be fed to the mixer via GStreamer pipelines. Output can be accessed through GStreamer pipelines.