Overwrite Mode
Reading time ~3 minutes
In this article, we outline the functionality of the Cinegy Subtitling Service when operating in overwrite mode. In this mode, the Cinegy Subtitling Service replaces Teletext data in the incoming stream with subtitle data sourced from the subtitle file. This process is driven by events received from the Cinegy Event Manager.
The following scheme illustrates which components are required to set up the subtitle overwriting workflow:
Note
|
Overwrite mode works only for Teletext subtitles. |
Cinegy Subtitling Service Configuration
Following is an example of an appsettings.json file for the simple configuration of Teletext subtitles. Edit this file according to your workflow configuration:
{
"ApplicationUrls": [
"http://localhost:8501"
],
"Logging": {
"LogLevel": {
"Default": "Trace",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Warning"
}
},
"Telemetry": {
"Enabled": false,
"OrgId": "sandpit",
"Tags": "dev, testchannel",
"TelemetryServer": "https://telemetry.cinegy.com"
},
"Globals": {
"LiveId": "LIVE",
"SyncOffsetBase": 280
},
"SubtitleChannels": [
{
"Id": 0,
"ClearInterval": 500,
"Repositories": [
{
"Id": 0,
"Language": "ENG",
"FileSource": {
"FileSearchPolicy": "Auto",
"Directory": "D:\\Subtitles1"
},
"LiveSource": {
"Enabled": true,
"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": 2049,
"SyncOffset": 0,
"Magazine": 8,
"Page": 1
},
],
"Multiplexer": {
"Type": "Video",
"Mode": "Overwrite",
"SyncDelayFrames": 7,
"SyncToleranceFrames": 0
}
}
]
}
]
}
Workflow Configuration
-
Prepare the subtitles repository with SRT files. In our example, it is
D:\\Subtitles1
– please ensure that your directory name includes a unique number. In the appsettings.json file it is defined in the following section:"Repositories": [ { "Id": 0, "Language": "ENG", "FileSource": { "FileSearchPolicy": "Auto", "Directory": "D:\\Subtitles1" },
Here also specify the subtitles language in the "Language" parameter.
SRT files should have the corresponding Subtitle ID string as a part of their file name.
-
Create a playlist and add the corresponding Subtitle ID for the items. Use media with imbedded Teletext data.
NoteThe "Subtitle ID" field can only be edited if the "Metadata editing" option is enabled in the Cinegy Air Configurator. The Subtitle ID can contain alphanumerical characters. NoteMake sure the initial timecodes of playlist items correspond to the timecodes within subtitle files. -
Configure the Cinegy Playout engine. In this example, the RTP output is used:
In the appsettings.json file, input and output streams are defined in the following section:
"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": [
The "Teletext Stream PID", magazine and page values, defined in Cinegy Playout configurator, should also be specified in the corresponding parameters within the following section of the appsettings.json file:
{ "Type": "Teletext", "RepositoryId": 0, "SubtitlePid": 2049, "SyncOffset": 0, "Magazine": 8, "Page": 1 },
Then on the "Subtitle events" tab configure the events:
The channel ID in the "Op1" field should correspond to the value defined in the following section of the appsettings.json file:
"SubtitleChannels": [ { "Id": 0, "ClearInterval": 500,
-
Cinegy Event Manager needs to be configured and activated. The Cinegy Subtitling API address defines the server where the Cinegy Subtitling Service is running.
-
(Optional) Configure the viewer for the stream with subtitles, in this example, it will be Cinegy Multiviewer. In the "Input settings" tab set the MPEG-TS player mode. In the "URL" field specify the address defined in the "OutputUrl" parameter within the appsettings.json file. The "Captioning mode" parameter should be set to "Teletext":
In the "Output settings" tab add and enable Window Output.
Apply the settings and launch the Cinegy Multiviewer application. The configured streams with subtitles will be displayed in the Cinegy Multiviewer window: