Configuration
Reading time ~7 minutes
Application Settings
The appsettings.json configuration file is provided in the Cinegy Subtitling Service installation package. Below is the sample of the appsettings.json configuration file with the detailed description:
{
"AllowedHosts": [
"http://localhost:8080",
"https://subs.qa.cinegy.com"
],
"ApplicationUrls": [
"http://0.0.0.0:8501"
],
"Logging": {
"LogLevel": {
"Default": "Trace",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Warning"
}
},
"Telemetry": {
"Enabled": false,
"OrgId": "sandpit",
"Tags": "",
"TelemetryServer": "https://telemetry.cinegy.com"
},
"Globals": {
"LiveId": "LIVE"
},
"SubtitleChannels": [
{
"Id": 1,
"ClearInterval": 500,
"Repositories": [
{
"Id": 0,
"Language": "ENG",
"FileSource": {
"FileSearchPolicy": "Auto",
"Directory": "D:\\Subtitles1"
},
"LiveSource": {
"Enabled": true,
"EndPoint": "127.0.0.1:50125",
"VerbosityEnabled": false
},
{
"Id": 1,
"Language": "RUS",
"FileSource": {
"FileSearchPolicy": "SubtitleId",
"Directory": "D:\\Subtitles2"
},
"LiveSource": {
"Enabled": false,
"EndPoint": "127.0.0.1:50125",
"VerbosityEnabled": false
},
}
],
"Streams": [
{
"InputUrl": "rtp://@239.1.1.2:1234",
"InputAdapter": "0.0.0.0",
"InputSrtLatency": -1,
"InputSrtPassphrase": null,
"OutputUrl": "rtp://239.1.1.3:1234",
"OutputAdapter": "0.0.0.0",
"OutputBackupAdapter": null,
"OutputSrtPassphrase": null,
"OutputTTL": 1,
"FrameRate": "25",
"VideoPid": 0,
"Encoders": [
{
"Type": "Teletext",
"RepositoryId": 0,
"SubtitlePid": 4098,
"SyncOffset": 0,
"Magazine": 8,
"Page": 1
},
{
"Type": "DVB",
"RepositoryId": 1,
"SubtitlePid": 4099,
"SyncOffset": 0,
"FrameSize": "1920x1080"
}
],
"Multiplexer": {
"Type": "Video",
"Mode": "Insert",
"SyncDelayFrames": 7,
"SyncToleranceFrames": 0
}
}
]
}
]
}
AllowedHosts is used for host filtering to bind your Cinegy Subtitling Service to specific hostnames for security reasons.
ApplicationUrls can be set as follows: http://<server_name>:8501
, where <server_name> is the REST IP of the server where Cinegy Subtitling Service is running. Set it to 0.0.0.0 to use all the available IPv4 addresses on the local machine.
Logging configuration is provided in the Logging section.
Note
|
The log files are stored in the following path: C:\ProgramData\Cinegy\SubtitlingService\logs. |
The Telemetry section defines the Cinegy Telemetry messaging parameters. Telemetry notifications are logged into Grafana portal deployed inside the Cinegy Telemetry cluster, that allows to secure customer data by organization ID and provide a direct access to the exact data stored.
In the Globals section the value for the LiveId parameter should be defined. It should match Subtitle Id defined in Cinegy Air.
A subtitle channel is a reflection of a TV channel that can contain one or more video streams (in case of simulcast) based on the same Cinegy Air playlist, so that all streams have the same content. Each channel can use multiple subtitle encoders configured in the SubtitleChannels section with the following parameters:
-
Id – defines the channel ID that determines which Cinegy Air Engine channel should be associated with this subtitle channel.
NoteSetting this parameter is necessary only if you are building multi-channel subtitle insertion on one machine. Otherwise, its value can be set to "0" and there is no need to define the channel ID in the Cinegy Air engine. -
ClearInterval – defines the time interval, in milliseconds, for sending the 'clear' command when a new item is started.
Note
|
To use multiple channels, duplicate content of the SubtitleChannels section and edit its parameters accordingly. |
Each subtitle channel may have one or more subtitle encoders. The subtitle encoder is an engine generating subtitle data, based on its parameters, playlist data and reference video stream. Each encoder is linked to the subtitle repository, containing the SUB files with subtitles. Each Repository has its own static settings, defining its content:
-
Id – defines the repository ID.
-
Language – defines the teletext language descriptor as a three-letter abbreviation (ENG, RUS).
NoteFor multilingual mode, you can use different languages in different subtitle encoders for one subtitle channel. -
FileSource group defines the following parameters:
-
FileSearchPolicy – defines the subtitles files search policy.
NoteCurrently, the following subtitle file search policies are supported: "SubtitleId" for search by Subtitle Id of items in the Cinegy Air playlist and "Auto". -
Directory – defines the folder where subtitle SUB files are placed.
NoteThe folder name must contain a number.
-
-
LiveSource group defines the following parameters:
-
Enabled – defines whether the live source will be enabled or disabled. If set to "True", it provides subtitle generation for live items using the Newfor protocol and requires a subtitle repository separate from that used by the DVB subtitles.
-
EndPoint – defines the IP address of the machine that provides a live source and port of that machine in the following format:
IP_Address:port
. -
VerbosityEnabled – enables/disables verbose mode for debugging in logging.
-
The Streams section is the group of subtitle encoders muxed into the single subtitle TS stream. Each subtitle encoder, defined in the channel, can be used in several subtitle streams, in any combination. Each subtitle stream uses one channel video stream as the reference.
Note
|
Only one license is required for each subtitle encoder, regardless of the number of subtitle streams created, since the same subtitle encoder data is used. Refer to the scenario using a configuration with one subtitle stream and two subtitle encoders. |
-
InputUrl – defines the input stream URL.
NoteThis parameter should be the same as set for the master Air engine. -
InputAdapter – defines the input network adapter.
NoteThis parameter should be the same as set for the master Air engine. Also, it can be set to "0.0.0.0" to use all the adapters. -
InputSrtLatency – the latency to be used for encoding the input SRT stream.
-
InputSrtPassphrase – define the passphrase for input SRT stream encryption.
NoteThis parameter is optional. -
OutputUrl – defines the output stream URL.
-
OutputAdapter – defines the output network adapter.
NoteSet this parameter to "0.0.0.0" to use any adapter. -
OutputBackupAdapter – defines the output backup network adapter.
NoteThis parameter is optional. -
OutputSrtPassphrase – define the passphrase for output SRT stream encryption.
NoteThis parameter is optional. -
OutputTTL – defines the TTL (Time To Live) interval for output.
-
FrameRate – defines the stream frame rate.
-
VideoPid – defines the video stream ID in the incoming program.
NoteThis parameter should be the same as set for the master Air engine. If this parameter is absent in the configuration file or its value is set to "0", the first video stream in the program will be taken. -
Encoders group allows the user to configure subtitle encoders with the following parameters:
-
Type – defines the subtitle encoder type.
NoteCurrently the "teletext" and "DVB" types are supported. NotePlease note that formatting for DVB subtitles is not supported. -
RepositoryId – defines the repository ID used by the encoder.
-
SubtitlePid – defines the subtitle PID.
-
SyncOffset – defines the sync adjustment, in milliseconds.
-
Magazine – defines the teletext magazine number.
NoteThis parameter is only topical for the teletext encoder and should be the same as set for the master Air engine. -
Page – defines the teletext page number.
NoteThis parameter is only topical for the teletext encoder and should be the same as set for the master Air engine. -
FrameSize – the frame size in pixels horizontally (width) and vertically (height).
NoteThis parameter is only topical for the DVB encoder.
-
Video muxer is an optional component, which can be applied to each subtitle stream in channel to multiplex the generated subtitle stream with its reference video stream into the master output stream.
-
Multiplexer can be configured with the following parameters:
-
Type – defines the subtitle multiplexer type.
NoteCurrently the "video" and "subtitle" types are supported. NoteThe subtitle multiplexer has no configuration. -
Mode – defines video multiplexer mode.
NoteThis parameter can be set as "overwrite" or "insert"). -
SyncDelayFrames – defines the subtitling buffer size.
NoteThis parameter is only topical for the video multiplexer. The minimum value for this parameter is "3"; the recommended value is "7". -
SyncToleranceFrames – defines the subtitling synchronization tolerance.
NoteThis parameter is only topical for the video multiplexer. The default value for this parameter is "0".
-
Typical Configurations
This section provides various scenarios of the Cinegy Subtitling Service configuration.
One Channel: Two Subtitle Encoders, No Video Muxer
This scenario uses one channel with two subtitle encoders and does not use a video muxer:

The following licenses are required for this scenario:

One Channel: Two Subtitle Encoders, One Video Muxer
This scenario uses one channel with two subtitle encoders and one video muxer:

The following licenses are required for this scenario:

One Channel: Two Subtitle Streams, Two Subtitle Encoders, Two Video Muxers
This scenario uses one channel with two subtitle streams, two subtitle encoders and two video muxers:

The following licenses are required for this scenario:

Two Channels: Each One Has Two Subtitle Encoders, One Video Muxer
This scenario uses two channels and each one has two subtitle encoders and one video muxer:

The following licenses are required for this scenario:
