Skip to content

Instantly share code, notes, and snippets.

View CasualDev242's full-sized avatar

QWERTY CasualDev242

View GitHub Profile
@majal
majal / minterpolate
Last active February 8, 2025 20:57 — forked from sgqy/minterpolate.sh
Multi-threaded minterpolate in ffmpeg
#!/bin/bash
# Multicore minterpolate in ffmpeg
# Just slice & process & concat
# NB: The concat points between slices may be weird
# Default arguments
ff=/usr/bin/ffmpeg
fps=60
dur=00:00:10
@nico-lab
nico-lab / av1_nvenc.txt
Last active March 2, 2025 21:42
ffmpeg -h encoder=av1_nvenc
Encoder av1_nvenc [NVIDIA NVENC av1 encoder]:
General capabilities: dr1 delay hardware
Threading capabilities: none
Supported hardware devices: cuda cuda d3d11va d3d11va
Supported pixel formats: yuv420p nv12 p010le yuv444p p016le yuv444p16le bgr0 bgra rgb0 rgba x2rgb10le x2bgr10le gbrp gbrp16le cuda d3d11
av1_nvenc AVOptions:
-preset <int> E..V....... Set the encoding preset (from 0 to 18) (default p4)
default 0 E..V.......
slow 1 E..V....... hq 2 passes
medium 2 E..V....... hq 1 pass
/*=============================================================================
ReShade 5 effect file
github.com/martymcmodding
Author: Pascal Gilcher / Marty McFly
ReShade Motion Estimation Shader for dense 2D UV-space motion vectors
Based on ReShade Motion Estimation by Jakob Wapenhensch
(https://github.com/JakobPCoder/ReshadeMotionEstimation)
@FeodorVolguine
FeodorVolguine / pbr.glsl
Last active March 25, 2024 14:30
Physically Based Shading
//Normal distribution function (Trowbridge-Reitz GGX)
float DistributionGGX(float NdotH, float alpha2)
{
float f = (NdotH * alpha2 - NdotH) * NdotH + 1.0f;
return alpha2 / (f * f * PI);
}
//Height-correlated Smith-GGX visibility function
float VisibilitySmithGGX(float NdotL, float NdotV, float alpha2)
{
@totallyRonja
totallyRonja / oklab.hlslinc
Created March 24, 2021 13:47
OkLab color conversion functions for hlsl
static const float3x3 lrgb2cone = {
0.412165612, 0.211859107, 0.0883097947,
0.536275208, 0.6807189584, 0.2818474174,
0.0514575653, 0.107406579, 0.6302613616,
};
static const float3x3 cone2lab = {
+0.2104542553, +1.9779984951, +0.0259040371,
+0.7936177850, -2.4285922050, +0.7827717662,
+0.0040720468, +0.4505937099, -0.8086757660,
@fritschy
fritschy / ffmpeg-one-liners.sh
Last active September 7, 2024 01:27
ffmpeg one-liners
# For all snippets, check documentation for details and settings.
# encode video from a V4L2 device, using specified settings.
# x265 worked somewhat better here and produced less skips (although uses 10x CPU compared to x264)
ffmpeg -f video4linux2 -framerate 30 -input_format mjpeg -video_size 1920x1080 -i /dev/video6 -c:v libx265 -preset ultrafast -c:a none -crf 20 out.mp4
# Convert a raw YUYV422 frame from my USB "microscope" to PNG:
# other valid pixel formats are e.g. rgb24 or yuv420p
ffmpeg -f rawvideo -video_size 2592x1944 -pixel_format yuyv422 -i input_yuyv422_2592x1944.dat -f image2 output.png
@mebiusbox
mebiusbox / GotandaOrenNayar.brdf
Created September 8, 2017 14:24
GGX Oren-Nayar for BRDF Explorer
analytic
# variables go here...
# only floats supported right now.
# [type] [name] [min val] [max val] [default val]
::begin parameters
float roughness 0 1 1
float f0 0 1 0.04
::end parameters