Gst-transcoder

Revision as of 13:12, 15 November 2023 by Registered User
Applicable for STM32MP25x lines

1. Overview[edit source]

gst-transcoder (gst-transcoder-1.0) is a GStreamer command line utility available with GStreamer-1.X.

This utility transcodes audio / video multimedia content using complex GStreamer elements such as decodebin and encodebin into various audio / video multimedia content. It takes as an input either individual files or URL.

2. Usage[edit source]

gst-transcoder accepts the following options:

 gst-transcoder-1.0 --help
Usage:
  gst-transcoder [OPTION?] <source uri> <destination uri> [<encoding format>[/<encoding profile name>]]

gst-transcoder-1.0 transcodes a stream defined by its first <input-uri>
argument to the place defined by its second <output-uri> argument
into the format described in its third <encoding-format> argument,
or using the given <output-uri> file extension.

The <encoding-format> argument:
===============================

If the encoding format is not defined, it will be guessed with
the given <output-uri> file extension.
<encoding-format> describe the media format into which the
input stream is going to be transcoded. We have two different
ways of describing the format:

GstEncodingProfile serialization format
---------------------------------------

GStreamer encoding profiles can be described with a quite extensive
syntax which is described in the GstEncodingProfile documentation.

The simple case looks like:

    muxer_source_caps:videoencoder_source_caps:audioencoder_source_caps

Name and category of serialized GstEncodingTarget
-------------------------------------------------

Encoding targets describe well known formats which
those are provided in '.gep' files. You can list
available ones using the `--list-targets` argument.


Help Options:
  -h, --help                        Show help options
  --help-all                        Show all help options
  --help-gst                        Show GStreamer Options

Application Options:
  -c, --cpu-usage                   The CPU usage to target in the transcoding process
  -l, --list-targets                List all encoding targets
  -s, --size                        set frame size (WxH or abbreviation)
  -r, --audio-rate                  set audio sampling rate (in Hz)
  -f, --framerate                   set video framerate as a fraction (24/1 for 24fps) or a single number (24 for 24fps))
  -v, --video-encoder               The video encoder to use.

3. List the available output profiles[edit source]

Use -l option to get the list of available destination multimedia content:

 gst-transcoder-1.0 -l
dvd (device): Encoding target suitable for DVDs
 * Profiles:
     - dvd: This is an encoding profile usable for DVDs
avi (file-extension): Default target for files with a .avi extension
 * Profiles:
     - default: Default profile for files with a .avi extension.
mp3 (file-extension): Default target for files with a .mp3 extension
 * Profiles:
     - default: Default profile for files with a .mp3 extension.
oga (file-extension): Default target for files with a .ogg and friends extension
 * Profiles:
     - default: Default target for files with a .ogg and friends extension
ogv;ogg (file-extension): Default target for files with a .ogg and friends extension
 * Profiles:
     - default: Default target for files with a .ogg and friends extension
webm (file-extension): Default target for files with a .webm extension
 * Profiles:
     - default: Default profile for files with a .webm extension.
                    Audio stream can be either vorbis (default) or opus depending on what is available on the system.
                    Video stream will be either in vp8 (default) or vp9.


4. Examples[edit source]

Info white.png Information
Don't have /usr/local/demo/media/ST2297_visionv3.webm ? Follow instructions in this article.

4.1. Basic transcoding[edit source]

 gst-transcoder-1.0 /usr/local/demo/media/ST2297_visionv3.webm out.webm webm

4.2. Format change[edit source]

4.3. Resolution change[edit source]

 gst-transcoder-1.0 /usr/local/demo/media/ST2297_visionv3.webm "video/webm:video/x-raw,width=960,height=540->video/x-vp8:audio/x-vorbis"