Skip to content

Commit

Permalink
Tweak ffmpeg threads
Browse files Browse the repository at this point in the history
For my CPU model, my testing shows that 4 workers 2 threads generates
thumbnails the quickest while using the least RAM. See the table below:

| Samples  |    Workers/Threads    |
| -------- | 4/8 | 4/4 | 4/2 | 8/2 |
| H.264    | 13s | 13s | 10s | 11s | - 4/2
| HEVC     | 37s | 33s | 29s | 27s | - 8/2
| VP9      | 51s | 47s | 47s | 45s | - 8/2
| AV1      | 77s | 73s | 71s | 73s | - 4/2

Note: Each sample have varied durations and resolutions, so no
conclusions regarding which video formats are easier to decode can be
drawn. They merely serves as labels.

From the table, 4/2 and 8/2 are tied as being the fastest. Picking 4/2
would be a no-brainer as it's also ligher on RAM. Keep in mind that the
default of 3 workers 8 threads performed the worst, so it's important to
tweak the workers/thread options to take full advantage of Thumbnailer.
  • Loading branch information
dexeonify committed Sep 6, 2022
1 parent 5d22824 commit 02b6f6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions mpv.conf
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,8 @@ profile-desc=Fix abnormal stuttering when using auto-copy on >4K videos
profile-cond=width >= 3840 and height >= 2160
profile-restore=copy
hwdec=auto-safe

[fast-av1-thumbnails]
profile-desc=Use mpv to generate thumbnails for AV1 videos, as it is significantly faster than ffmpeg
profile-cond=p["video-format"] == "av1"
script-opts-append=Thumbnailer-use_ffmpeg=no
4 changes: 2 additions & 2 deletions script-opts/thumbnailer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ worker_remote_factor=1
#worker_delay=1
#worker_timeout=5
#accurate_seek=yes
#use_ffmpeg=yes
use_ffmpeg=yes
#prefer_ffmpeg=yes
#ffmpeg_threads=1
ffmpeg_threads=2
#ffmpeg_scaler=spline
#ffmpeg_hwaccel=d3d11va
#ffmpeg_hwaccel_device=0
Expand Down

0 comments on commit 02b6f6e

Please sign in to comment.