Skip to content

Instantly share code, notes, and snippets.

View onyx-nxt's full-sized avatar
💭
Probably Coding something... What else?

Onyx onyx-nxt

💭
Probably Coding something... What else?
View GitHub Profile
@onyx-nxt
onyx-nxt / fix-sync.lua
Last active December 26, 2025 09:59
MPV script that fixes video sync on some broken videos where both the audio and video PTS are incorrect by a constant factor. This is appearent on some videos exported from Topaz VEAI from the looks of it. This essentially works by measuring how much frames drop due to display sync and calculating the correct video fps and changes it via the set…
local mp = require 'mp'
function fix_sync()
-- Capture the first snapshot
local start_dropped = mp.get_property_number("mistimed-frame-count") or 0
local fps = mp.get_property_number("container-fps") or 0
if fps == 0 then return end
mp.add_timeout(1, function()
-- Capture the second snapshot
@onyx-nxt
onyx-nxt / ConvertAndroidScreenshotToWinScreenshotFormat.ps1
Created October 4, 2025 03:11
Converts Android's screenshot filename format (Screenshot_YYYYMMDD_HHMMSS_AppName) to match the Windows Snipping Tool format (Screenshot YYYY-MM-DD HHMMSS) while preserving file timestamps.
$folderPath = "C:\Path\To\Directory"
# Process matching screenshot files
Get-ChildItem -Path $folderPath -Filter "Screenshot_*.png" | ForEach-Object {
$fileName = $_.BaseName
# Match Screenshot_YYYYMMDD_HHMMSS and extract timestamp
if ($fileName -match '^Screenshot_(\d{8})_(\d{6})') {
$date = $matches[1]
$time = $matches[2]
@onyx-nxt
onyx-nxt / getAllDllFilesInDirectoryAndThenReturnAllOfTheirPathsUsingForwardSlashesAndDirectoriesTwoLevelsUpAreReplacedByAPeriodInOneStringByJoiningThemTogetherByAnAsterisk.ps1
Created July 22, 2023 02:16
Get all dll files in a directory and then return all of their paths using forward slashes and directories two levels up are replaced by a period in one string by joining them together by an asterisk
# Get all DLL files in the specified directory and its subdirectories
$directory = "C:\your\directory\path"
$dllFiles = Get-ChildItem -Path $directory -Filter "*.dll" -File -Recurse
# Convert the paths to forward slashes and replace directories two levels up with a period
$paths = $dllFiles | ForEach-Object {
$relativePath = $_.FullName -replace '^(.*)\\(\w+)\\(\w+)\\(.+)$', '.\$3\$4'
$relativePath = $relativePath -replace "\\","/"
$relativePath
}