Skip to content

Instantly share code, notes, and snippets.

View cdgriffith's full-sized avatar

Chris Griffith cdgriffith

View GitHub Profile
@averad
averad / Stable_Diffusion.md
Last active July 25, 2024 14:37 — forked from harishanand95/Stable_Diffusion.md
Stable Diffusion on AMD GPUs on Windows using DirectML
@TinDang97
TinDang97 / build_ffmpeg_cuda_debian
Last active May 9, 2024 07:12
Build FFMPEG script with full feature, include scale_cuda, scale_npp, vpx, libx,...
#!/bin/bash
# https://github.com/markus-perl/ffmpeg-build-script
PROGNAME=$(basename $0)
VERSION=1.18
CWD=$(pwd)
PACKAGES="$CWD/packages"
WORKSPACE="$CWD/workspace"
CFLAGS="-I$WORKSPACE/include"
@nhymxu
nhymxu / README-python-framework-benchmark.md
Last active July 3, 2024 12:28
Flask vs Falcon vs FastAPI benchmark
gunicorn run:app --workers=9
gunicorn run:app --workers=9 --worker-class=meinheld.gmeinheld.MeinheldWorker

Macbook Pro 2015 Python 3.7

Framework Server Req/s Max latency +/- Stdev
#!/usr/bin/env python
import sys
import json
import datetime
# Feed me with output of:
# ffprobe -f lavfi -i movie=INPUT.mov,ocr -show_entries frame=pkt_dts_time:frame_tags=lavfi.ocr.text -of json
input= sys.argv[1]
id = 0
old_time = '00:00:00,000'
@Brainiarc7
Brainiarc7 / ffmpeg-qsv-enabled-build-ubuntu-18.04lts-testbed.md
Last active July 14, 2024 13:29
This gist will generate an Intel QSV-enabled FFmpeg build using the open source Intel Media SDK. Testbed used: Ubuntu 18.04LTS. A fallback is also provided for the intel vaapi driver where needed.

Build FFmpeg with Intel's QSV enablement on an Intel-based validation test-bed:

Build platform: Ubuntu 18.04LTS

Ensure the platform is up to date:

sudo apt update && sudo apt -y upgrade && sudo apt -y dist-upgrade

Install baseline dependencies first (inclusive of OpenCL headers+)

@htruong
htruong / chroot-to-pi.sh
Last active July 7, 2024 08:16
Chroot to pi sd card
#!/bin/bash
# This script allows you to chroot ("work on")
# the raspbian sd card as if it's the raspberry pi
# on your Ubuntu desktop/laptop
# just much faster and more convenient
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
# make sure you have issued
@zentala
zentala / formatBytes.js
Created September 27, 2017 11:57
Convert size in bytes to human readable format (JavaScript)
function formatBytes(bytes,decimals) {
if(bytes == 0) return '0 Bytes';
var k = 1024,
dm = decimals || 2,
sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
}
// Usage:
@dvlden
dvlden / ffmpeg.md
Last active July 7, 2024 17:09
Convert video files to MP4 through FFMPEG

This is my personal list of functions that I wrote for converting mov files to mp4!

Command Flags

Flag Options Description
-codec:a libfaac, libfdk_aac, libvorbis Audio Codec
-quality best, good, realtime Video Quality
-b:a 128k, 192k, 256k, 320k Audio Bitrate
-codec:v mpeg4, libx264, libvpx-vp9 Video Codec
@figgis
figgis / parse_h265.py
Last active June 14, 2023 08:46
H.265/HEVC bitstream parser
#!/usr/bin/env python
"""
- ae(v): context-adaptive arithmetic entropy-coded syntax element. The parsing process for this descriptor is
specified in clause 9.3.
- b(8): byte having any pattern of bit string (8 bits). The parsing process
for this descriptor is specified by the return value of the function
read_bits( 8 ).
- f(n): fixed-pattern bit string using n bits written (from left to right)
from Xlib.display import Display
from Xlib import X
from Xlib.ext import record
from Xlib.protocol import rq
import time
disp = None
keysym_map = {
32: "SPACE",