gstreamer-cheat-sheet/README.md

70 lines
3.5 KiB
Markdown
Raw Permalink Normal View History

2018-02-20 12:26:20 +00:00
# GStreamer command-line cheat sheet
2018-02-20 12:23:23 +00:00
2022-07-20 20:23:04 +00:00
[GStreamer](https://gstreamer.freedesktop.org/) is a powerful library for manipulating audio and video - including live streams. This repo provides:
2022-07-20 20:23:04 +00:00
* a cheat sheet for GStreamer on the command-line, and
* a few [Python examples](python_examples/).
Whilst the command line is great, programmatic usage (in Python or another language) allows you to dynamically manipulate the A/V streams.
2018-02-20 12:23:23 +00:00
## Contents
2022-07-20 20:23:04 +00:00
* [Installing](installing.md)
2018-02-20 12:23:23 +00:00
* [Basics](basics.md)
* [Test streams](test_streams.md)
2018-02-20 12:23:23 +00:00
* [RTMP](rtmp.md)
2018-03-25 22:45:02 +00:00
* [Mixing video & audio](mixing.md)
* [Images](images.md)
* [Queues](queues.md)
* [Writing to files](writing_to_files.md)
2018-04-03 21:51:32 +00:00
* [Sending to multiple destinations (tee)](tee.md)
* [Sharing and receiving pipelines (including sending/receiving video from shared memory)](sharing_and_splitting_pipelines.md)
* [Network transfer](network_transfer.md) (including how to send so that VLC can preview)
* [RTP](rtp.md)
* [SRT](srt.md)
2018-02-20 12:23:23 +00:00
2018-02-20 12:26:20 +00:00
## Sources and references
2022-07-20 20:23:04 +00:00
* [Basic command line reference](https://gstreamer.freedesktop.org/documentation/tutorials/basic/gstreamer-tools.html?gi-language=c)
2018-03-26 10:08:07 +00:00
* [Pipeline examples](https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html#pipeline-examples)
2022-07-20 20:23:04 +00:00
* [List of all Gstreamer plugins](https://gstreamer.freedesktop.org/documentation/plugins_doc.html?gi-language=c)
2018-02-20 12:26:20 +00:00
* [Handy elements](https://gstreamer.freedesktop.org/documentation/tutorials/basic/handy-elements.html#uridecodebin)
2018-02-20 12:23:23 +00:00
## Other cheat-sheets
2022-07-20 20:23:04 +00:00
* <https://github.com/xmementoit/gstreamerCheatsheet/blob/master/README.md>
* <https://gist.github.com/nebgnahz/26a60cd28f671a8b7f522e80e75a9aa5>
2018-03-26 10:08:07 +00:00
## Interacting with the GStreamer pipeline
2018-02-25 17:16:08 +00:00
2018-04-03 21:51:32 +00:00
If you want to interact with GStreamer after it's started (e.g. respond to an event, or dynamically change a pipeline), the command-line GStreamer doesn't really cut it. Instead, here are some options:
2018-02-25 17:16:08 +00:00
* *[GStreamer Daemon (gstd)](https://github.com/RidgeRun/gstd-1.x)* - allows setting and updating via a TCP connection
2018-06-04 17:02:31 +00:00
* *[Snowmix](http://snowmix.sourceforge.net/)* - an open-source live video mixer
2018-02-25 17:16:08 +00:00
* *Develop using the GStreamer library*, in either [C](https://gstreamer.freedesktop.org/documentation/application-development/basics/helloworld.html), [Python](https://github.com/GStreamer/gst-python), or [C#/.NET](https://github.com/GStreamer/gstreamer-sharp)
### Python with GStreamer
Python is an easy language, so it's no surprise that it's good way to develop using GStreamer.
Some example scripts can be found in the [python_examples/](python_examples/) directory.
Other good GStreamer Python resources that I've found:
2018-02-25 17:16:08 +00:00
* [Getting started with GStreamer with Python](https://www.jonobacon.com/2006/08/28/getting-started-with-gstreamer-with-python/)
2018-02-25 17:16:08 +00:00
* [Python GStreamer Tutorial](http://brettviren.github.io/pygst-tutorial-org/pygst-tutorial.html)
2018-03-20 08:18:38 +00:00
* [Function reference](http://lazka.github.io/pgi-docs/#Gst-1.0)
* Including a useful [mapping from C](https://lazka.github.io/pgi-docs/Gst-1.0/mapping.html)
2018-03-20 08:18:38 +00:00
* [Nice example script](https://github.com/rabits/rstream/blob/master/rstream.py)
### C/C++ with GStreamer
2018-03-20 08:18:38 +00:00
My favourite reference is [Valadoc](https://valadoc.org/gstreamer-1.0/index.htm)
2018-02-25 17:16:08 +00:00
# Problems or suggestions with this guide?
If you spot anything incorrect or incomplete, reports are welcome, either using [issues](issues) or [pull requests](pulls)
# My GStreamer project
2022-07-20 20:23:04 +00:00
Creating this guide gave me enough GStreamer understanding to make a prototype [Brave](https://github.com/bbc/brave), a live video editor for the cloud. (Regrettably this prototype has not been updated in a few years.)