diff options
-rw-r--r-- | mpv/config | 40 | ||||
-rw-r--r-- | mpv/input.conf | 9 | ||||
-rwxr-xr-x | mpv/mvtools.vpy | 15 | ||||
-rw-r--r-- | mpv/scripts/convert_script.lua (renamed from mpv/lua/convert_script.lua) | 0 | ||||
-rw-r--r-- | mpv/shaders/deband.glsl | 42 |
5 files changed, 76 insertions, 30 deletions
@@ -1,32 +1,52 @@ # misc settings +title="MPV" no-osc -hwdec=vaapi -vo=opengl-hq:srgb:approx-gamma -#vo=opengl-hq:lscale=lanczos:cscale=lanczos:lradius=8.0:cradius=4.0:dither-depth=auto:temporal-dither:scaler-resizes-only:fancy-downscaling:pbo:fbo-format=rgba32f:srgb:approx-gamma -#vf=format=yuv420p,vapoursynth=/home/zephcom/.mpv/mvtools.vpy:2:4 +no-osd +no-osd-bar + +#hwdec=vaapi +#vo=vaapi + +#Mitchell +vo=opengl-hq:interpolation:tscale=mitchell:dither-depth=8:temporal-dither:pbo:target-prim=bt.709:target-trc=bt.1886:source-shader=/home/zephcom/.mpv/shaders/deband.glsl:gamma-auto + framedrop=vo -cache=262144 +cache=10000 geometry=50%:50% -autofit=1152x648 +autofit-larger=90%x90% +audio-channels=2 save-position-on-quit=yes +softvol=yes +ao=pulse +alang=en,eng,English,jpn,jap,Japanese + +ytdl +ytdl-format=bestvideo+bestaudio # Pretty srt font! +slang=en,eng,English osd-font="Liberation Sans" -sub-text-font="Liberation Sans" -sub-text-font-size=64 -sub-text-margin-y=36 +sub-text-font="Helvetica" +sub-text-font-size=38 +#sub-text-margin-y=14 sub-text-color="#ffffffff" sub-text-border-color="#ff000000" -sub-text-border-size=5.5 +sub-text-border-size=2.5 sub-text-shadow-offset=1 sub-text-shadow-color="#00000000" sub-text-spacing=-0.2 +ass-force-style=Kerning=yes +demuxer-mkv-subtitle-preroll +sub-use-margins +ass-force-margins # screenshots screenshot-format="png" screenshot-png-filter=0 screenshot-png-compression=4 +#really-quiet + # loop weebums [extension.webm] loop-file=inf diff --git a/mpv/input.conf b/mpv/input.conf index 502d7ff..1622822 100644 --- a/mpv/input.conf +++ b/mpv/input.conf @@ -1,5 +1,4 @@ -F1 set aspect 1.3333 -F2 set aspect 1.6 -F3 set aspect 1.7777 -F4 set aspect 1.85 -F5 set aspect 0 +- add volume -2 ++ add volume 2 +o ignore +F2 cycle_values video-aspect "16:9" "16:10" "4:3" "2.35:1" "-1" diff --git a/mpv/mvtools.vpy b/mpv/mvtools.vpy deleted file mode 100755 index 8fe5c5a..0000000 --- a/mpv/mvtools.vpy +++ /dev/null @@ -1,15 +0,0 @@ -import vapoursynth as vs -core = vs.get_core() - -clip = video_in - -if clip.width > 1920 or clip.height > 1080: - # Skip interpolation due to performance - clip.set_output() -else: - sup = core.mv.Super(clip, pel=2, hpad=0, vpad=0) - bvec = core.mv.Analyse(sup, blksize=16, isb=True , chroma=True, search=5, searchparam=1) - fvec = core.mv.Analyse(sup, blksize=16, isb=False, chroma=True, search=5, searchparam=1) -# clip = core.mv.BlockFPS(clip, sup, bvec, fvec, num=60, den=1, mode=3, thscd2=13) - - clip.set_output() diff --git a/mpv/lua/convert_script.lua b/mpv/scripts/convert_script.lua index 04fa508..04fa508 100644 --- a/mpv/lua/convert_script.lua +++ b/mpv/scripts/convert_script.lua diff --git a/mpv/shaders/deband.glsl b/mpv/shaders/deband.glsl new file mode 100644 index 0000000..1b2f047 --- /dev/null +++ b/mpv/shaders/deband.glsl @@ -0,0 +1,42 @@ +// vim: set ft=glsl: + +// roughly corresponds to f3kdb parameters, which this algorithm is +// loosely inspired by +#define threshold 64 +#define range 16 +#define grain 24 + +float rand(vec2 co){ + return fract(sin(dot(co.yx, vec2(12.9898,78.233))) * 43758.5453); +} + +vec4 sample(sampler2D tex, vec2 pos, vec2 tex_size) +{ + // Compute a random angle and distance + float dist = rand(pos + vec2(random)) * range; + vec2 pt = dist / image_size; + float dir = rand(pos.yx - vec2(random)) * 6.2831853; + vec2 o = vec2(cos(dir), sin(dir)); + + // Sample at quarter-turn intervals around the source pixel + vec4 ref[4]; + ref[0] = texture(tex, pos + pt * vec2( o.x, o.y)); + ref[1] = texture(tex, pos + pt * vec2(-o.y, o.x)); + ref[2] = texture(tex, pos + pt * vec2(-o.x, -o.y)); + ref[3] = texture(tex, pos + pt * vec2( o.y, -o.x)); + + // Average and compare with the actual sample + vec4 avg = cmul*(ref[0] + ref[1] + ref[2] + ref[3])/4.0; + vec4 col = cmul*texture(tex, pos); + vec4 diff = abs(col - avg); + + // Use the average if below the threshold + col = mix(avg, col, greaterThan(diff, vec4(threshold/16384.0))); + + // Add some random noise to the output + vec3 noise = vec3(rand(2*pos + vec2(random)), + rand(3*pos + vec2(random)), + rand(4*pos + vec2(random))); + col.rgb += (grain/8192.0) * (noise - vec3(0.5)); + return col; +} |