Skip to content

Instantly share code, notes, and snippets.

View hooke007's full-sized avatar
💭
working

Karl Hook hooke007

💭
working
View GitHub Profile
@agyild
agyild / FSR.glsl
Last active May 21, 2024 04:40
AMD FidelityFX Super Resolution v1.0.2 for mpv
// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
@BreadFish64
BreadFish64 / fsr_easu_expanded.comp
Created July 16, 2021 22:36
AMD FSR mpv shaders
//!DESC FSR_EASU
//!HOOK MAINPRESUB
//!BIND HOOKED
//!WIDTH OUTPUT.w
//!HEIGHT OUTPUT.h
//!COMPUTE 8 8
#extension GL_GOOGLE_include_directive : enable
#define SAMPLE_EASU 1
@KCCat
KCCat / mpv-mvtools-blksize64.py
Last active February 4, 2024 12:48
mpv-mvtools.vpy
import vapoursynth as vs
core = vs.core
clip = video_in
vfps = int(container_fps*1e8)
dfps = 60000
#dfps = 0
def ffps(fps):
rfps = int('%.0f' % fps)
if ( abs(fps - (rfps/1.001)) < abs(fps - (rfps/1.000)) ):
@bitingsock
bitingsock / cycle-adevice.lua
Last active May 17, 2024 12:24
Cycle through available audio devices with key binds(shift+a,ctrl+a). Change "wasapi" on line 1 to your relevant audio api.
local api = "wasapi"
local deviceList = mp.get_property_native("audio-device-list")
local aid = 1
local function cycle_adevice(s, e, d)
mp.enable_messages("error")
while s ~= e + d do -- until the loop would cycle back to the number we started on
if string.find(mp.get_property("audio-device"), deviceList[s].name, 1, true) then
while true do
if s + d == 0 then --the device list starts at 1; 0 means we iterated to far
s = #deviceList + 1 --so lets restart at the last device
@igv
igv / KrigBilateral.glsl
Last active April 9, 2024 07:07
Good test pattern: https://www.rtings.com/images/test-materials/2017/chroma-444.png (Compress it with any lossy codec first, for example jpeg. You can do it with mpv, only add screenshot-jpeg-source-chroma=no to mpv.conf). Usage: glsl-shader="~~/KrigBilateral.glsl"
// KrigBilateral by Shiandow
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3.0 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@haasn
haasn / image.lua
Last active May 21, 2024 21:54
mvi - set of configuration for turning mpv into an image viewer
-- Allow changing a property with by zoom-adjusted amount
function zoom_invariant_add(prop, amt)
amt = amt / 2 ^ mp.get_property_number("video-zoom")
mp.set_property_number(prop, mp.get_property_number(prop) + amt)
end
-- Resets the pan if the entire image would be visible
function zoom_check_center()
local zoom = mp.get_property_number("video-zoom")
local rot = mp.get_property_number("video-rotate") * math.pi / 180
@YamashitaRen
YamashitaRen / edi_rpow2.py
Last active December 26, 2023 19:33
Put it in Python\Lib\site-packages. Usage : import edi_rpow2 as edi \ edi.nnedi3_rpow2(clip,rfactor,...) \ edi.eedi3_rpow2(clip,rfactor,...) \ edi.eedi2_rpow2(clip,rfactor,...)
def nnedi3_rpow2(clip,rfactor,correct_shift="zimg",nsize=0,nns=3,qual=None,etype=None,pscrn=None,opt=None,int16_prescreener=None,int16_predictor=None,exp=None):
import vapoursynth as vs
core = vs.get_core()
def edi(clip,field,dh):
return core.nnedi3.nnedi3(clip=clip,field=field,dh=dh,nsize=nsize,nns=nns,qual=qual,etype=etype,pscrn=pscrn,opt=opt,int16_prescreener=int16_prescreener,int16_predictor=int16_predictor,exp=exp)
return edi_rpow2(clip=clip,rfactor=rfactor,correct_shift=correct_shift,edi=edi)
def znedi3_rpow2(clip,rfactor,correct_shift="zimg",nsize=0,nns=3,qual=None,etype=None,pscrn=None,opt=None,int16_prescreener=None,int16_predictor=None,exp=None):