mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
docs: tools: sync gst-launch page with man page
This still had the content from 0.10 time. See https://gitlab.freedesktop.org/gstreamer/gst-docs/-/issues/108 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7859>
This commit is contained in:
parent
566e377272
commit
6e4a3ad69b
1 changed files with 243 additions and 124 deletions
|
@ -21,15 +21,18 @@ gst-launch-1.0 [OPTIONS] PIPELINE-DESCRIPTION
|
||||||
|
|
||||||
In its simplest form, a PIPELINE-DESCRIPTION is a list of elements separated
|
In its simplest form, a PIPELINE-DESCRIPTION is a list of elements separated
|
||||||
by exclamation marks (!). Properties may be appended to elements in the
|
by exclamation marks (!). Properties may be appended to elements in the
|
||||||
form `property=value`.
|
form `property=value`. A "preset" can also be set using
|
||||||
|
the `@preset=<preset name>` syntax.
|
||||||
|
|
||||||
For a more complete description of possible PIPELINE-DESCRIPTIONS see the
|
For a more complete description of possible PIPELINE-DESCRIPTIONS see the
|
||||||
section [Pipeline Description](#pipeline-description) below or consult the GStreamer documentation.
|
section [Pipeline Description](#pipeline-description) below or consult the
|
||||||
|
GStreamer documentation.
|
||||||
|
|
||||||
Please note that `gst-launch-1.0` is primarily a debugging tool. You should
|
Please note that `gst-launch-1.0` is primarily a debugging tool. You should
|
||||||
not build applications on top of it. For applications, use the
|
not build applications on top of it. For applications, write a little python
|
||||||
`gst_parse_launch()` function of the GStreamer API as an easy way to construct
|
script or Rust application (or use whatever other programming language you
|
||||||
pipelines from pipeline descriptions.
|
prefer) and use the `gst_parse_launch()` function of the GStreamer API as an
|
||||||
|
easy way to construct pipelines from pipeline descriptions.
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
|
@ -55,24 +58,118 @@ Output messages posted on the pipeline's bus
|
||||||
|
|
||||||
Output tags (also known as metadata)
|
Output tags (also known as metadata)
|
||||||
|
|
||||||
**-o FILE, --output=FILE**
|
**-e, --eos-on-shutdown**
|
||||||
|
|
||||||
Save XML representation of pipeline to FILE and exit
|
Force an EOS event on sources before shutting the pipeline down. This is
|
||||||
|
useful to make sure muxers create readable files when a muxing pipeline is
|
||||||
|
shut down forcefully via Control-C (especially in case of `mp4mux` and `qtmux`
|
||||||
|
where the created file will be unreadable if the file has not been finalised
|
||||||
|
properly).
|
||||||
|
|
||||||
**-f, --no\_fault**
|
**-f, --no\_fault**
|
||||||
|
|
||||||
Do not install a fault handler
|
Do not install a segfault handler
|
||||||
|
|
||||||
**-T, --trace**
|
**--no-position**
|
||||||
|
|
||||||
|
Do not print the current position of pipeline.
|
||||||
|
|
||||||
|
If this option is unspecified, the position will be printed when stdout is a TTY.
|
||||||
|
To enable printing position when stdout is not a TTY,
|
||||||
|
use the "--force-position" option.
|
||||||
|
|
||||||
|
**--force-position**
|
||||||
|
|
||||||
|
Allow printing the current position of pipeline even if stdout is not a TTY.
|
||||||
|
This option has no effect if the "--no-position" option is specified.
|
||||||
|
|
||||||
Print memory allocation traces. The feature must be enabled at compile
|
|
||||||
time to work.
|
|
||||||
|
|
||||||
## GStreamer Options
|
## GStreamer Options
|
||||||
|
|
||||||
`gst-launch-1.0` also accepts the following options that are common to
|
`gst-launch-1.0` also accepts the following options that are common to
|
||||||
all GStreamer applications:
|
all GStreamer applications:
|
||||||
|
|
||||||
|
**--gst-version**
|
||||||
|
|
||||||
|
Prints the version string of the `GStreamer` core library.
|
||||||
|
|
||||||
|
**--gst-fatal-warnings**
|
||||||
|
|
||||||
|
Causes `GStreamer` to abort if a warning message occurs. This is equivalent
|
||||||
|
to setting the environment variable `G_DEBUG=fatal_warnings` (see the
|
||||||
|
section `environment variables` below for further information).
|
||||||
|
|
||||||
|
**--gst-debug=STRING**
|
||||||
|
|
||||||
|
A comma separated list of `category_name:level` pairs to specify debugging levels
|
||||||
|
for each category. Level is in the range 0-9 where 0 will show no messages, and
|
||||||
|
9 will show all messages. The wildcard `*` can be used to match category names.
|
||||||
|
|
||||||
|
Note that the order of categories and levels is important, wildcards at the
|
||||||
|
end may override levels set earlier. The log levels are:
|
||||||
|
|
||||||
|
1. ERROR
|
||||||
|
2. WARNING
|
||||||
|
3. FIXME
|
||||||
|
4. INFO
|
||||||
|
5. DEBUG
|
||||||
|
6. LOG (this is the highest 'normal' debug level)
|
||||||
|
7. TRACE
|
||||||
|
9. MEMDUMP
|
||||||
|
|
||||||
|
Since GStreamer 1.2 one can also use the debug level names, e.g.
|
||||||
|
`--gst-debug=*sink:LOG`. A full description of the various debug levels
|
||||||
|
can be found in the GStreamer core library API documentation, in the
|
||||||
|
"Running GStreamer Applications" section.
|
||||||
|
|
||||||
|
Use `--gst-debug-help` to show category names
|
||||||
|
|
||||||
|
Example: `GST_CAT:LOG,GST_ELEMENT_*:INFO,oggdemux:LOG`
|
||||||
|
|
||||||
|
**--gst-debug-level=LEVEL**
|
||||||
|
|
||||||
|
Sets the threshold for printing debugging messages. A higher level
|
||||||
|
will print more messages. The useful range is 0-9, with the default
|
||||||
|
being 0. Level 6 (LOG level) will show all information that is usually
|
||||||
|
required for debugging purposes. Higher levels are only useful in very
|
||||||
|
specific cases. See above for the full list of levels.
|
||||||
|
|
||||||
|
**--gst-debug-no-color**
|
||||||
|
|
||||||
|
`GStreamer` normally prints debugging messages so that the
|
||||||
|
messages are color-coded when printed to a terminal that handles
|
||||||
|
ANSI escape sequences. Using this option causes GStreamer
|
||||||
|
to print messages without color. Setting the `GST_DEBUG_NO_COLOR=1`
|
||||||
|
environment variable will achieve the same thing.
|
||||||
|
|
||||||
|
**--gst-debug-color-mode**
|
||||||
|
|
||||||
|
GStreamer normally prints debugging messages so that the
|
||||||
|
messages are color-coded when printed to a terminal that handles
|
||||||
|
ANSI escape sequences (on *nix), or uses W32 console API to color the
|
||||||
|
messages printed into a console (on W32). Using this option causes
|
||||||
|
GStreamer to print messages without color ('off' or 'disable'),
|
||||||
|
print messages with default colors ('on' or 'auto'), or print messages
|
||||||
|
using ANSI escape sequences for coloring ('unix'). Setting the
|
||||||
|
`GST_DEBUG_COLOR_MODE` environment variable will achieve the same thing.
|
||||||
|
|
||||||
|
**--gst-debug-disable**
|
||||||
|
|
||||||
|
Disables debugging.
|
||||||
|
|
||||||
|
**--gst-debug-help**
|
||||||
|
|
||||||
|
Prints a list of available debug categories and their default debugging level.
|
||||||
|
|
||||||
|
**--gst-plugin-path=PATH**
|
||||||
|
|
||||||
|
Add directories separated with `:` (`;` on Windows) to the plugin search path.
|
||||||
|
|
||||||
|
**--gst-plugin-load=PLUGINS**
|
||||||
|
|
||||||
|
Preload plugins specified in a comma-separated list. Another way to specify
|
||||||
|
plugins to preload is to use the environment variable `GST_PLUGIN_PATH`.
|
||||||
|
|
||||||
## Pipeline Description
|
## Pipeline Description
|
||||||
|
|
||||||
A pipeline consists of *elements* and *links*. *Elements* can be put
|
A pipeline consists of *elements* and *links*. *Elements* can be put
|
||||||
|
@ -97,6 +194,16 @@ Sets the property to the specified value. You can use `gst-inspect-1.0` to find
|
||||||
out about properties and allowed values of different elements. Enumeration
|
out about properties and allowed values of different elements. Enumeration
|
||||||
properties can be set by name, nick or value.
|
properties can be set by name, nick or value.
|
||||||
|
|
||||||
|
### Element Presets
|
||||||
|
|
||||||
|
```
|
||||||
|
@preset=<preset name> ...
|
||||||
|
```
|
||||||
|
|
||||||
|
Sets the preset (basically a pre-made collection of property settings for a
|
||||||
|
specific element) on the element. you can use `gst-inspect-1.0` to
|
||||||
|
find out what presets are available for a specific element.
|
||||||
|
|
||||||
### Bins
|
### Bins
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -114,19 +221,27 @@ pipeline.
|
||||||
### Links
|
### Links
|
||||||
|
|
||||||
```
|
```
|
||||||
[[SRCELEMENT\].[PAD1,...]] ! [[SINKELEMENT].[PAD1,...]]
|
[[SRCELEMENT].[PAD1,...]] ! [[SINKELEMENT].[PAD1,...]]
|
||||||
|
[[SRCELEMENT].[PAD1,...]] ! CAPS ! [[SINKELEMENT].[PAD1,...]]
|
||||||
|
[[SRCELEMENT].[PAD1,...]] : [[SINKELEMENT].[PAD1,...]]
|
||||||
|
[[SRCELEMENT].[PAD1,...]] : CAPS : [[SINKELEMENT].[PAD1,...]]
|
||||||
```
|
```
|
||||||
|
|
||||||
Links the element with name SRCELEMENT to the element with name SINKELEMENT.
|
Links the element with name SRCELEMENT to the element with name SINKELEMENT,
|
||||||
|
using the caps specified in CAPS as a filter.
|
||||||
|
|
||||||
Names can be set on elements using the `name` property. If the name is omitted,
|
Names can be set on elements using the `name` property. If the name is omitted,
|
||||||
the element that was specified directly in front of or after the link is
|
the element that was specified directly in front of or after the link is
|
||||||
used. This works across bins. If a padname is given, the link is done using that
|
used. This works across bins. If a padname is given, the link is done using that
|
||||||
pad. If no pad names are given all possibilities are tried and a compatible pad
|
pad. If no pad names are given all possibilities are tried and a compatible pad
|
||||||
is used. If multiple padnames are given, both sides must have the same number of
|
is used. If multiple padnames are given, both sides must have the same number of
|
||||||
pads specified and multiple links are done in the given order. The simplest link
|
pads specified and multiple links are done in the given order.
|
||||||
is a simple exclamation mark. This links the element to the left of it with the
|
|
||||||
element at its right.
|
|
||||||
|
|
||||||
|
The simplest link is a simple exclamation mark. This links the element to the
|
||||||
|
left of it with the element at its right.
|
||||||
|
|
||||||
|
Linking using the `:` operator attempts to link all possible pads between
|
||||||
|
the elements
|
||||||
|
|
||||||
The following links the element with name SRCELEMENT to the element with name
|
The following links the element with name SRCELEMENT to the element with name
|
||||||
SINKELEMENT, using the caps specified in CAPS as a filter:
|
SINKELEMENT, using the caps specified in CAPS as a filter:
|
||||||
|
@ -156,73 +271,66 @@ value and the type can have the following case-insensitive values:
|
||||||
|
|
||||||
- `i` or `int` for integer values or ranges;
|
- `i` or `int` for integer values or ranges;
|
||||||
- `f` or `float` for float values or ranges;
|
- `f` or `float` for float values or ranges;
|
||||||
- `4` or `fourcc` for FOURCC values;
|
|
||||||
- `b`, `bool`, or `boolean` for boolean values;
|
- `b`, `bool`, or `boolean` for boolean values;
|
||||||
- `s`, `str`, or `string` for strings;
|
- `s`, `str`, or `string` for strings;
|
||||||
- `fraction` for fractions (framerate, pixel-aspect-ratio);
|
- `fraction` for fractions (framerate, pixel-aspect-ratio);
|
||||||
- `l` or `list` for lists.
|
- `l` or `list` for lists.
|
||||||
|
|
||||||
If no type was given, the following order is
|
If no type was given, the following order is tried: integer, float, boolean,
|
||||||
tried: integer, float, boolean, string. Integer values must be parsable by
|
string. Integer values must be parsable by `strtol()`, floats by `strtod()`.
|
||||||
`strtol()`, floats by `strtod()`. FOURCC values may either be integers or
|
Boolean values are (case insensitive) `yes`, `no`, `true` or `false`
|
||||||
strings. Boolean values are (case insensitive) `yes`, `no`, `true` or `false`
|
and may like strings be escaped with `"` or `'`.
|
||||||
and may like strings be escaped with `"` or `'`. Ranges are in this format: `[
|
|
||||||
VALUE, VALUE]`; lists use this format: `(VALUE [, VALUE ...])`.
|
|
||||||
|
|
||||||
## Pipeline Control
|
Ranges are in this format: `[VALUE, VALUE]`, e.g. `width=[16,1920]`
|
||||||
|
|
||||||
A pipeline can be controlled by signals. `SIGUSR2` will stop the pipeline
|
Lists use this format: `{VALUE [, VALUE ...]}`, e.g. `width={1920,1280,640}`
|
||||||
(`GST_STATE_NULL`); `SIGUSR1` will put it back to play (`GST_STATE_PLAYING`). By
|
|
||||||
default, the pipeline will start in the `PLAYING` state. There are currently no
|
|
||||||
signals defined to go into the ready or pause (`GST_STATE_READY` and `GST_STATE_PAUSED`) states explicitly.
|
|
||||||
|
|
||||||
## Pipeline Examples
|
## Pipeline Examples
|
||||||
|
|
||||||
The examples below assume that you have the correct plugins available.
|
The examples below assume that you have the correct plug-ins available.
|
||||||
In general, `osssink` can be substituted with another audio output
|
In general, "pulsesink" can be substituted with another audio output
|
||||||
plugin such as `directsoundsink`, `esdsink`, `alsasink`, `osxaudiosink`, or
|
plug-in such as "alsasink", "osxaudiosink", or "wasapisink"
|
||||||
`artsdsink`. Likewise, `xvimagesink` can be substituted with `d3dvideosink`,
|
|
||||||
`ximagesink`, `sdlvideosink`, `osxvideosink`, or `aasink`. Keep in mind though
|
Likewise, `xvimagesink` can be substituted with `d3dvideosink`,
|
||||||
that different sinks might accept different formats and even the same sink might
|
`ximagesink`, `sdlvideosink`, `osxvideosink`, or `aasink`.
|
||||||
accept different formats on different machines, so you might need to add
|
|
||||||
converter elements like `audioconvert` and `audioresample` for audio or
|
Keep in mind though that different sinks might accept different formats and
|
||||||
`videoconvert` in front of the sink to make things work.
|
even the same sink might accept different formats on different machines, so
|
||||||
|
you might need to add converter elements like `audioconvert` and `audioresample`
|
||||||
|
for audio or `videoconvertscale` in front of the sink to make things work.
|
||||||
|
|
||||||
### Audio playback
|
### Audio playback
|
||||||
|
|
||||||
Play the mp3 music file "music.mp3" using a libmad-based plugin and output to
|
**Note:** For audio/video playback it's best to use the `playbin3` or
|
||||||
an OSS device:
|
`uridecodebin3` elements, these are just example pipelines.
|
||||||
|
|
||||||
|
Play the mp3 music file "music.mp3" using a libmpg123-based plug-in and
|
||||||
|
output it to an audio device via PulseAudio (or PipeWire).
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 filesrc location=music.mp3 ! mad ! audioconvert !
|
gst-launch-1.0 filesrc location=music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! pulsesink
|
||||||
audioresample ! osssink
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Play an Ogg Vorbis format file:
|
Play an Ogg Vorbis format file:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 filesrc location=music.ogg ! oggdemux ! vorbisdec !
|
gst-launch-1.0 filesrc location=music.ogg ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! pulsesink
|
||||||
audioconvert ! audioresample ! osssink
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Play an mp3 file using GNOME-VFS:
|
Play an mp3 file or an http stream using GIO:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 gnomevfssrc location=music.mp3 ! mad ! osssink
|
gst-launch-1.0 giosrc location=music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! pulsesink
|
||||||
```
|
```
|
||||||
|
|
||||||
Play an HTTP stream using GNOME-VFS:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 gnomevfssrc location=<http://domain.com/music.mp3> ! mad
|
gst-launch-1.0 giosrc location=http://domain.com/music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! pulsesink
|
||||||
! audioconvert ! audioresample ! osssink
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Use GNOME-VFS to play an mp3 file located on an SMB server:
|
Use GIO to play an mp3 file located on an SMB server:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 gnomevfssrc location=<smb://computer/music.mp3> ! mad !
|
gst-launch-1.0 giosrc location=smb://computer/music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! pulsesink
|
||||||
audioconvert ! audioresample ! osssink
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Format conversion
|
### Format conversion
|
||||||
|
@ -230,15 +338,13 @@ audioconvert ! audioresample ! osssink
|
||||||
Convert an mp3 music file to an Ogg Vorbis file:
|
Convert an mp3 music file to an Ogg Vorbis file:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 filesrc location=music.mp3 ! mad ! audioconvert ! vorbisenc !
|
gst-launch-1.0 filesrc location=music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.ogg
|
||||||
oggmux ! filesink location=music.ogg
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Convert to the FLAC format:
|
Convert to the FLAC format:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 filesrc location=music.mp3 ! mad ! audioconvert ! flacenc !
|
gst-launch-1.0 filesrc location=music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! flacenc ! filesink location=test.flac
|
||||||
filesink location=test.flac`
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Other
|
### Other
|
||||||
|
@ -246,34 +352,29 @@ filesink location=test.flac`
|
||||||
Play a .WAV file that contains raw audio data (PCM):
|
Play a .WAV file that contains raw audio data (PCM):
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 filesrc location=music.wav ! wavparse ! audioconvert !
|
gst-launch-1.0 filesrc location=music.wav ! wavparse ! audioconvert ! audioresample ! pulsesink
|
||||||
audioresample ! osssink
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Convert a .WAV file containing raw audio data into an Ogg Vorbis or mp3 file:
|
Convert a .WAV file containing raw audio data into an Ogg Vorbis or mp3 file:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 filesrc location=music.wav ! wavparse ! audioconvert !
|
gst-launch-1.0 filesrc location=music.wav ! wavparse ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.ogg
|
||||||
vorbisenc ! oggmux ! filesink location=music.ogg
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 filesrc location=music.wav ! wavparse ! audioconvert ! lame !
|
gst-launch-1.0 filesrc location=music.wav ! wavparse ! audioconvert ! lamemp3enc ! xingmux ! id3v2mux ! filesink location=music.mp3
|
||||||
filesink location=music.mp3
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Rip all tracks from CD and convert them into a single mp3 file:
|
Rip all tracks from CD and convert them into a single mp3 file:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 cdparanoiasrc mode=continuous ! audioconvert ! lame !
|
gst-launch-1.0 cdparanoiasrc mode=continuous ! audioconvert ! lamemp3enc ! mpegaudioparse ! xingmux ! id3v2mux ! filesink location=cd.mp3
|
||||||
id3v2mux ! filesink location=cd.mp3
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Rip track 5 from the CD and converts it into a single mp3 file:
|
Rip track 5 from the CD and converts it into a single mp3 file:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 cdparanoiasrc track=5 ! audioconvert ! lame ! id3v2mux
|
gst-launch-1.0 cdparanoiasrc track=5 ! audioconvert ! lamemp3enc ! mpegaudioparse ! xingmux ! id3v2mux ! filesink location=track5.mp3
|
||||||
! filesink location=track5.mp3
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Using `gst-inspect-1.0`, it is possible to discover settings like
|
Using `gst-inspect-1.0`, it is possible to discover settings like
|
||||||
|
@ -283,72 +384,58 @@ will find an element (such as cdparanoia) that supports that protocol
|
||||||
for you, e.g.:
|
for you, e.g.:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 [cdda://5] ! lame vbr=new vbr-quality=6 !
|
gst-launch-1.0 cdda://5 ! lamemp3enc vbr=new vbr-quality=6 ! xingmux ! id3v2mux ! filesink location=track5.mp3
|
||||||
filesink location=track5.mp3
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Record sound from your audio input and encode it into an ogg file:
|
Record sound from your audio input and encode it into an ogg file:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 osssrc ! audioconvert ! vorbisenc ! oggmux !
|
gst-launch-1.0 pulsesrc ! audioconvert ! vorbisenc ! oggmux ! filesink location=input.ogg
|
||||||
filesink location=input.ogg
|
|
||||||
```
|
|
||||||
|
|
||||||
Running a pipeline using a specific user-defined latency
|
|
||||||
(see gst_pipeline_set_latency()):
|
|
||||||
|
|
||||||
```
|
|
||||||
gst-launch-1.0 pipeline. \( latency=2000000000 videotestsrc ! jpegenc ! jpegdec ! fakevideosink \)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Video
|
### Video
|
||||||
|
|
||||||
Display only the video portion of an MPEG-1 video file, outputting to an X
|
**Note:** For audio/video playback it's best to use the `playbin3` or
|
||||||
|
`uridecodebin3` elements, these are just example pipelines.
|
||||||
|
|
||||||
|
Display only the video portion of an MPEG-2 video file, outputting to an X
|
||||||
display window:
|
display window:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 filesrc location=videofile.mpg ! dvddemux ! mpeg2dec !
|
gst-launch-1.0 filesrc location=JB_FF9_TheGravityOfLove.mpg ! mpegdemux ! mpegvideoparse ! mpeg2dec ! videoconvert ! xvimagesink
|
||||||
xvimagesink
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Display the video portion of a .vob file (used on DVDs), outputting to an SDL
|
Display the video portion of a .vob file (used on DVDs), outputting to an SDL
|
||||||
window:
|
window:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 filesrc location=flflfj.vob ! dvddemux ! mpeg2dec ! sdlvideosink
|
gst-launch-1.0 filesrc location=flflfj.vob ! dvddemux ! mpegvideoparse ! mpeg2dec ! videoconvert ! sdlvideosink
|
||||||
```
|
```
|
||||||
|
|
||||||
Play both video and audio portions of an MPEG movie:
|
Play both video and audio portions of an MPEG movie:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 filesrc location=movie.mpg ! dvddemux name=demuxer
|
gst-launch-1.0 filesrc location=movie.mpg ! dvddemux name=demuxer \
|
||||||
demuxer. ! queue ! mpeg2dec ! sdlvideosink
|
\
|
||||||
demuxer. ! queue ! mad ! audioconvert ! audioresample ! osssink
|
demuxer. ! queue ! mpegvideoparse ! mpeg2dec ! videoconvert ! sdlvideosink \
|
||||||
|
demuxer. ! queue ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! pulsesink
|
||||||
```
|
```
|
||||||
|
|
||||||
Play an AVI movie with an external text subtitle stream:
|
Play an AVI movie with an external text subtitle stream:
|
||||||
|
|
||||||
```
|
|
||||||
gst-launch-1.0 filesrc location=movie.mpg ! mpegdemux name=demuxer
|
|
||||||
demuxer. ! queue ! mpeg2dec ! videoconvert ! sdlvideosink
|
|
||||||
demuxer. ! queue ! mad ! audioconvert ! audioresample ! osssink
|
|
||||||
```
|
|
||||||
|
|
||||||
This example shows how to refer to specific pads by name if an
|
This example shows how to refer to specific pads by name if an
|
||||||
element (here: textoverlay) has multiple sink or source pads:
|
element (here: textoverlay) has multiple sink or source pads:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 textoverlay name=overlay ! videoconvert ! videoscale !
|
gst-launch-1.0 textoverlay name=overlay ! videoconvert ! videoscale ! autovideosink \
|
||||||
autovideosink
|
filesrc location=movie.avi ! decodebin3 ! videoconvert ! overlay.video_sink \
|
||||||
filesrc location=movie.avi ! decodebin2 ! videoconvert ! overlay.video_sink
|
|
||||||
filesrc location=movie.srt ! subparse ! overlay.text_sink
|
filesrc location=movie.srt ! subparse ! overlay.text_sink
|
||||||
```
|
```
|
||||||
|
|
||||||
Play an AVI movie with an external text subtitle stream using playbin:
|
Play an AVI movie with an external text subtitle stream using playbin:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 playbin uri=<file:///path/to/movie.avi>
|
gst-launch-1.0 playbin3 uri=<file:///path/to/movie.avi> suburi=<file:///path/to/movie.srt>
|
||||||
suburi=<file:///path/to/movie.srt>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Network streaming
|
### Network streaming
|
||||||
|
@ -358,18 +445,13 @@ Stream video using RTP and network elements
|
||||||
This command would be run on the transmitter:
|
This command would be run on the transmitter:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 v4l2src !
|
gst-launch-1.0 v4l2src ! queue ! videoconvert ! x264enc tune=zerolatency key-int-max=15 ! video/x-h264,profile=main ! rtph264pay pt=96 config-interval=-1 ! udpsink host=192.168.1.1 port=5000
|
||||||
video/x-raw-yuv,width=128,height=96,format='(fourcc)'UYVY !
|
|
||||||
videoconvert ! ffenc_h263 ! video/x-h263 ! rtph263ppay pt=96 !
|
|
||||||
udpsink host=192.168.1.1 port=5000 sync=false
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Use this command on the receiver:
|
Use this command on the receiver:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,
|
gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,clock-rate=90000,payload=96 ! rtpjitterbuffer ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink
|
||||||
clock-rate=90000,payload=96 ! rtph263pdepay queue-delay=0 ! ffdec_h263
|
|
||||||
! xvimagesink
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Diagnostic
|
### Diagnostic
|
||||||
|
@ -377,7 +459,7 @@ clock-rate=90000,payload=96 ! rtph263pdepay queue-delay=0 ! ffdec_h263
|
||||||
Generate a null stream and ignore it (and print out details):
|
Generate a null stream and ignore it (and print out details):
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 -v fakesrc num-buffers=16 ! fakesink
|
gst-launch-1.0 -v fakesrc num-buffers=16 ! fakesink silent=false
|
||||||
```
|
```
|
||||||
|
|
||||||
Generate a pure sine tone to test the audio output:
|
Generate a pure sine tone to test the audio output:
|
||||||
|
@ -392,31 +474,46 @@ Generate a familiar test pattern to test the video output:
|
||||||
gst-launch-1.0 videotestsrc ! ximagesink
|
gst-launch-1.0 videotestsrc ! ximagesink
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
gst-launch-1.0 videotestsrc ! xvimagesink
|
||||||
|
```
|
||||||
|
|
||||||
### Automatic linking
|
### Automatic linking
|
||||||
|
|
||||||
You can use the "decodebin" element to automatically select the right
|
You can use the "decodebin3" element to automatically select the right
|
||||||
elements to get a working pipeline.
|
elements to get a working pipeline.
|
||||||
|
|
||||||
Play any supported audio format:
|
Play any supported audio format:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 filesrc location=musicfile ! decodebin ! audioconvert !
|
gst-launch-1.0 filesrc location=musicfile ! decodebin3 ! audioconvert ! audioresample ! pulsesink
|
||||||
audioresample ! osssink
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Play any supported video format with video and audio output. Threads are used
|
Play any supported video format with video and audio output. Threads are used
|
||||||
automatically:
|
automatically:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 filesrc location=videofile ! decodebin name=decoder
|
gst-launch-1.0 filesrc location=videofile ! decodebin name=decoder decoder. ! queue ! audioconvert ! audioresample ! pulsesink decoder. ! videoconvert ! xvimagesink
|
||||||
decoder. ! queue ! audioconvert ! audioresample ! osssink
|
```
|
||||||
decoder. ! videoconvert ! xvimagesink
|
|
||||||
|
You can also support different inputs by using an URI and uridecodebin3, e.g.:
|
||||||
|
|
||||||
|
```
|
||||||
|
gst-launch-1.0 uridecodebin3 uri=file:///path/to/video.mp4 name=decoder decoder. ! queue ! audioconvert ! audioresample ! pulsesink decoder. ! videoconvert ! xvimagesink
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
gst-launch-1.0 uridecodebin3 uri=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm name=decoder decoder. ! queue ! audioconvert ! audioresample ! pulsesink decoder. ! videoconvert ! xvimagesink
|
||||||
```
|
```
|
||||||
|
|
||||||
To make the above even easier, you can use the playbin element:
|
To make the above even easier, you can use the playbin element:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 playbin uri=<file:///home/joe/foo.avi>
|
gst-launch-1.0 playbin3 uri=file:///home/joe/foo.avi
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
gst-launch-1.0 playbin3 uri=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm
|
||||||
```
|
```
|
||||||
|
|
||||||
### Filtered connections
|
### Filtered connections
|
||||||
|
@ -426,18 +523,20 @@ These examples show you how to use filtered caps.
|
||||||
Show a test image and use the YUY2 or YV12 video format for this:
|
Show a test image and use the YUY2 or YV12 video format for this:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 videotestsrc !
|
gst-launch-1.0 videotestsrc ! 'video/x-raw,format=YUY2;video/x-raw,format=YV12' ! xvimagesink
|
||||||
'video/x-raw-yuv,format=(fourcc)YUY2;video/x-raw-yuv,format=(fourcc)YV12'
|
```
|
||||||
! xvimagesink
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```
|
||||||
|
gst-launch-1.0 v4l2src ! image/jpeg ! queue ! decodebin3 ! videoconvert ! autovideosink
|
||||||
```
|
```
|
||||||
|
|
||||||
Record audio and write it to a .wav file. Force usage of signed 16 to 32 bit
|
Record audio and write it to a .wav file. Force usage of signed 16 to 32 bit
|
||||||
samples and a sample rate between 32kHz and 64KHz:
|
samples and a sample rate between 32kHz and 64KHz:
|
||||||
|
|
||||||
```
|
```
|
||||||
gst-launch-1.0 osssrc !
|
gst-launch-1.0 pulsesrc ! 'audio/x-raw,rate=[32000,64000],format={S16LE,S24LE,S32LE}' ! wavenc ! filesink location=recording.wav
|
||||||
'audio/x-raw-int,rate=[32000,64000],width=[16,32],depth={16,24,32},signed=(boolean)true'
|
|
||||||
! wavenc ! filesink location=recording.wav
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Environment Variables
|
## Environment Variables
|
||||||
|
@ -448,16 +547,31 @@ gst-launch-1.0 osssrc !
|
||||||
GST_DEBUG=totem:4,typefind:5
|
GST_DEBUG=totem:4,typefind:5
|
||||||
```
|
```
|
||||||
|
|
||||||
|
`*` is allowed as a wildcard as part of debug category names (e.g.
|
||||||
|
`GST_DEBUG=*sink:6,*audio*:6`). It is also possible to specify the log level
|
||||||
|
by name (1=ERROR, 2=WARN, 3=FIXME, 4=INFO, 5=DEBUG, 6=LOG, 7=TRACE, 9=MEMDUMP),
|
||||||
|
e.g. `GST_DEBUG=*audio*:LOG`.
|
||||||
|
|
||||||
`GST_DEBUG_NO_COLOR`: When this environment variable is set, coloured debug
|
`GST_DEBUG_NO_COLOR`: When this environment variable is set, coloured debug
|
||||||
output is disabled. This might come handy when saving the debug output to a
|
output is disabled. This might come handy when saving the debug output to a
|
||||||
file.
|
file.
|
||||||
|
|
||||||
`GST_DEBUG_DUMP_DOT_DIR`: When set to a filesystem path, store dot
|
`GST_DEBUG_DUMP_DOT_DIR`: When set to a filesystem path, store 'dot' files of
|
||||||
files of pipeline graphs there.
|
pipeline graphs there.
|
||||||
|
|
||||||
|
These can then later be converted into an image using the 'dot' utility from
|
||||||
|
the graphviz set of tools, like this: `dot foo.dot -Tsvg -o foo.svg` (png or jpg
|
||||||
|
are also possible as output format). There is also a utility called `xdot`
|
||||||
|
which allows you to view the .dot file directly without converting it first.
|
||||||
|
|
||||||
|
When the pipeline changes state through NULL to PLAYING and back to NULL, a
|
||||||
|
dot file is generated on each state change. To write a snapshot of the
|
||||||
|
pipeline state, send a SIGHUP to the process or use the pipeline_snapshot
|
||||||
|
tracer from the GStreamer Rust plugins.
|
||||||
|
|
||||||
`GST_REGISTRY`: Path of the plugin registry file. The default is
|
`GST_REGISTRY`: Path of the plugin registry file. The default is
|
||||||
`~/.gstreamer-1.0/registry-CPU.xml` where CPU is the machine/cpu type
|
`~/.cache/gstreamer-1.0/registry-CPU.xml` where CPU is the machine/cpu type
|
||||||
GStreamer was compiled for, e.g. 'i486', 'i686', 'x86-64', 'ppc', etc.
|
GStreamer was compiled for, e.g. 'x86_64', etc.
|
||||||
Check the output of `uname -i` and `uname -m` for details.
|
Check the output of `uname -i` and `uname -m` for details.
|
||||||
|
|
||||||
`GST_REGISTRY_UPDATE`: Set to "no" to force GStreamer to assume that no plugins
|
`GST_REGISTRY_UPDATE`: Set to "no" to force GStreamer to assume that no plugins
|
||||||
|
@ -473,10 +587,15 @@ plugins. These take precedence over the system plugins.
|
||||||
default. If not set, this defaults to the system-installed path, and the plugins
|
default. If not set, this defaults to the system-installed path, and the plugins
|
||||||
installed in the user's home directory
|
installed in the user's home directory
|
||||||
|
|
||||||
`OIL_CPU_FLAGS`: Useful liboil environment variable. Set `OIL_CPU_FLAGS=0` when
|
`GST_DEBUG_FILE`: Set this variable to a file path to redirect all GStreamer
|
||||||
valgrind or other debugging tools trip over liboil's CPU detection. Quite a few
|
debug messages to this file. If left unset, debug messages will be output
|
||||||
important GStreamer plugins like `videotestsrc`, `audioconvert` and
|
to the standard error output.
|
||||||
`audioresample` use liboil.
|
|
||||||
|
`ORC_CODE`: Useful Orc environment variable. Set `ORC_CODE=debug` to enable
|
||||||
|
debuggers such as gdb to create useful backtraces from Orc-generated code. Set
|
||||||
|
`ORC_CODE=backup` or `ORC_CODE=emulate` if you suspect Orc's SIMD code
|
||||||
|
generator is producing incorrect code. (Quite a few important
|
||||||
|
GStreamer plugins like videotestsrc, audioconvert or audioresample use Orc).
|
||||||
|
|
||||||
`G_DEBUG`: This is a useful GLib environment variable. Set
|
`G_DEBUG`: This is a useful GLib environment variable. Set
|
||||||
`G_DEBUG=fatal_warnings` to make GStreamer programs abort when a critical
|
`G_DEBUG=fatal_warnings` to make GStreamer programs abort when a critical
|
||||||
|
|
Loading…
Reference in a new issue