mirror of
https://github.com/matthew1000/gstreamer-cheat-sheet.git
synced 2024-11-22 00:10:59 +00:00
Fix broken links, add install comments
This commit is contained in:
parent
22b2e60977
commit
8b06f2f834
3 changed files with 64 additions and 15 deletions
19
README.md
19
README.md
|
@ -1,11 +1,15 @@
|
||||||
# GStreamer command-line cheat sheet
|
# GStreamer command-line cheat sheet
|
||||||
|
|
||||||
This series of docs provides a cheat sheet for GStreamer on the command-line.
|
[GStreamer](https://gstreamer.freedesktop.org/) is a powerful library for manipulating audio and video - including live streams. This repo provides:
|
||||||
|
|
||||||
A few Python examples are also [included](python_examples/) for when you need GStreamer to be dynamic (i.e. react to user or some other action).
|
* 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.
|
||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
|
* [Installing](installing.md)
|
||||||
* [Basics](basics.md)
|
* [Basics](basics.md)
|
||||||
* [Test streams](test_streams.md)
|
* [Test streams](test_streams.md)
|
||||||
* [RTMP](rtmp.md)
|
* [RTMP](rtmp.md)
|
||||||
|
@ -21,16 +25,15 @@ A few Python examples are also [included](python_examples/) for when you need GS
|
||||||
|
|
||||||
## Sources and references
|
## Sources and references
|
||||||
|
|
||||||
* [Basic command line reference](http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+10%3A+GStreamer+tools)
|
* [Basic command line reference](https://gstreamer.freedesktop.org/documentation/tutorials/basic/gstreamer-tools.html?gi-language=c)
|
||||||
* [Pipeline examples](https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html#pipeline-examples)
|
* [Pipeline examples](https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html#pipeline-examples)
|
||||||
* [List of all Gstreamer plugins](https://gstreamer.freedesktop.org/documentation/plugins.html)
|
* [List of all Gstreamer plugins](https://gstreamer.freedesktop.org/documentation/plugins_doc.html?gi-language=c)
|
||||||
* [Handy elements](https://gstreamer.freedesktop.org/documentation/tutorials/basic/handy-elements.html#uridecodebin)
|
* [Handy elements](https://gstreamer.freedesktop.org/documentation/tutorials/basic/handy-elements.html#uridecodebin)
|
||||||
|
|
||||||
## Other cheat-sheets
|
## Other cheat-sheets
|
||||||
|
|
||||||
* http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet
|
* <https://github.com/xmementoit/gstreamerCheatsheet/blob/master/README.md>
|
||||||
* https://github.com/xmementoit/gstreamerCheatsheet/blob/master/README.md
|
* <https://gist.github.com/nebgnahz/26a60cd28f671a8b7f522e80e75a9aa5>
|
||||||
* https://gist.github.com/nebgnahz/26a60cd28f671a8b7f522e80e75a9aa5
|
|
||||||
|
|
||||||
## Interacting with the GStreamer pipeline
|
## Interacting with the GStreamer pipeline
|
||||||
|
|
||||||
|
@ -64,4 +67,4 @@ If you spot anything incorrect or incomplete, reports are welcome, either using
|
||||||
|
|
||||||
# My GStreamer project
|
# My GStreamer project
|
||||||
|
|
||||||
Creating this guide gave me enough GStreamer understanding to make [Brave](https://github.com/bbc/brave), a live video editor for the cloud.
|
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.)
|
10
basics.md
10
basics.md
|
@ -1,6 +1,5 @@
|
||||||
# Basics (GStreamer command-line cheat sheet)
|
# Basics (GStreamer command-line cheat sheet)
|
||||||
|
|
||||||
|
|
||||||
## Playing content
|
## Playing content
|
||||||
|
|
||||||
These examples assume that bash variable `SRC` to be set to a video file (e.g. an mp4 file). You can do this by, e.g.
|
These examples assume that bash variable `SRC` to be set to a video file (e.g. an mp4 file). You can do this by, e.g.
|
||||||
|
@ -9,7 +8,6 @@ These examples assume that bash variable `SRC` to be set to a video file (e.g. a
|
||||||
export SRC=/home/me/videos/test.mp4
|
export SRC=/home/me/videos/test.mp4
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Play a video (with audio)
|
### Play a video (with audio)
|
||||||
|
|
||||||
The magical element `playbin` can play anything:
|
The magical element `playbin` can play anything:
|
||||||
|
@ -30,7 +28,6 @@ gst-launch-1.0 filesrc location=$SRC ! \
|
||||||
decodebin ! videoconvert ! videoscale ! autovideosink
|
decodebin ! videoconvert ! videoscale ! autovideosink
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Play a video (no audio)
|
### Play a video (no audio)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -43,7 +40,6 @@ which could also have been done as:
|
||||||
gst-launch-1.0 -v filesrc location="$SRC" ! decodebin ! autovideosink
|
gst-launch-1.0 -v filesrc location="$SRC" ! decodebin ! autovideosink
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Play just the audio from a video
|
### Play just the audio from a video
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -66,7 +62,7 @@ gst-launch-1.0 filesrc location=$SRC ! decodebin ! tee name=t ! queue ! audiocon
|
||||||
|
|
||||||
### Add filters
|
### Add filters
|
||||||
|
|
||||||
Go slightly mad:
|
Here's the 'vertigo' filter:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 -v filesrc location="$SRC" ! decodebin ! videoconvert ! vertigotv ! autovideosink
|
gst-launch-1.0 -v filesrc location="$SRC" ! decodebin ! videoconvert ! vertigotv ! autovideosink
|
||||||
|
@ -74,7 +70,7 @@ gst-launch-1.0 -v filesrc location="$SRC" ! decodebin ! videoconvert ! vertigotv
|
||||||
|
|
||||||
Try also ‘rippletv’, ‘streaktv’, ‘radioactv’, ‘optv’, ‘quarktv’, ‘revtv’, ‘shagadelictv’, ‘warptv’ (I like), ‘dicetv’, ‘agingtv’ (great), ‘edgetv’ (could be great on real stuff)
|
Try also ‘rippletv’, ‘streaktv’, ‘radioactv’, ‘optv’, ‘quarktv’, ‘revtv’, ‘shagadelictv’, ‘warptv’ (I like), ‘dicetv’, ‘agingtv’ (great), ‘edgetv’ (could be great on real stuff)
|
||||||
|
|
||||||
### Add A clock
|
### Add a clock
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 -v filesrc location="$SRC" ! decodebin ! clockoverlay font-desc="Sans, 48" ! videoconvert ! autovideosink
|
gst-launch-1.0 -v filesrc location="$SRC" ! decodebin ! clockoverlay font-desc="Sans, 48" ! videoconvert ! autovideosink
|
||||||
|
@ -88,7 +84,7 @@ gst-launch-1.0 -v filesrc location="$SRC" ! decodebin ! videoconvert ! videoscal
|
||||||
|
|
||||||
### Change framerate
|
### Change framerate
|
||||||
|
|
||||||
Changing framerate is quiet common, as the world does not have a consistent standard. Facebook Live wants 30fps, YouTube wants 30 or 60fps. There's a nice summary on the [Apple FCP site](https://documentation.apple.com/en/finalcutpro/usermanual/index.html#chapter=D%26section=4%26tasks=true).
|
Changing framerate is quiet common, as the world does not have a consistent standard. Facebook Live wants 30fps, for example.
|
||||||
|
|
||||||
Change framerate:
|
Change framerate:
|
||||||
|
|
||||||
|
|
50
installing.md
Normal file
50
installing.md
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
# Installing (GStreamer command-line cheat sheet)
|
||||||
|
|
||||||
|
## Packages
|
||||||
|
|
||||||
|
Installing GStreamer is not enough. GStreamer is built on a large number of plugins, which are split into four packages:
|
||||||
|
|
||||||
|
* *Base*: Reliable, commonly used, high-quality plug-ins
|
||||||
|
* *Good*: Additional plug-ins that are also reliable and high-quality
|
||||||
|
* *Bad*: Plugins that are potentially unreliable
|
||||||
|
* *Ugly*: Plugins that may bring concerns, often around licensing
|
||||||
|
|
||||||
|
(Full definition of these packages [in this readme](https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gst-plugins-bad/README.md).)
|
||||||
|
|
||||||
|
You can choose which you install - you'll almost certainly need base, and potentially the others.
|
||||||
|
|
||||||
|
You can see which package a plugin belongs in the [Plugins API reference](https://gstreamer.freedesktop.org/documentation/plugins_doc.html?gi-language=c).
|
||||||
|
|
||||||
|
You can get a list of all installed plugins with:
|
||||||
|
|
||||||
|
```
|
||||||
|
gst-inspect-1.0
|
||||||
|
```
|
||||||
|
|
||||||
|
## Installing on MacOS
|
||||||
|
|
||||||
|
The easiest way to install on MacOS is using Homebrew. There is a [GStreamer](https://formulae.brew.sh/formula/gstreamer) package, and additional packages for the base/good/bad/ugly plugins.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```
|
||||||
|
brew install gstreamer gst-plugins-base gst-plugins-good
|
||||||
|
```
|
||||||
|
|
||||||
|
There are many dependencies so this can take time to run!
|
||||||
|
|
||||||
|
You can also compile and install yourself - see (https://gstreamer.freedesktop.org/documentation/installing/on-mac-osx.html).
|
||||||
|
|
||||||
|
|
||||||
|
## Installing on Ubuntu Linux
|
||||||
|
|
||||||
|
The GStreamer APT packages are excellent.
|
||||||
|
|
||||||
|
For a good install command, see `https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=c`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Installing on other platfoms
|
||||||
|
|
||||||
|
See (https://gstreamer.freedesktop.org/documentation/installing/index.html?gi-language=c)
|
||||||
|
|
Loading…
Reference in a new issue