Skip to content

Instantly share code, notes, and snippets.

View PierceLBrooks's full-sized avatar
🇵🇸

Pierce Brooks PierceLBrooks

🇵🇸
View GitHub Profile
@PierceLBrooks
PierceLBrooks / h26x_sei_uuid.csv
Last active April 17, 2025 00:33
H264 & H265/HEVC Unregistered User Data SEI NAL UUIDs
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 3 columns, instead of 2 in line 5.
"UUID","Description","References"
"17ee8c60-f84d-11d9-8cd6-0800200c9a66","Used to store information about the status of capture hardware like cameras","https://www.exiftool.org/TagNames/H264.html#MDPM"
"4d495350-6d69-6372-6f73-656374696d65 (""MISPmicrosectime"")","Indicates a payload containing a one byte flag and then a timestamp as dictated by the MISB (Motion Imagery Standards Board)'s MISP (Motion Imagery Standards Profile)","https://nsgreg.nga.mil/doc/view?i=4500 https://github.com/WestRidgeSystems/jmisb/issues/102"
"a8687dd4-d759-3758-a5ce-f0338b6545f1","Same as ""4d495350-6d69-6372-6f73-656374696d65"", but for H265/HEVC instead of H264","https://nsgreg.nga.mil/doc/view?i=4500"
"47564adc-5c4c-433f-94ef-c5113cd143a8","Appears in the first emitted blob of non-AVCC packet buffer data from the VideoToolbox framework's H264 encoding facilities in the Apple product ecosystem","https://developer.apple.com/forums/thread/778196"
"05fbc6b9-5a80-40e5-a22a-ab4020267e26","An extension from Microsoft for RTP streams"
import cv2
import mediapipe as mp
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
mp_hands = mp.solutions.hands
# For webcam input:
cap = cv2.VideoCapture(0)
with mp_hands.Hands(
model_complexity=0,
<!-- DTD for XML Schema Definition Language Part 1: Structures
Public Identifier: "-//W3C//DTD XSD 1.1//EN"
Official Location: http://www.w3.org/2009/XMLSchema/XMLSchema.dtd -->
<!-- Id: structures.dtd,v 1.1 2003/08/28 13:30:52 ht Exp -->
<!-- With the exception of cases with multiple namespace
prefixes for the XSD namespace, any XML document which is
not valid per this DTD given redefinitions in its internal subset of the
'p' and 's' parameter entities below appropriate to its namespace
declaration of the XSD namespace is almost certainly not
a valid schema document. -->
{
"Assertives": [
"asserting",
"claiming",
"affirming",
"stating",
"denying",
"disclaiming",
"assuring",
"arguing",
// https://hbfs.wordpress.com/2013/12/10/the-speed-of-gcd/
/*
g++ ./the-speed-of-gcd.cpp -static-libstdc++ -std=c++11 -pthread -O3 -o ./the-speed-of-gcd
./the-speed-of-gcd
1000 3.3428e-05 5.77788e-05 3.3541e-05 6.12842e-05 3.4811e-05
1000 1.90322e-05 3.82361e-05 1.8979e-05 4.174e-05 1.99548e-05
1000 1.83879e-05 3.77061e-05 1.85562e-05 4.1613e-05 1.97229e-05
1000 1.8762e-05 3.7532e-05 1.84731e-05 4.12971e-05 1.89309e-05
1000 1.88318e-05 3.774e-05 1.82791e-05 4.15129e-05 1.88972e-05
@PierceLBrooks
PierceLBrooks / gcdbenchmarks.cpp
Created February 18, 2024 18:59 — forked from jzakiya/gcdbenchmarks.cpp
gcd implementation comparison benchmarks in C++
// Daniel Lemire in this article
// https://lemire.me/blog/2013/12/26/fastest-way-to-compute-the-greatest-common-divisor/
// presented benchmark comparisons of different implementations of Stein's (binary) gcd algorithm.
// The wikipedia (iterative) implementation of the algorithm was noted to be very inefficient.
// Lemire presented benchmarked comparisons of various implementations, original code below.
// https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/blob/master/2013/12/26/gcd.cpp
// I have modified the output to make it explicit and clear, modified the code in some functions
// to make them easier to follow and standardized variable names, and added the Ruby implementation.
// I also ordered the ouput to show fastest to slowest.
// The results: gcdwikipedia7fast32 is fastest by far; the implementation shown in widipedia is slowest.
extends Node3D
# Called when the node enters the scene tree for the first time.
func _ready():
var state = GLTFState.new()
var document = GLTFDocument.new()
var error = document.append_from_file("res://untitled.gltf", state)
if (error != OK):
print(str(error))
@PierceLBrooks
PierceLBrooks / PicDelVid.py
Created August 14, 2023 18:59
Artifical Lag Inducer Effect
# Title = Picture-Delta-Video
# Author = Pierce Brooks
# Usage = `python3 ./PicDelVid.py ./MyMP4.mp4`
# Reference = https://towardsdatascience.com/head-pose-estimation-using-python-d165d3541600
import cv2
import sys
import os
import numpy as np
@PierceLBrooks
PierceLBrooks / castanet.sh
Created June 20, 2023 20:59 — forked from interfect/castanet.sh
Set up a Chromecast from a Linux PC, without an Android or iOS mobile device and without Google Home
#!/usr/bin/env bash
# castanet.sh: Script to connect a chromecast to a WiFi network.
#
# Allows you to put your Chromecast on WiFi and do Chromecast initial setup
# without using the Google Home app at all, just using a normal Linux computer.
#
# You do need your Chromecast to be on Ethernet, or (untested) to join its setup WiFi
# network with your PC, and you also need to find out its IP yourself with e.g.
# Wireshark.
"use strict";
var http = require('http');
var url = require('url');
var fs = require('fs');
var mimetypes = {
'.dvb' : 'application/dvbsubs',
'.srt' : 'application/x-subrip',