Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
69906fc
Begin implementing render on demand
JustAMan Mar 18, 2020
ad1a0a3
Change return type of renderBlend()
JustAMan Mar 23, 2020
3be4c2b
Reset render cache when target size changes
JustAMan Mar 19, 2020
65f5aa7
Add lots of debug logging, limit render fps of events
JustAMan Mar 19, 2020
a28d91f
Trying to handle seek better
JustAMan Mar 20, 2020
95bff90
* Start rendering only when video size is determined (e.g. video load…
JustAMan Mar 20, 2020
5f168d7
Less zealous logging
JustAMan Mar 20, 2020
1a52e49
Rework buffer into C++ class
JustAMan Mar 23, 2020
f38fc7e
Event time findings are now proper members (but not exported yet)
JustAMan Mar 23, 2020
2132148
Expose findEventStopTimes and findNextEventStart properly
JustAMan Mar 23, 2020
3eaf730
Use properly bound APIs
JustAMan Mar 23, 2020
5e2131a
No longer need to export functions via makefile
JustAMan Mar 23, 2020
f7e0be8
Use correct function to get event times
JustAMan Mar 23, 2020
cc1a7de
Fix some issues caused by moving to C++ bindings
JustAMan Mar 23, 2020
2e93f95
Fix oneshot render
JustAMan Mar 23, 2020
c1e20f3
Try to fix animations flickering
JustAMan Mar 23, 2020
08f72cd
Reduce blinking of subs when in lite mode
JustAMan Mar 20, 2020
16fcde7
Change SubtitleOctopus class API - added a few methods to be used in …
JustAMan Mar 24, 2020
7fefc36
Fix build and warnings
JustAMan Mar 24, 2020
567c0c8
Add option to client-facing API to drop all animations, pass it down …
JustAMan Mar 24, 2020
16cd938
Make octopus.setDropAnimations(true) mean something
JustAMan Mar 24, 2020
91f7864
Try fix holes in rendering
JustAMan Mar 24, 2020
c565f94
Handle resizing more efficiently - if video changed less than 20% kee…
JustAMan Mar 25, 2020
f2c1fea
Add ability to limit canvas size
JustAMan Mar 25, 2020
35efbb9
Bump default max height to 2160
JustAMan Mar 25, 2020
a602fd7
Add option to disable scaling altogether when height is less than har…
JustAMan Mar 25, 2020
87a7249
Add option to control how much size may vary until the prerender cach…
JustAMan Mar 25, 2020
59bb2f9
Fix prerender cache not clearing upon track switch
JustAMan Mar 25, 2020
5222a22
Handle resize better - leave leftmost items be upon resizing
JustAMan Mar 25, 2020
1397267
Do not reset prerender cache when resize is not actually a resize
JustAMan Mar 25, 2020
643b1c7
Make resetRenderAheadCache public
JustAMan Apr 27, 2020
f54f72a
Reduce spam in logs when worker is not yet initialized
JustAMan Apr 27, 2020
1231375
lastRendered needs to be a variable
teranode Aug 19, 2020
5552f9c
Fix render after rewind
dmitrylyzo Sep 18, 2021
bc8c3ff
Stop oneshot render on dispose
dmitrylyzo Sep 18, 2021
c07d6a3
Fix a lost last event
dmitrylyzo Oct 7, 2021
c2b711a
Remove the default canvas height limit
dmitrylyzo Oct 8, 2021
40da83b
readme: add missing documentation
dmitrylyzo Oct 8, 2021
026b744
Fix blend render returning empty result
dmitrylyzo Oct 8, 2021
3e81e57
renderAhead, dropAllAnimations: fix animation detection
TheOneric Oct 11, 2021
10c35c5
Fix array comparison
dmitrylyzo Oct 18, 2021
5c29b84
refactor: rename findNextEventStart -> findNextEventFrame
dmitrylyzo Oct 19, 2021
f4318fd
refactor: extract constants
dmitrylyzo Oct 19, 2021
22b1de4
Reduce the default target FPS to reduce the waste of CPU-time and mem…
dmitrylyzo Oct 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,19 @@ When creating an instance of SubtitleOctopus, you can set the following options:
occurs if browser doesn't support web workers). (Optional)
- `debug`: Whether performance info is printed in the console. (Default:
`false`)
- `renderMode`: Rendering mode. (If not set, the rendering mode is determined by the `blendRender` and `lossyRender` options)
- `normal` - Default
- `blend` - WASM Blending
- `fast` - Fast Render Mode (Lossy) (EXPERIMENTAL)
- `dropAllAnimations`: Remove all animation tags, such as karaoke, move, fade, etc. (Default: `false`)
- `libassMemoryLimit`: libass bitmap cache memory limit in MiB (approximate) (Default: `0` - no limit)
- `libassGlyphLimit`: libass glyph cache memory limit in MiB (approximate) (Default: `0` - no limit)
- `targetFps`: Target FPS (Default: `24`)
- `prescaleTradeoff`: Scale down (`< 1.0`) the subtitles canvas to `softHeightLimit` to improve speed, or scale it up (`> 1.0`) to improve quality. (Default: `null` - no scaling)
- `softHeightLimit`: The height to which the subtitles canvas will be scaled. (Default: `1080`)
- `hardHeightLimit`: The maximum height of the subtitles canvas. (Default: `0` - no limit)
- `renderAhead`: How many MiB (approximate) of subtitles to render ahead and store. (Default: `0` - don't render ahead)
- `resizeVariation`: The resize threshold at which the cache of pre-rendered events is cleared. (Default: `0.2`)

Additionally there are options to choose between different rendering modes, which are detailed
below. If multiple rendering options are set any of them may be used, they are not additive.
Expand All @@ -142,6 +155,24 @@ The Fast Render mode has been created by @no1d as a suggestion for fix browser f

**WARNING: Experimental, not stable and not working in Safari**

#### Render Ahead (WASM Blending with pre-rendering) (EXPERIMENTAL)
Upon creating the SubtitleOctopus instance, set `renderAhead` in the options to a positive value to use this mode.
In this mode, SubtitleOctopus renders events in advance (using WASM blending) so that they are ready in time.
The amount of pre-rendered events is controlled by the `renderAhead` option.
Each pre-rendered event is provided with information about its start time, end time, and end time of the gap after (if any).
This mode will analyse the events to avoid rendering empty sections or rerendering non-animated events.
Resizing the video player clears the cache of pre-rendered events (the threshold is set by `resizeVariation`).

> The `renderMode`, `blendRender` and `lossyRender` options are ignored.

> **WARNING: Experimental, may stall on heavily animated subtitles**
This mode tries to render every transition - at worst, every frame - in advance.
If the rendering of many frames takes too long and the cache of prepared frames gets depleted
(e.g. during a long section with heavy animations), the current subtitle-frame will continue to
be displayed until the prerendering can catch up again.
Adjusting `prescaleTradeoff`, `softHeightLimit` and `hardHeightLimit` to lower the resolution of
the rendering canvas can work around this at the expense of visual quality.


### Brotli Compressed Subtitles
The SubtitleOctopus allow the use of compressed subtitles in brotli format, saving bandwidth and reducing library startup time
Expand Down
Loading