Skip to content

Instantly share code, notes, and snippets.

View iwalton3's full-sized avatar

Izzie Walton iwalton3

View GitHub Profile
@iwalton3
iwalton3 / nvenc-yuv420p10le.md
Last active April 15, 2020 13:07
Patch in Nvenc yuv420p10le on latest ffmpeg.

These instructions will allow you to encode yuv420p10le with ffmpeg while using nvenc. Note that other pixel formats have not been tested and may be broken. I do not suggest using this as your main ffmpeg installation. You also need to install the nv-codec-headers and other dependencies as required by ./configure when building.

git clone https://github.com/FFmpeg/FFmpeg
cd FFmpeg
git apply nvenc-yuv420p10le.patch
./configure pkg_config='pkg-config --static' --prefix=/usr/local --extra-version=ntd_20150126 --disable-shared --enable-static --enable-gpl --enable-pthreads --enable-nonfree --enable-fontconfig --enable-libfreetype --enable-libass --enable-libfdk-aac  --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-filters --enable-runtime-cpudetect
make -j8
# Do not run sudo make install, just use the ffmpeg as-is.
@iwalton3
iwalton3 / fingerprint-compare2.py
Last active May 20, 2020 22:03
Chromaprint Duplicate Finder (License: MIT)
#!/usr/bin/env python3
import numpy as np
import numba
import json
@numba.jit(nopython=True)
def dist(listx: numba.types.uint32[:], listy: numba.types.uint32[:]):
covariance = 0
xlen = min(len(listx),len(listy))
if xlen < 50:
@iwalton3
iwalton3 / IPD_Adjust.py
Created July 5, 2020 13:23
Allows rapid adjustment of SteamVR IPD setting for people out of the design range of VR headsets. Just add an entry under "presets" for each user.
# IPD Adjust
# Allows rapid adjustment of SteamVR IPD setting for people out
# of the design range of VR headsets.
import json
import time
config = r"C:\Program Files (x86)\Steam\config\steamvr.vrsettings"
# Units for IPD adjustment are in mm.
presets = [
@iwalton3
iwalton3 / xrandr.lua
Last active August 15, 2020 20:53
MPV Xrandr Custom Modes - Allows auto-setting framerates like 48 fps with MPV/SVP.
-- use xrandr command to set output to best fitting fps rate
-- when playing videos with mpv.
-- From https://gitlab.com/lvml/mpv-plugin-xrandr/-/blob/master/xrandr.lua
-- Available under the terms of the GPLv2
-- You need to customize this and also install custom modes. See line 241.
utils = require 'mp.utils'
-- if you want your display output switched to a certain mode during playback,
@iwalton3
iwalton3 / jellyfin_extract_sub.py
Created March 27, 2021 04:15
Jellyfin Extract Subtitles
#!/usr/bin/env python3
# Based on https://github.com/EraYaN/jellyfin-stats
# pip3 install requests tqdm
URL = ""
API_KEY = ""
from re import sub
import requests
from tqdm import tqdm
@iwalton3
iwalton3 / pmpapi.md
Last active April 3, 2021 23:22
Plex Media Player QWebChannel API

To connect to the API:

  <script src="qrc:///qtwebchannel/qwebchannel.js"></script>
  <script>
      new QWebChannel(window.qt.webChannelTransport, function(channel) {
          // Called when API is ready
          window.channel = channel;
      });
 
@iwalton3
iwalton3 / c.sh
Created April 22, 2021 16:51
Quick "cd from anywhere" alias
function c {
while read -r _ dir
do
if [[ -e "$dir" ]]
then
echo "$dir"
cd "$dir"
break
fi
done < <(cat ~/.full_history | tail -n 10000 \
@iwalton3
iwalton3 / idx_blob.py
Last active September 6, 2021 01:38
Blob Indexer/Reassembler
#!/usr/bin/env python3
import os
import os.path
import sys
import json
import math
print("Collecting files...")
files = {}
@iwalton3
iwalton3 / boot.py
Created May 8, 2022 03:27
Window Fan Controller
# This file is executed on every boot (including wake-boot from deepsleep)
import gc
import ubinascii
def do_connect():
import network
sta_if = network.WLAN(network.STA_IF)
ap_if = network.WLAN(network.AP_IF)
if not sta_if.isconnected():
print('connecting to network...')
@iwalton3
iwalton3 / BME280.py
Created June 11, 2022 05:08
ESP8266 BME280
from machine import I2C
import time
# BME280 default address.
BME280_I2CADDR = 0x76
# Operating Modes
BME280_OSAMPLE_1 = 1
BME280_OSAMPLE_2 = 2
BME280_OSAMPLE_4 = 3