Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve the step of decoding #49

Merged
merged 2 commits into from
Oct 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Hover on the timeline for nice thumbnails.
`spawn_first`: Spawn thumbnailer on file load for faster initial thumbnails. Defaults to no.
`network`: Enable on remote files. Defaults to no.
`audio`: Enable on audio files. Defaults to no.
`hwdec`: Enable hardware decoding. Defaults to no.
`use_lua_io`: Windows only: write directly to pipe (requires LuaJIT). Should improve performance, ymmv.

## For UI developers: How to add thumbfast support to your script
Expand Down
3 changes: 3 additions & 0 deletions thumbfast.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@ network=no
# Enable on audio playback
audio=no

# Enable hardware decoding
hwdec=no

# Windows only: don't use subprocess to communicate with socket (warning: blocks, might cause hangs)
use_lua_io=no
7 changes: 6 additions & 1 deletion thumbfast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ local options = {
-- Enable on audio playback
audio = false,

-- Enable hardware decoding
hwdec = false,

-- Windows only: don't use subprocess to communicate with socket
use_lua_io = false
}
Expand Down Expand Up @@ -284,12 +287,14 @@ local function spawn(time)

remove_thumbnail_files()

local mpv_hwdec = "no"
if options.hwdec then mpv_hwdec = "auto" end
local args = {
"mpv", path, "--no-config", "--msg-level=all=no", "--idle", "--pause", "--keep-open=always", "--really-quiet", "--no-terminal",
"--edition="..(mp.get_property_number("edition") or "auto"), "--vid="..(mp.get_property_number("vid") or "auto"), "--no-sub", "--no-audio",
"--start="..time, "--hr-seek=no",
"--ytdl-format=worst", "--demuxer-readahead-secs=0", "--demuxer-max-bytes=128KiB",
"--vd-lavc-skiploopfilter=all", "--vd-lavc-software-fallback=1", "--vd-lavc-fast",
"--vd-lavc-skiploopfilter=all", "--vd-lavc-software-fallback=1", "--vd-lavc-fast", "--vd-lavc-threads=2", "--hwdec="..mpv_hwdec,
"--vf="..vf_string(filters_all, true),
"--sws-allow-zimg=no", "--sws-fast=yes", "--sws-scaler=fast-bilinear",
"--video-rotate="..last_rotate,
Expand Down