Skip to content

Transcoder

Transcoding is necessary if you want to:

  • create a multi-bitrate stream
  • change parameters of video — the codec and the bitrate of the stream, the size of the image
  • overlay a logo on top of a video stream.

Flussonic Media Server has a built-in transcoder. It supports transcoding by using a GPU or the CPU.

The transcoder module works with every input source supported by the Flussonic Media Server.

The HLS protocol is partially supported — some sources might fail to be transcoded. It is recommended to test each HLS source manually to find out whether it works after transcoding.

For hardware-accelerated transcoding, Flussonic can use Intel and Nvidia solutions. When transcoding with Nvidia NVENC, streams with a 10-bit color depth are supported.

Content:

Important!

Transcoding is an extremely computationally-intensive process, and it includes the following steps: 1. Decoding of the source stream into raw video data. 2. Processing and encoding of the raw stream according to the specified parameters.

Depending on the configuration, a single server can process from 5 to 20 channels.

Installing the transcoder

If you use an NVENC-capable Nvidia GPU to perform transcoding, you do not need to install any extra packages to enable transcoding (true for up-to date Flussonic versions).

If you use the CPU to perform transcoding, you will need to install the package flussonic-transcoder:

apt-get -y install flussonic-transcoder

This package can be found in the same repository as the flussonic package.

Setting up transcoding options in the configuration file

Transcoding options can be specified in stream settings in the Flussonic configuration file. Alternatively, the web UI can be used.

This section describes how to configure transcoding options by editing the /etc/flussonic/flussonic.conf configuration file.

Caution

When changing transcoder options, you must specify them in the correct order. Global options go first, then video options, and then audio options. Below, you will find several common examples detailing the use of the transcoder options. To avoid mistakes, you can use the Flussonic UI to set up the transcoder.

Transcoder options

1) Enable the transcoder for the incoming stream example as follows:


stream origin {
  url fake://fake;
  push udp://239.0.0.1:1234;
}
stream example {
  url udp://239.0.0.1:1234;
  transcoder vb=2048k size=1280x720 preset=slow ab=128k;
}

2) Apply the new configuration with the command:

service flussonic reload

Examples of stream transcoding parameters

The following examples show the correct order of transcoding options. Different kinds of options are shown in different colors:

  • blue – required parameters of video encoding
  • yellow – required parameters of audio encoding
  • white – optional parameters.

Configuring a single stream:

Transcoder parameters


vb=2048k preset=veryfast ab=128k

Configuring multi-bitrate streams:

Transcoder new

Example:


vb=2048k preset=veryfast vb=700k size=720x576 preset=veryfast vb=300k size=320x240 preset=veryfast ab=128k

Transcoder options for anamorphic video

The Flussonic transcoder supports anamorphic video streams by taking the pixel sizes ratio into account. This was possible by giving the size parameter a new interpretation and by adding the new parameter sar.

  • size is the size on a display — the number of output pixels that Flussonic passes to the player. The size option now includes width, height, the resize strategy (crop, fit, scale), and background color. Thus, you can set the size in one of the ways: size=WxH:fit:#ААFFEE, size=WxH:crop, or size=WxH:scale.

    The parameter size now means the size of a playback window on the screen rather than size of video in pixels of its internal representation. A pixel can have different width and height in different output formats. Previously, size was interpreted as pixel size, and the size of the playback window depended on a stream’s SAR or on the value of the aspect parameter.

  • sar in Flussonic is the ratio of the width of the display representation to the width of the pixel representation of video. The width of the display representation is the number of pixels on the matrix of the display, this is what Flussonic passes to the player for playback. And the width of the pixel representation is the number of pixels in the original YUV.

Learn more about how the transcoder treats the options size and sar in the list of transcoder options on this page.

Apart from size, the parameters aspect, force_original_aspect_ratio, and crop were changed:

  • aspect has been replaced with sar. Almost all transcoder types in Flussonic will interpret it as SAR (not DAR), the only exception is Nvidia NVENC.
  • force_original_aspect_ratio is no longer necessary, and, if it is required, it is added automatically.
  • The NVENC-only crop was added to almost all transcoder types in Flussonic (please don’t confuse it with the resizing strategy 'crop').

The transcoder settings that you configured in earlier versions will stay the same and processed as previously. The transcoder processes the parameters in a new way only if you specify new parameters — SAR or the resize strategy (or both) — while no deprecated parameters (force_original_aspect_ratio) were specified.

Setting up transcoding options in the web interface

The UI supports setting up the transcoding for both streams and publishing locations.

To set up the transcoder via the Flussonic web interface:

In Media > Streams or Media > Locations click the channel (stream) you want to transcode. Then go to the Transcoder tab and click Enable transcoder.

Use the arrows on the right side of the page to expand or collapse groups of settings.

Flussonic transcoder

Audio encoding settings

transcoding options

  • Copy from input — select this to get the same audio characteristics as in the input stream.
  • Bitrate — sets the audio bitrate.
  • Codec (aac|opus|mp2a|pcma) — audio codec (the AAC codec is used by default).
  • Sample rate (bypass|0|8000|16000|32000|44100|48000)
  • Channels — sets the number of audio channels in an output stream.

Global options

These options apply to all output video tracks.

transcoding options

  • Device — specifies the transcoding device. For Flussonic Media Server, enables hardware acceleration and specifies the model and ID of the NVENC graphics card. Hardware transcoding allows for more streams to be transcoded on a single server. For Coder, specifies the GPU used for transcoding the stream.

    To automatically distribute many streams between GPUs, edit the configuration file and add the option deviceid=auto to transcoder for each stream.

  • Deinterlace — activates deinterlacing mode. Deinterlacing is necessary for comfortable viewing of TV channels on desktop computers and mobile devices. This field lists the methods available for the selected transcoder type (CPU, Nvidia NVENC, or others). For Nvidia, this option represents two options in the configuration file ('deinterlace' and 'deinterlace_rate').

For Nvidia, this option represents two options in the configuration file (deinterlace and deinterlace_rate) that are used together. There are the following relations between the selected value in the Deinterlace box and the values of the options in the configuration file:

Deinterlace in UI Options in file Nvidia's deinterlace method
off deinterlace=false, deinterlace_rate=frame weave
on deinterlace=true, deinterlace_rate=frame adaptive
on double rate deinterlace=true, deinterlace_rate=field adaptive
adaptive deinterlace=adaptive, deinterlace_rate=frame adaptive
adaptive double rate deinterlace=adaptive, deinterlace_rate=field adaptive
  • Crop after decoding — with the majority of transcoder types, you can crop the video. Cropping allows you to get only part of the image area in the output stream. There are 4 figures with the following meaning: Crop-X and Crop-Y — the coordinates of the upper left corner of the output video image, as compared to the input image (that is, (0,0) is the upper left corner of the input video image), Crop-Width — the width of the output image, and Crop-Height — the height of the output image.

  • GOP size — sets the number of frames in a group of pictures (GOP). The encoder will create all GOPs of an exactly identical size — as specified in this option.

  • FPS — (Frames per second) frame rate.

Caution

The options GOP and FPS are not per-track now but global for a stream. The coniguration file supports both old and new behavior: if in the configuration file these options follow the second or any subsequent video track, they apply locally to that track. If the options go after the very first video track or precede all tracks, then they apply to all tracks.

  • Improve the transcoder performance by running it as part of Flussonic (use with caution). By default, the transcoder runs in a separate process from Flussonic: this is a more reliable choice. If you select the option Improve the transcoder performance by running it as part of Flussonic (or specify external=false in the configuration file), the transcoder will run in the same process as Flussonic Media Server. This mode speeds up encoding, especially when encoding audio or when using an Nvidia device. However, a transcoder error may cause Flussonic to crash.

Caution

When transcoding a number of streams on Nvidia NVENC, make sure that the option Improve the transcoder performance by running it as part of Flussonic has the same value for all the streams.

Video encoding options

There are three ways to add a video track settings to the transcoder:

  • Click the button Add video track and (optionally) select a bitrate and height.

  • To get the same output video characteristics as in the input stream, turn on Copy from input.

  • Click Duplicate to add another track with the characteristics of the track that you have specified and want to duplicate.

Besides, you can copy entire transcoder settings to other streams.

transcoding options

After you have added a video track, you'll be able to edit its settings. To expand a track's transcoding settings, click the arrow:

transcoding options

All options are on a single screen:

transcoding options

  • Width — the picture width in pixels on the display where it will be played by a player.

  • Height — the picture height in pixels on the display where it will be played by a player.

  • SAR (X:Y) — the proportion of the video display width. The pixel width of the input video is multiplied by SAR (X:Y) to get the width on a display. This parameter is used to support non-standard display sizes, to calculate the width of the final image. It can be used in combination with the resize strategy. For Nvidia NVENC this parameter is interpreted as DAR (the ratio of player window's horizontal and vertical sizes). Learn more in the list of transcoder options

  • Resize — the strategy of resizing the video to the specified Height (and Width).

  • Background — the color of the area in the player that is not occupied by the video after resizing. It is used only with the 'fit' strategy.

  • Bitrate — specifies the bitrate of the video track.

  • Codec (H.264|H.265|MP2V) — sets the video codec. The default value is H.264.

  • Profile (baseline|main|high) — limits the output to a specific H.264 profile.

  • Interlace — used to get an interlaced stream from a progressive one. The Progressive value equals false, Interlaced equals true, the rest of the values are methods for producing interlaced video that are supported for the selected type of transcoder. Learn more about the interlace option in the list of transcoder options

  • Preset — affects video quality and download speed. Read more about presets in The preset option on this page.

  • B-frames — the values 0|1|2|3 correspond to these sequences of frames: IP|IBP|IBBP|IBBBP.

  • Open GOP — allows an open GOP, meaning that the transcoder will divide an output stream into GOPs with slightly different number of frames, but close to the number specified in GOP size. This option applies only to encoding on CPU and it might help to reduce traffic a little bit.

  • Refs — (reference frames) used in inter-frame compression to refer to frames that follow. For better quality, use more reference frames.

  • Level — used for compatibility with old devices.

  • Logo

    To burn a logo into your video stream, specify the path to the file containing the logo and then choose where the logo will appear on the video. To use a single logo file for all output tracks, specify it in Logo, and the transcoder will resize it according to the size of each output video track. Learn more about logo in options.

    transcoding options

  • Extended — if the option you would like to add is missing on the screen, add it manually in Extended:

Saving or discarding your settings

To save the new values, click Save.

To delete all specified settings and turn off the transcoder for this stream, click Disable transcoder.

Copying the settings to other streams

To copy the settings to other streams:

  1. Go to the Transcoder tab of a stream where you have already configured the transcoder settings
  2. Click the button Copy settings
  3. Go to the Transcoder tab of the stream where you want to apply the same settings and click Enable and paste settings. If the stream already had transcoder configured, the button will be Paste settings.

Hardware transcoding

You can significantly increase the number of transcoded streams that the server can support by using a hardware transcoder.

Flussonic Media Server supports the Nvidia NVENC and Intel Quick Sync transcoding technologies.

One video stream can be transcoded using only one type of transcoder.

Read more about hardware transcoding in Hardware Transcoding with Nvidia NVENC and Intel Quick Sync Video.

The preset option

Preset is a set of values that determine a certain encoding speed, which influences a compression ratio. A slower preset will provide better compression (compression is quality per file size).

This means that, for example, if you target a certain file size or constant bitrate, you will achieve better quality with a slower preset. Similarly, for constant quality encoding, you will simply save bitrate by choosing a slower preset.

The default preset is medium.

The list of supported presets:

  • veryfast
  • medium
  • slow

Smooth source switching

The Flussonic's transcoder can efficiently handle the changes in the characteristics of an input video stream. Smooth, or seamless, source switching means that the Flussonic's transcoder does not lose any frames when the stream source has changed and the media information has changed. The most common case is the change in the size of the picture in the new source to which the stream has switched. For example, when an ad of a different width and height is inserted into a stream, or when transcoding a server-side playlist consisting of files and streams of various resolutions. The loss of frames can be observed in the resulting stream as flickering or other artifacts.

If you transcode by using the CPU or Nvidia NVENC, seamless source switching is the default behavior. Starting from Flussonic 20.07, our CPU transcoder is able not to lose any frames at the change of a stream's media information.

However, for other hardware transcoders (Intel Quick Sync) it might be necessary to configure the seamless source switching. With the seamless=true option, the transcoder seamlessly switches to another source format without dropping any frames. This is achieved by keeping the initial size of video in the resulting stream. All sources will be transcoded to be the same size - this is the size specified in the option size. If the output size was not specified, the transcoder will transcode to the size of the source that goes first in the input stream.

Example (for transcoders except the CPU and NVENC):

stream STREAM_NAME {
  udp://239.0.0.1:5000;
  transcoder vb=3000k size=320x200 ab=copy hw=qsv seamless=true;
}

Transcoder configuration options

Video options:

vb

vb (video bitrate) — specifies the video bitrate of the track. It is specified as a numerical value (1000k, 1500k, 2000k, etc). The value must always end with k. Each vb option creates a new video track in the output stream.

Example:


vb=2048k ab=128k

The option vb=copy saves the parameters of the original stream, that is, it is simply copied to the outgoing stream.

preset

preset — the encoder preset. Affects the stream quality and download speed. This option should be specified separately for each video stream. The default value is medium.

Example:


vb=2048k preset=slow ab=128k

Read more about presets in Thу preset option on this page.

size

size — the size of output video on the display where it will be shown. Used together with the resize strategy (crop, fit, scale) and the background color of the areas that will not be filled by the video.

Example:


vb=2048k size=1280x720:fit:#000000 ab=128k

The parameter size now means the size of a playback window on the screen rather than size in pixels. Previously, size was interpreted as pixel size, and the size of the playback window depended on a stream’s SAR or on the value of the aspect parameter.

logo

logo — allows you to overlay a logo. The transcoder adds the logo before the video is resized as specified in the size option. This means that the logo can be visibly stretched if the size was changed significantly.

Example:


vb=2048k size=1280x720 logo=/storage/logo.png@10:10 ab=128k;

Learn more about adding a logo

alogo

alogo — allows you to overlay a logo. The transcoder adds the logo after the video was resized as specified in the size option. This measure prevents the logo picture from stretching that might occur when the logo option is used. You will need to prepare and specify a separate file with a logo for each size of the resulting video track.

Example:


vb=2048k size=1280x720 alogo=/storage/logo.png@10:10 ab=128k;

Learn more about adding a logo

vcodec

vcodec — allows you to set the video codec. The default value is H.264. Flussonic Media Server allows you to encode in H.265 (HEVC) or MP2V (MPEG -2 Video File). Specify this setting separately for each video stream.

It is not possible to use the MP2V when hardware transcoding.

Example:


vb=2014k vcodec=mp2v ab=128k

fps

fps — frame rate. Specified separately for each video stream.

Example:


vb=2048k fps=24 ab=128k

deinterlace

deinterlace — activates deinterlacing. Deinterlacing is necessary for comfortable viewing of legacy TV video on PC/mobile devices. It is specified once and acts immediately on all video streams.

Example:


vb=2000k deinterlace=true deinterlace_rate=frame ab=128k

The UI box Deinterlace corresponds to this option.

deinterlace_rate

deinterlace_rate — when encoding with Nvidia NVENC, you can remove duplicate frames that were produced after deinterlacing, preventing increased bitrate.

  • deinterlace_rate=frame — the fps stays the same,
  • deinterlace_rate=field — the fps increases two times after transcoding.

Example:


vb=2000k deinterlace=true deinterlace_rate=frame ab=128k

In case of using the Nvidia both options (deinterlace and deinterlace_rate) are added in the configuration file when you select some value in the Deinterlace box in the UI. There are the following relations between the selected value in the Deinterlace box and the values in the configuration file:

Deinterlace in UI Options in file Nvidia's deinterlace method
off deinterlace=false, deinterlace_rate=frame weave
on deinterlace=true, deinterlace_rate=frame adaptive
on double rate deinterlace=true, deinterlace_rate=field adaptive
adaptive deinterlace=adaptive, deinterlace_rate=frame adaptive
adaptive double rate deinterlace=adaptive, deinterlace_rate=field adaptive

refs

refs — the number of reference frames. This option should be specified separately for each video stream.

Example:


vb=2000k refs=6 ab=128k

bframes

bframes — specifies the number of B-frames. When set to 0, this option disables b-frames. This may be necessary, for example, when broadcasting to RTSP. Specified separately for each video stream.

Example:


vb=2000k bframes=1 ab=128k

hw

hw — enables hardware transcoding. This option should be specified separately for each video stream.

Example:


vb=2048k hw=nvenc deviceid=1 ab=128k

crop

crop — crops the size of video.

Usage: crop = x: y: width: height:

  • x:y — the coordinates of the upper-left corner of the output video within the input video.
  • width — the width of the output video.
  • height — the height of the output video.

Example:


vb=2048k hw=nvenc deviceid=1 crop=0:0:100:100 ab=128k

sar

sar — modifies video aspect ratio. Used for creating non-anamorphic video from anamorphic video. Has replaced the deprecated aspect but does not copy the old behavior.

SAR in Flussonic's terminology is the ratio of the width of the display representation to the width of the pixel representation of video. The width of the display representation is the number of pixels on the matrix of the display, this is what Flussonic passes to the player for playback. And the width of the pixel (internal) representation is the number of pixels in the original YUV.

In the UI sar appears in advanced video options.

For the transcoder on CPU and Flussonic Coder aspect is now processed as SAR — meaning the proportions of video display. For the transcoder on Nvidia NVENC aspect is interpreted as DAR (the ratio of player window horizontal and vertical sizes) and processed as in earlier versions of Flussonic.

Caution

Aspect ratio modification is not supported when transcoding with Intel QuickSync (the hw=qsv option).

Example:


vb=2048k sar=12:5 ab=128k

Flussonic calculates the output video resolution based on sar. A video with the internal pixel width of 720 and sar 16:11 will have the display width of 1048. A picture of this width, in display pixels, will appear when the stream is played back in players.

force_original_aspect_ratio (deprecated)

force_original_aspect_ratio=true — keeps the original aspect ratio by adding black bars (letterboxing and pillarboxing.) This option is useful when you want to keep output resolution while switching between sources with different parameters.

Example:

vb=2048k size=1280x720 force_original_aspect_ratio=true

g

gop=150 — sets the number of frames in a GOP. The encoder will create all GOPs of an exactly identical size — as specified in this option.

Example:


vb=2048k fps=25 size=1280x720 gop=150

If you use encoding on CPU, you can use the disable_cgop option in addition to this option. It allows the transcoder to vary the GOP size slightly.

disable_cgop

disable_cgop=1 — allows an open GOP, meaning that the transcoder will divide an output stream into GOPs with slightly different number of frames, but close to the number specified in gop. This option applies only to encoding on CPU (it is not available on hardware transcoders) and it might help reduce traffic a little bit.

Example:


vb=2048k fps=25 size=1280x720 gop=150 disable_cgop=1

interlace

interlace — is used for making an interlaced stream from a progressive one.

The option takes values: interlace=tff|bff|tff_separated|bff_separated|mbaff|true|false

If you enable this option without specifying the encoding method (that is, if you specify as follows — interlace=true), then for producing interlaced video Flussonic will use the default method (the default method depends on the transcoder type). You can also specify another supported method.

  • false - used by default, meaning that the output stream will be progressive.

  • tff - interlaced, top field first, interleaved field store. This method is used with hw=qsv, nvenc.

  • bff - interlaced, bottom field first, interleaved field store. This method is used with hw=qsv, nvenc.

  • tff_separated - interlaced, top field first, separated fields. This method is used with hw=qsv.

  • bff_separated - interlaced, top field first, separated fields. This method is used with hw=qsv.

  • mbaff- interlaced libx264 MBAFF method. This method is used only with hw=cpu.

  • true - enables encoding into interlaced video by using the default method for the encoder specified (mbaff is the default method for hw=cpu, tff is the default method for hw=qsv, hw=nvenc).

Examples:


vb=2048k interlace=bff hw=qsv deviceid=2

Using the default method (mbaff for hw=cpu):


vb=2048k interlace=true hw=cpu

rc_method

rc_method — is used for creating output video with constant bitrate suitable for broadcasting to television networks.

Actually, it is impossible to encode a video stream with constant bitrate due to different size of different types of frames. However, television requires a constant bitrate, and also the transmission channels have their requirements.

In Flussonic transcoder, we have solved a number of problems of making a video stream compatible with such requirements.

The Flussonic encoder uses a combination of techniques to 1) make all frames fit the allowed size; 2) if frames occupy less bytes than required — to fill frames with data up to the required size. In this way, Flussonic parses a stream to every single frame and produces fully DVB-C compliant streams.

The option takes values:

  • rc_method=cbr - the encoder will produce a DVB-C compliant stream.

  • rc_method=vbr - do not encode a stream to be DVB-C compliant.

Example:

vb=2048k rc_method=cbr

As for now, using this option consumes resources (one CPU core for one MPTS stream with CBR).

See also about where to use the options rc_method and interlace:

Audio options:

ab

ab — sets the audio bitrate. This option should be specified only once, even if there are several audio tracks. The value must always end with k.

Example:


vb=2048k ab=128k

acodec

acodec — sets an audio codec. Accepts the following values: aac, mp2a, opus, pcma. By default all audio tracks are encoded with AAC.

Example:


vb=2014k vcodec=mp2v ab=128k acodec=mp2a

ar

ar — sample rate.

Example:


vb=2014k ab=128k ar=44100

ac

ac — the number of audio channels.

Example:


vb=2014k ab=128k ac=1

Burning time and subtitles

burn=time

burn=time — burns the clock time into all video tracks of a stream. You can optionally specify time offset relative to the time of the Flussonic server, offset=0 by default.

You can customize the display of time by setting the font (font) and position on the screen (box) — see Text display settings.

Configuration examples:

  • burn=time@offset+3 — shows the time in the default format YYYY-MM-DD HH:MM:SS and in the timezone +3 hours relative to the Flussonic server time.

  • burn=time@%Toffset-3:tr@box — shows the time in the format HH:MM:SS in the timezone -3 hours (relative to the Flussonic server time) in a dark box in the upper right corner (tr = top right).

  • burn="time@%F -- %Toffset-2:c@font:FiraCode-Regular.ttf:26:green:0.8@box:yellow:12:0.6" — shows the time in the format YYYY-MM-DD -- HH:MM:SS and in the timezone -2 hours in the center of the screen, in FiraCode-Regular type and in a yellow box.

Example:

stream example {
  url udp://239.0.0.1:1234;
  transcoder vb=2048k size=1280x720 ab=128k burn=time@%Toffset+5:tr@box;
}

burn=sub

burn=sub — burns subtitles (dvb_teletext, dvb_subtitles or closed captions). Can be specified for each video track.

It is required first to extract subtitles and convert them to text in order to pass them to the transcoder for burning. For example, if the stream contains closed captions, use the option cc.extract.

You can customize the display of subtitles by setting the font (font) and position on the screen (box) — see Text display settings.

Option example:

burn="sub@t1:cb:10:10@font:Arial-Regular.ttf:30:white:1.0"

Here:

  • sub — indicates that Flussonic will take subtitles (dvb_teletext, dvb_subtitles or closed captions) from the input stream and burn them into the output stream.
  • t1 — the number of a track containing subtitles.
  • cb (central bottom) — the location of subtitles.
  • 10:10 — horizontal and vertical shift to the center relative to the specified location.
  • font:FONT_NAME.ttf — the font. See the notes about font below the example.
  • 30 — the font size.
  • white — the font color.
  • 1.0 defines the text transparency (use values from 0.1 to 1.0, 0.0 - completely transparent, 1.0 - completely opaque).

Example for a stream that containes closed captions:

stream example {
  url udp://239.0.0.1:1234 cc.extract;
  transcoder vb=3000k burn="sub@t1:cb:0:80@font:default:35:white:1.0" vcodec=h264 open_gop=false preset=veryfast size=1920x1080:scale:#000000 vb=1800k burn="sub@t1:cb:0:80@font:default:25:white:1.0" vcodec=h264 open_gop=false preset=veryfast size=-1x720:scale:#000000 ab=128k;
}

In this example, we extract closed captions by using the option cc.extract. You may need to use other options instead of this one.

Important

Depending on what kind of subtitles your input stream contains, use the corresponding options to extract them to text format.

burn=text

burn=text — burns the specified line of text into all video tracks of a stream.

You can customize the display of the text line by setting the font (font) and position on the screen (box) — see Text display settings.

Option example:

transcoder vb=3500k burn=text@Hello:tr@box:green ab=64k;

Subtitle, text, and time display settings

General syntax for the burn option:

burn=<filter>@<text:pos:x:y>@font:<ttf:size:color:alpha>@box:<border:color:alpha>

Here:

  • filter - time|sub|text

  • text - subtitles track (for example t1) for sub, text (for text), %T or %F or their combination (for time).

  • text:pos:x:y - pos - position letter (see below), x:y - offset to the right or left (x) and up or down (y) to the center of the screen. The offset cannot be negative.

  • font: - ttf - font file TTF, color - font color, alpha - opacity (use values from 0.1 to 1.0, 0.0 - completely transparent, 1.0 - completely opaque).

  • box: - border - the padding from the border of the box to the text in it, color - box color, alpha - opacity (use values from 0.1 to 1.0, 0.0 - completely transparent, 1.0 - completely opaque).

Short version of the burn option:

  • burn=time displays the time in the default format
  • burn=sub displays subtitles from track t1
  • burn=text displays an empty string (later you can set the text using the API)

Rules:

  • the first group of parameters () is required, other groups are optional (text, font, box).
  • the first parameter in each group is required (text, font, box).
  • the order of the parameters must be observed.
  • missing parameters will be replaced with default values: size - 16, color - black for box, white for font, border - 6, alpha - 0.8, ttf - FiraCode-Regular.ttf

Below is a detailed description with examples.

Font

  • Flussonic supports .ttf font files.

  • Flussonic looks for the specified font file in the subdirectory font of the /etc/flussonic/ directory. This means you can place the font file like /etc/flussonic/font/SomeFont.ttf

  • If the font file specified is missing in /etc/flussonic/font/, the default FiraCode-Regular.ttf font will be used, which is included in Flussonic.

  • You can specify the full path to a font file. Make sure you put the font file in the directory you specified. For example, let's specify the path to one of the system fonts:

font:/usr/share/fonts/truetype/freefont/FONT_NAME.ttf:50:white:1.0"
  • You can explicitly specify the default font: font:default:30:white:1.0. Flussonic will use FiraCode-Regular.ttf. However, if you copy any font file named default into the fonts directory /etc/flussonic/font/, Flussonic will use that file.

Examples:

font:default:50 — the default font with size 50

font:default:24@box — the default font with size 24 in a box with default dimensions

font:default:26:blue — the default font with size 24 and color blue

font:default:26:blue:0.9 — the default font with size 24 and color blue and 0.9 opacity (use values from 0.1 to 1.0, 0.0 - completely transparent, 1.0 - completely opaque).

Location

Additionally, you can specify the location on the screen where the data will be displayed.

  • tl — top left
  • tr — top right
  • bl — bottom left
  • br — bottom rigth
  • c — center
  • ct — center top
  • cb — center bottom

Together with these location abbreviations, you can specify the horizontal and vertical offsets from the specified location:

  • cb:10:200 - the text will be centered at the bottom of the frame with offsets x=10 (right) and y=200 (up)

  • Offsets are 10 by default. Offsets can be positive integers or 0.

Example:

burn=time@%F:cb:0:200@font:default@box — time in the format YYYY-MM-DD centered at the bottom of the frame and with an offset of 200 upwards.

Note

For processing and displaying fonts, Flussonic uses the libfreetype library, which is included in the set of libraries provided in the flussonic-transcoder-base package. To render text in the CPU and Nvenc transcoders, the ffmpeg drawtext filter is used.

Other options

seamless=true

seamless=true — prevents flickering that can occur when a stream's source or its media_info has changed, especially if the size of the picture in a new source is different than in the previous source.

When transcoding by using the CPU or Nvidia NVENC, this option with the value true can be omitted, since seamless switching occurs by default.

Details

Example:

vb=3000k size=1280x720 ab=copy seamless=true

b-pyramid=strict

b-pyramid=strict — helps achieve a smooth playback of DVB-T streams on devices with the MSD7802+MSB1236C chipset if you use the CPU-based transcoder with 'interlace=true'. This option sets the half-frame sequence in the interlaced video to 'top_first'.

Example:

transcoder vb=3000k size=1280x720 b-pyramid=strict interlace=true