Skip to main content

o11 OTT Streamer Docs & Scripts

O11v4 Web Interface Guide

Description

O11 purpose is to convert LIVE and VOD streams to a friendly protocol such as HLS and/or direct http MpegTS.

The following input formats are currently supported

  • DASH
  • HLS
  • Microsoft Smooth Streaming

Dependencies

  • FFmpeg must be installed when not using internal remuxer
Optimizing O11 v4 OTT Streamer
OTT streamer Ubuntu, o11 v4 install, IPTV streaming server, FFmpeg IPTV, optimize OTT Linux, best IPTV service config, o11v4 ffmpeg setup, systemd IPTV script

Install FFmpeg for o11 v4 OTT

Executing program

You can list command line options using ./o11 -h

Providers  Provider selection page

This page is the default one, itโ€™s a clickable list of the available providers.

To setup a provider logo, create a png file in logos/ which must be named [providerid].png. The provider Id is the provider name with lower case, no space and only alphanumericable chars (example: My Provider becomes myprovider). It is stored as "Id" in the provider config file.

Streams  Streams status page

The FILTER select box allows to select the type of streams to filter.

Click on a stream to display it in the internal player (it must be already in running state or the OnDemand option should be selected). Note that playback will mostly fail under Chrome is the audio track is AC3 or the video track is not H264.

You can also start/stop stream and enter the configuration and logs pages.

Events  Events schedule and replay

You will find on this page the Schedule list for events and the available recorded events (Replays). The list of events is retrieved using the provider script, please look at section below.

Schedule can also be accessed using the -epgport command line option and going to http://ip:epgport/providerid. An XMLEPG version is also accessible at http://ip:epgport/providerid.xml or http://ip:epgport/providerid.xml.gz.

Each new event gets a "eventN" id. N is an unique incremental number. If you want to access on air events, you should use the special id "onairN", where N will never exceed the number of events running simultaneously. This "onairN" id is only valid during the live window of the event.

The second table is the list of replays (recorded events). They are accessible trough the given link or will be automatically played using their original event link when finished.

Vod  Static media files

You will find on this page the list of VOD available in the selected provider.

Recordings  Recordings page

In this page you can setup stream recordings.

Monitoring  Clients monitoring page

You will find on this page all active connections and some informations about the system status.

Logs  Per channel logging

In this page, you will be able to access logs for each channel as well as the main log. The channel logging verbosity can be configured on the configuration page.

Users  Users configuration page

This page is used to manage users access.

When adding a new user, the following options are available:

  • Password: the password for the selected user.
  • Providers: the list of providers the user has access to. If the is Admin option is seletected, the user has access to all providers
  • Networks: allowed network for user. If nothing is selected, the user can access O11 from any ip.
  • IsAdmin: set user as admin. Only admin users can access the Users and Config pages.
  • WebAcess: allow Web UI access to user.

Config  Providers and streams configuration page

Providers

O11 supports multiple providers. Each provider will have its own set of streams and its own network configuration.

The list of available providers can be found in the top navigation bar. 3 type of streams are available: Channels (live), Events and VOD.

Go to Config tab, select a provider name and click on NEW PROVIDER. Provider configuration files will be stored into providers/ by default. This path can be changed using -providers [path] from command-line.

Clicking on RESCAN PROVIDERS will trigger a full scan of the providers/ directory for new provider configuration files.

The DELETE button will delete the selected provider (it cannot be reverted).

You can export a selection of streams or a full providerโ€™s configuration using EXPORT SELECTION or EXPORT.

You can also import a new proviser using the IMPORT button. You can input a provider name or let it use the one from the config file you import. The format is either a text file, a m3u or a O11 cfg file.

Running/Output Mode

O11 supports 5 running modes:

  • Internal remuxer: (default mode) this mode works without FFmpeg, the remuxing operations are done internally. All output modes are available in this this mode. No file is written on disk.
  • FFmpeg resident: FFmpeg must be installed. A FFmpeg process is spawned when the stream is started and will keep running until the channel is stopped. All output modes are available in this this mode.
  • FFmpeg TS HLS/Direct: FFmpeg must be installed. On each new segment, FFmpeg is spawn to convert it to a HLS fragment. CPU load is higher in this mode because FFmpeg is started on every new segment.
  • FFmpeg MultiTS HLS: FFmpeg must be installed. On each new segment, FFmpeg is spawn to convert it to a HLS video or audio fragment. It results in a multi TS HLS playlist.
  • FMP4 HLS: this mode works without FFmpeg. The input stream is converted to FMP4 HLS. No file is written on disk.

O11 supports 4 output modes when Internal Remuxer or Resident FFmpeg running modes are selected:

  • HLS/Direct: in this mode, the input stream is converted to HLS and can also be retrieved in direct HTTP mode.
  • SRT Server: in this mode, the stream is available through the SRT server.
  • Custom Pipe: in this mode, the stream is pushed to a linux pipe and processed by a custom command defined by the -pipeoutputcmd command line parameter.
  • UDP/SRT Push: in this mode, the stream is pushed to a linux pipe and processed by tsplay when using FFmpeg mode. When using internal remuxer, it does not use tsplay. The output destination is defined per channel by the Output field. It should be a space separated list of udp://ip:port or srt://ip:port.

Script

Script name (without it's extension, so example.py becomes example), followed that parameters that will be passed to that script). Other parameters like the action, the network config, ... are automatically passed as parameters too. Check the Scripts paragraph for more details.

UPDATE CHANNELS (R button next to stream type selection in nav-bar)

Call the script to udpate the channels list. If you select auto refresh, channels that are not in the list sent by the script will be removed unless the Ignore Update option is checked.

REFRESH EVENTS (R button next to stream type selection in nav-bar)

Call the script to udpate the events list. It can be automated by clicking on auto refresh. If you select auto refresh, channels that are not in the list sent by the script will be removed unless the Ignore Update option is checked.

NETWORK PARAMETERS (R button next to stream type selection in nav-bar)

Network options can be configured globally for a provider and then overriden per stream.

All these network parameters can be overriden per channel, selecting the NetworkOverride option.

Don't forget to press APPLY NETWORK for the changes to take effect. If you set global network parameters while streams are running, it could crash some of them...

You can select individually a network connection for Scripts/Manifests/Media calls. You can also set a Worker host for each of them, every request will use this host. The real host is passed as an extra header Original-Host.

  • System : use system network configuration.
  • Same as ... : use the same network configuration as...
  • HTTP/SOCKS5 Proxy: coma separated list of proxies. Format is http://user:pass@ip:port for HTTP proxies and socks5://user:pass@ip:port for SOCKS5 proxies.
  • Bind: coma separated list of ips or interface names.
  • DNS over HTTPS: coma separated list of DOH servers.

ADDITIONAL PARAMETERS

A bunch of additioanl parameters can be set here. For more info, put your cursor on the parameter to bring the tooltip.

SCRIPT ACCOUNTS

A list of accounts to use with the script. If the account is enabled and selected (next to the script field or per channel next to the script params field), it's info will be passed when calling the script. For instance, [email protected] password=mypassword device=123456 pin=1234. The login button can be used to call the script with the login action, to test if the account works. The script must print 'logged in' to validate the login. The pair

button can be used to call the script with the pair action.

Channels

To add a new channel to a provider, ho to Config tab and press ADD STREAM after entering its name in the field.

To delete a stream, click on its checkbox and press DELETE SELECTION. If the stream was running, it will be stopped first, then deleted.

Stream configuration

  • START/STOP: to start or stop the stream.
  • Name: the name of the stream. This is also a clickable link that will start the internal player. You can also copy this link (HLS) to use in another player.
  • Status: the status of the stream.
  • ModeLiveReplay or VODLive mode is for a live channel. Replay will trigger a fetch of all the fragments from the manifest and generate a HLS output stream. VOD can be used to get VOD streamd and generate mp4 file.
  • Manifest: setup the manifest url. If SessionManifest option is selected, the provider script will be called if needed. please check the Scripts section for more details. Network ovverride fields will also appear in the box when the NetworkOverride option is selected. Press the R button to parse the manifest and refresh the tracks list.
  • Tracks: list of selectable Video/Audio/Subtitles tracks. Only one Video track can be selected. The Best quality option is seletected by default and let O11 take the best resolution/bandwidth/framrate. Multiple audio and subtiltes tracks can be selected.
  • Keys or CDM Script: set the decryption keys for the stream. On line per kid:key. If UseCdm is selected, O11 will try to call the selected provider script to get keys using the specified parametersm. Please check the Scripts section for more detail.
  • Options: please see the Stream options section.

Stream options

Several options can be selected for each stream.

  • Script params/Account selection: set the script parameters to be added to the other parameters for this channel (typically id=channelid). The account to use with this channel can be selected here, if Provider is chosen, it will use the same account as the providers'one.
  • Autostart: auto start the stream when starting O11. It is possible to override this option globally using the -noautostart command-line option. If the stream is an event, it will be autostarted only during live window.
  • On demand: automatically start a stream when the internal or a remote player request for it. The stream is then automatically stops when it is not used anymore. Use this option to avoid having all streams running for nothing 24/24.
  • Speed up: run all segments download in parallel. It speeds up OnDemand more start.
  • Session manifest: call the script to automatically get the manifest URL. Usefull when the manifest is changing (check the Scripts paragraph for more details).
  • CDM script: call the script automatically get keys when needed (check the Scripts paragraph for more details).
  • Network override: add new fields to override the global network configuration (check the Scripts paragraph for more details).
  • Mode override: override running and output modes.
  • Record event: record the event and convert it in real-time to a replay. If checked, the event will auto start during it's live window to be recorded.
  • Record TS: record the stream on the fly and store it as a MpegTs in rec/.
  • Replay manifest: get all fragments from the manifest.
  • Ignore update: donโ€™t autoremove/modify this channel when using the channels or events script (check the Scripts section for more details).
  • Time range: select a time range to extract from a manifest. Only works with DASH using times and not numbers.
  • Daily OnAir: select a time range where the live will be automatically started every day. It will be stopped when not in this daily range. Time is localized based on browser.
  • Output field: list of UPD/SRT outputs or Custom command parameters.
  • Logs: set the channel logging verbosity. This will not be saved, so on next reboot, it will use the global value (set with -v N at startup).

Scripts

Scripts play a big role for O11. Each provider should have each own script. It can be either a shell script (.sh) or a python3 script (.py).
An example of script can be found here example.py. It uses o11.py. When a script is configured, only itโ€™s name body must be specify. O11 will first try to start the .sh extension and then .py one if not available.
Scripts must be stored in the scripts/ directory.

Let say we have a provider called Provider 1which script name is provider1.py, stored in scripts/provider.py.
This script must then be referenced as provider1 in the Script field. Some script extra parameters can be specified.

Depending on the type of script, it will automatically receive the following parameters, additionnaly to the ones configured by user.

  • Common to all scripts: action=[action type] bind=[bind] proxy=[proxy] doh=[doh] worker-[worker]. Action type can be one of: login, pair, manifest, cdm, events, channels, heartbeat.
  • Manifest script: action=manifest
  • Cdm script: action=cdm drm=[widevine or playready] challenge=[drm challenge] pssh=[pssh used to extract needed keys]
  • Events: action=events
  • Channels: action=channels
  • Heartbeat: action=heartbeat heartbeaturl=[heartbeat url returned by manifest script] heartbeatparams=[heartbeat parms returned by manifest script]

Manifest script specifics

A manifest script should return a json formatted as followed:

{
    "ManifestUrl" : [manifest url],
    "Cdn" : [
	{
	    'Name': 'akamai',
	    'ManifestUrl': 'http://...'
	},
	...
    },
    "Headers": {
	"manifest": {
	    'user-agent': 'mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/107.0.0.0 safari/537.36',
	    'custom-header': 'it's me',
	    ...
	},
	"media": {
	    'user-agent': 'mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/107.0.0.0 safari/537.36'
	    'custom-header': 'it's me',
	    ...
	}
    },
    "Heartbeat": {
	"Url" : [heartbeat url],
	"Params": [param1,param2,...],
	"PeriodMs" : 5*60*1000
    }
}
		

Cdm script specifics

A CDM script should return a list of kid:key formatted as followed:

kid1:key1
kid2:key2
...
		

Events/Channels script specifics

A events or channels script should return a list of streams following the same format as the config files:

{
  "[Channels or Events]": [
    {
      // Name of the channel or the title of the event
      "Name": "[name]",
      // Mode: live or vod
      "Mode": "live",
      // Use session manifest
      "SessionManifest": true,
      // Script parameters to use to retrieve the manifest or keys
      "ScriptParams": "id=123 country=fr",
      // CDM type (widevine, playread or verimatrix)
      "CdmType": "widevine",
      // Use cdm script to get keys
      "UseCdm": true,
      // Script parameters to use to retrieve keys
      "Video": "best",
      // Set the audio stream which desc includes 'en'
      "Audio": "desc:en",
      // Enable On Demand
      "OnDemand": false,
      // Enable fragments download speed up (download all required fragments simultaneously to speed up start)
      "SpeedUp": true,
      // Autostart stream. For events, this will autostart the stream when in the on air range (time >= Start and time <= End)
      "Autostart": true,
      // For events, define UTC start and stop timestamp. They will be autostarted in the onAir window if Autostart or RecordEvent is true
      "Start": 1682631577,
      "End": 1682632577,
      // For events, define if the event must be recorded and become a replay (only works in direct/hls mode with internal remuxer)
      "RecordEvent": true
    },
    ...
   ]
}