Skip to content

Instantly share code, notes, and snippets.

View ggnull35's full-sized avatar
💭
Bug fix for life

Domo ggnull35

💭
Bug fix for life
View GitHub Profile
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 7, 2024 13:22
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@Quazistax
Quazistax / fixGitSymlinksOnWin.bat
Last active December 21, 2023 03:54
Batch script for converting Git symlink files to Windows file symlinks
@echo.
@echo For converting Git symlink files to Windows file symlinks.
@echo * Run in repository root as Administrator.
@echo * Handling of folder symlinks is not implemented.
@echo * Intended for windows versions Vista and above (Win 7,8)
@echo.
@echo Thanks to: http://stackoverflow.com/a/5930443/1031870
@echo v1.02 (c) 2015 Robert Benko (Quazistax), License: MIT
@echo.
From c259a69c7e75f29d45fd0bbf47899d15e71e2e79 Mon Sep 17 00:00:00 2001
From: Llorx <dallorx@gmail.com>
Date: Sat, 6 Aug 2016 14:34:50 +0200
Subject: [PATCH] Bitrate on-the-fly PoC
---
ffmpeg.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 74 insertions(+), 1 deletion(-)
diff --git a/ffmpeg.c b/ffmpeg.c
@yohhoy
yohhoy / isobmff.md
Last active December 12, 2023 14:27
ISO Base Media File Format

AAC

ISO/IEC 14496-3, 1.6.2.1 AudioSpecificConfig

AudioSpecificConfig() {
	audioObjectType = GetAudioObjectType();
	samplingFrequencyIndex; // 4 bslbf
	if (samplingFrequencyIndex == 0xf) {
		samplingFrequency; // 24 uimsbf
	}
@Brainiarc7
Brainiarc7 / transient-clustering-gnu-parallel-sshfs.md
Last active April 21, 2024 05:16
How to set up a transient cluster using GNU parallel and SSHFS for distributed jobs (such as FFmpeg media encodes)

Transient compute clustering with GNU Parallel and sshfs:

GNU Parallel is a multipurpose program for running shell commands in parallel, which can often be used to replace shell script loops,find -exec, and find | xargs. It provides the --sshlogin and --sshloginfile options to farm out jobs to multiple hosts, as well as options for sending and retrieving static resources and and per-job input and output files.

For any particular task, however, keeping track of which files need to pushed to and retrieved from the remote hosts is somewhat of a hassle. Furthermore, cancelled or failed runs can leave garbage on the remote hosts, and if input and output files are large, sending them to local disk on the remote hosts is somewhat inefficient.

In a traditional cluster, this problem would be solved by giving all nodes access to a shared filesystem, usually with NFS or something more exotic. However, NFS doesn't wo

@nickkraakman
nickkraakman / ffmpeg-cheatsheet.md
Last active April 23, 2024 20:53
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
@Brainiarc7
Brainiarc7 / ffmpeg-qsv-enabled-build-ubuntu-18.04lts-testbed.md
Last active May 30, 2024 08:45
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+)

@martinpickett
martinpickett / HDRCopy.sh
Last active July 5, 2023 06:54
Bash script to copy HDR10 metadata from source to a transcode.
#!/bin/bash
# Pre-defined RGB & WP values for BT.2020
BT2020_xW=0.3127
BT2020_yW=0.3290
BT2020_xR=0.708
BT2020_yR=0.292
BT2020_xG=0.17
BT2020_yG=0.797
BT2020_xB=0.131