Skip to content

Commit 3357511

Browse files
committed
Update readme for multiple workers, etc
1 parent 09d4a73 commit 3357511

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

README.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,21 @@ This allows you to preview the end of the file before every thumbnail has been g
1717

1818
## How do I install it?
1919

20-
Grab both the two `.lua`s from the [**releases page**](https://github.com/TheAMM/mpv_thumbnail_script/releases) (or [see below](#development) how to "build" (concatenate) it yourself) and place them both to your mpv's `scripts` directory. (**Note!** Also see Configuration below)
20+
Grab both the two `.lua`s from the [**releases page**](https://github.com/TheAMM/mpv_thumbnail_script/releases) and place them both to your mpv's `scripts` directory.
2121

2222
For example:
2323
* Linux/Unix/Mac: `~/.config/mpv/scripts/mpv_thumbnail_script_server.lua` & `~/.config/mpv/scripts/mpv_thumbnail_script_client_osc.lua`
2424
* Windows: `%APPDATA%\Roaming\mpv\scripts\mpv_thumbnail_script_server.lua` & `%APPDATA%\Roaming\mpv\scripts\mpv_thumbnail_script_client_osc.lua`
2525

26-
See the [Files section](https://mpv.io/manual/master/#files) in mpv's manual for more info.
26+
(See the [Files section](https://mpv.io/manual/master/#files) in mpv's manual for more info.)
2727

28-
The script can also use FFmpeg for faster thumbnail generation, which is highly recommended.
29-
Just make sure `ffmpeg[.exe]` is in your `PATH`.
28+
You should also read the [Configuration](#configuration) section.
29+
30+
While the script doesn't need external dependencies and can work with mpv alone, it can also use FFmpeg for *slightly* faster thumbnail generation; just make sure `ffmpeg[.exe]` is in your `PATH` and `prefer_mpv` is set to `no` in your configuration.
31+
32+
***However,*** FFmpeg does not support "ordered chapters" in MKVs (segment linking, ie. an `.mkv` references another `.mkv`), which can break the thumbnailing process. You have been warned.
33+
34+
In general, you should just use multiple worker scripts ([Configuration](#configuration)) instead of taking the FFmpeg-risk.
3035

3136
**Note:** You will need a rather new version of mpv due to [the new binds](https://github.com/mpv-player/mpv/commit/957e9a37db6611fe0879bd2097131df5e09afd47#diff-5d10e79e2d65d30d34f98349f4ed08e4) used in the patched `osc.lua`.
3237

@@ -42,13 +47,22 @@ You may change this duration check in the configuration (`autogenerate_max_durat
4247

4348
**Note!** Because this script replaces the built-in OSC, you will have to set `osc=no` in your mpv's [main config file](https://mpv.io/manual/master/#files).
4449

45-
Create a file called `mpv_thumbnail_script.conf` inside your mpv's `lua-settings` directory to adjust the script's options.
50+
51+
**Multithreading:**
52+
This script can use multiple concurrent thumbnailing jobs.
53+
Simply copy the `mpv_thumbnail_script_server.lua` once or twice (`mpv_thumbnail_script_server-1.lua`, `mpv_thumbnail_script_server-2.lua`) and the workers will automatically register themselves with the core.
54+
This improves thumbnailing speed a bunch, but you will quickly max out your CPU - I recommend only having two or three copies of the script.
55+
(Why multiple copies of the same file? mpv gives each script their own thread - easy multithreading!)
56+
57+
To adjust the script's options, create a file called `mpv_thumbnail_script.conf` inside your mpv's `lua-settings` directory.
4658

4759
For example:
4860
* Linux/Unix/Mac: `~/.config/mpv/lua-settings/mpv_thumbnail_script.conf`
4961
* Windows: `%APPDATA%\Roaming\mpv\lua-settings\mpv_thumbnail_script.conf`
5062

51-
See the [Files section](https://mpv.io/manual/master/#files) in mpv's manual for more info.
63+
(See the [Files section](https://mpv.io/manual/master/#files) in mpv's manual for more info.)
64+
65+
5266

5367
In this file you may set the following options:
5468
```ini
@@ -71,10 +85,17 @@ autogenerate=[yes/no]
7185
autogenerate_max_duration=3600
7286

7387
# Use mpv to generate thumbnail even if ffmpeg is found in PATH
74-
# It's better to use ffmpeg, but the choice is yours
75-
# Defaults to no
88+
# ffmpeg is slightly faster than mpv but lacks support for ordered chapters in MKVs,
89+
# which can break the resulting thumbnails. You have been warned.
90+
# Defaults to yes (don't use ffmpeg)
7691
prefer_mpv=[yes/no]
7792

93+
# Explicitly disable subtitles on the mpv sub-calls
94+
# mpv can and will by default render subtitles into the thumbnails.
95+
# If this is not what you wish, set mpv_no_sub to yes
96+
# Defaults to no
97+
mpv_no_sub=[yes/no]
98+
7899
# Enable to disable the built-in keybind ("T") to add your own, see after the block
79100
disable_keybinds=[yes/no]
80101

@@ -113,7 +134,7 @@ remote_max_delta=120
113134

114135
# Try to grab the raw stream and disable ytdl for the mpv subcalls
115136
# Much faster than passing the url to ytdl again, but may cause problems with some sites
116-
Defaults to yes
137+
# Defaults to yes
117138
remote_direct_stream=[yes/no]
118139
```
119140

0 commit comments

Comments
 (0)