forked from chrisbenincasa/tunarr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce new default HLS stream mode (chrisbenincasa#780)
This commit introduces a new HLS stream mode, modeled off of the great "HLS segmenter" in ErsatzTV. It also introduces the concept of "channel stream modes" which are customizable in the UI. Overall this commit performs a ton of refactoring and cleanup around the streaming pipeline, consolidating a lot of logic and moving things around to make all parts of it more flexible, understandable, and extensible in the future.
- Loading branch information
1 parent
31abb94
commit 6e66cfe
Showing
82 changed files
with
3,362 additions
and
2,033 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Channel Trancoding Settings | ||
|
||
## Stream Mode | ||
|
||
Tunarr supports several different stream modes that can be set at the channel level. | ||
|
||
!!! info | ||
|
||
No matter which stream mode you choose for a channel, clients which require an MPEG-TS stream will still work. | ||
|
||
### HLS (recommended) | ||
|
||
HLS is the default streaming mode for a channel. In our testing, it is generally the most reliable and efficient. It is akin to [ErsatzTV's](https://ersatztv.org/) "HLS Segmenter" mode. | ||
|
||
#### How does it work? | ||
|
||
This mode creates a single FFMPEG process, per-program. The process applies all transcoding configuration necessary. Tunarr manages interleaving these processes to create seamless m3u8 playlists for playback. | ||
|
||
#### Things to consider | ||
|
||
In our testing, we've found this mode to be both efficient and reliable. That said, it is also the newest mode introduced to Tunarr, so there might be some kinks to work out. | ||
|
||
### HLS alt | ||
|
||
HLS alt (name pending!) is another HLS streaming mode, which operates a little differently. This mode is akin to [ErsatzTV's](https://ersatztv.org/) "HLS Segmenter V2" mode. | ||
|
||
#### How does it work? | ||
|
||
This mode creates two FFMPEG processes. The first runs per-program and applies scaling/cropping, watermarks, frame rate changes, etc, but outputs a rawvideo stream. The second process concatenates all of these together while also applying bit rate limits and codec changes. | ||
|
||
#### Things to consider | ||
|
||
The downside to this mode is that the one of the steps (the per-program process) _requires_ software encoding. This can put a lot of stress on certain systems. The stream setup can also lead to quality loss, due to generation loss. However, it does have the potential to create a more reliable / robust stream. | ||
|
||
### MPEG-TS | ||
|
||
This mode is the closest to the DizqueTV experience. | ||
|
||
#### How does it work? | ||
|
||
It consists of two FFMPEG processes, one which performs the per-program transcode, outputting an mpeg-ts stream and one which concatenates this raw stream together and outputs it. | ||
|
||
#### Things to consider | ||
|
||
If this mode was "good enough" we probably wouldn't have spent time implementing the other modes! There are a lot of potential issues with this mode; too many to list here. | ||
|
||
## Watermarks | ||
|
||
Channels can have watermarks to aid in recreating a classic TV experience. | ||
|
||
![](/assets/watermark_form.png) | ||
|
||
There are many ways to customize watermarks for a channel. Here are some details on specific options: | ||
|
||
### Watermark Period | ||
|
||
This value can be used to fade a channel's watermark in/out every N minutes. | ||
|
||
### Watermark on leading edge | ||
|
||
When using intermittent watermarks, use this option to control whether the watermark begins in a visible (true) or hidden (false) state. | ||
|
||
### Total watermark duration | ||
|
||
This option controls the absolute duration the watermark can be displayed for a given program segment of a channel. Its value takes precedence over the 'watermark period' but does not disable it. For instance, you could configure a watermark period of 5 minutes with total duration of 45 mins. On a show that is one hour, the watermark will fade in/out for the first 45 minutes and then be hidden for the final 15 minutes. | ||
|
||
## Overrides | ||
|
||
Global settings, such as target resolution, bit rate, and buffer size can be overridden per-channel. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Scheduling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Scheduling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Scheduling Tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{ | ||
"version": 1, | ||
"migration": { | ||
"legacyMigration": false, | ||
"isFreshSettings": true | ||
}, | ||
"settings": { | ||
"clientId": "332e9a98-63a7-44d0-8add-854ccc5d5cee", | ||
"hdhr": { | ||
"autoDiscoveryEnabled": true, | ||
"tunerCount": 2 | ||
}, | ||
"xmltv": { | ||
"programmingHours": 12, | ||
"refreshHours": 4, | ||
"outputPath": "/Users/christianbenincasa/Code/projects/tunarr/server/xmltv.xml", | ||
"enableImageCache": false | ||
}, | ||
"plexStream": { | ||
"streamPath": "network", | ||
"enableDebugLogging": false, | ||
"directStreamBitrate": 20000, | ||
"transcodeBitrate": 2000, | ||
"mediaBufferSize": 1000, | ||
"transcodeMediaBufferSize": 20000, | ||
"maxPlayableResolution": { | ||
"widthPx": 1920, | ||
"heightPx": 1080 | ||
}, | ||
"maxTranscodeResolution": { | ||
"widthPx": 1920, | ||
"heightPx": 1080 | ||
}, | ||
"videoCodecs": [ | ||
"h264", | ||
"hevc", | ||
"mpeg2video", | ||
"av1" | ||
], | ||
"audioCodecs": [ | ||
"ac3" | ||
], | ||
"maxAudioChannels": "2.0", | ||
"audioBoost": 100, | ||
"enableSubtitles": false, | ||
"subtitleSize": 100, | ||
"updatePlayStatus": false, | ||
"streamProtocol": "http", | ||
"forceDirectPlay": false, | ||
"pathReplace": "", | ||
"pathReplaceWith": "" | ||
}, | ||
"ffmpeg": { | ||
"configVersion": 5, | ||
"ffmpegExecutablePath": "/usr/bin/ffmpeg", | ||
"numThreads": 4, | ||
"concatMuxDelay": 0, | ||
"enableLogging": false, | ||
"enableTranscoding": true, | ||
"audioVolumePercent": 100, | ||
"videoEncoder": "libx264", | ||
"hardwareAccelerationMode": "none", | ||
"videoFormat": "h264", | ||
"audioEncoder": "aac", | ||
"targetResolution": { | ||
"widthPx": 1920, | ||
"heightPx": 1080 | ||
}, | ||
"videoBitrate": 10000, | ||
"videoBufferSize": 1000, | ||
"audioBitrate": 192, | ||
"audioBufferSize": 50, | ||
"audioSampleRate": 48, | ||
"audioChannels": 2, | ||
"errorScreen": "pic", | ||
"errorAudio": "silent", | ||
"normalizeVideoCodec": true, | ||
"normalizeAudioCodec": true, | ||
"normalizeResolution": true, | ||
"normalizeAudio": true, | ||
"maxFPS": 60, | ||
"scalingAlgorithm": "bicubic", | ||
"deinterlaceFilter": "none", | ||
"disableChannelOverlay": false, | ||
"disableChannelPrelude": false | ||
} | ||
}, | ||
"system": { | ||
"backup": { | ||
"configurations": [] | ||
}, | ||
"logging": { | ||
"logLevel": "debug", | ||
"logsDirectory": "/Users/christianbenincasa/Library/Preferences/tunarr/logs", | ||
"useEnvVarLevel": true | ||
}, | ||
"cache": { | ||
"enablePlexRequestCache": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.