Skip to content

Instantly share code, notes, and snippets.

View sturmen's full-sized avatar

Nicholas Tinsley sturmen

  • Meta Platforms, Inc
  • New York, NY
  • 04:13 (UTC -05:00)
View GitHub Profile
@sturmen
sturmen / Anamorphic DeSqueeze Tool - MAC OS - Rupert Warries.zsh
Created November 20, 2025 17:20
ZSH script to apply anamorphic desqueeze to still photos
#!/bin/bash
# Change to the directory where the script is located
cd "$(dirname "$0")"
# Clear the terminal screen
clear
# Tool Intro Text
echo -e "\033[1mAnamorphic DNG EXIF DeSqueeze for Exiftool - written by Rupert Warries for MAC OS\033[0m\n\n\033[1m------------ \033[0m\n\nThis Tool will rewrite each DNG's EXIF data to allow Lightroom to render each image de-squeezed in DEVELOP module (library will still show squeezed image - any program that reads the pixel ratio in EXIF will also work)."
echo -e "\n\nUSAGE INSTRUCTION :\n1. Place this script from inside the folder containing the DNG images for processing\n2. Drag tool into a terminal window to run and follow the prompts\n3. DNG filenames must contain no spaces - run the tool by dragging into a terminal window and following the prompts\n4. an installation of Exiftool must be present for this script to operate\n\n\033[1m------------ \033[0m"
@sturmen
sturmen / ffmpeg_hdr_commands_cheat_sheet.md
Created March 26, 2025 12:28
FFMpeg HDR Command Cheat Sheet

Manipulating HDR Footage with FFMpeg

There's not a lot of obvious documentation about how to work with non-SDR color spaces and transfer functions, especially for fixing issues. That's where this gist comes in.

Fixing an improperly tagged MOV File

This changes the metadata, losslessly fixing the improperly tagged file so that you don't have to re-encode.

ffmpeg -hide_banner -i input.mov -movflags write_colr+write_gama -c:v copy -colorspace 9 -color_primaries 9 -color_trc 16 -map_metadata 0 -c:a copy -movflags +faststart output.mov
@sturmen
sturmen / FFmpeg Commands.md
Last active September 29, 2025 15:12
Useful ffmpeg Commands

Useful FFmpeg Commands

Often we use ffmpeg commands that have esoteric or unmemorizable options. This is my dumping grounds for all the ones I need to remember somewhere. I am posting this publicly in the hope that it can help other people. If anyone has specific questions/suggestions/improvements for a command, please comment. If you're seeking help creating your own ffmpeg command, I recommend using ChatGPT. It may be bad at math, but it's actually really good at coming up with CLI usages, and even writing quick scripts for their use.

Video

Lossless Transcoding For Archive (plus lossy for viewing) [REQURIES NVIDIA GPU]

Encode a video losslessly for archiving and as a deinterlaced H.264+AAC file for viewing. This was designed for taking the uncompressed (!) Quicktime MOV output of Blackmagic Media Express and shrinking it to something more manageable for archiving as well as viewing. Note the "seek

@sturmen
sturmen / .inputrc
Created December 17, 2018 00:20
the two most important lines any terminal user should have in their configuration
"\e[A": history-search-backward
"\e[B": history-search-forward
@sturmen
sturmen / config.txt
Last active January 23, 2024 15:42
Nick's youtube-dl Config File
# nick's yt-dlp config
--write-auto-sub
--embed-subs
--embed-metadata
--embed-chapters
# requires https://github.com/QuantumWarpCode/yt-dlp-dearrow
--use-postprocessor DeArrow:when=pre_process
--sponsorblock-remove sponsor,selfpromo
--prefer-free-formats
-o %(uploader)s-%(title)s[%(resolution)s].%(ext)s
@sturmen
sturmen / my-ublock-static-filters.txt
Last active November 28, 2018 18:48
sturmen's uBlock Origin filters
androidpolice.com###comment-policy
twitter.com##.js-wtf-module
facebook.com###homepage_panel_pagelet
##[id^="ac-lre-player-ph"]
##[class$="recvontent"]
slickdeals.net##.fpGridBox:has-text(Bank Advertiser)
### Keybase proof
I hereby claim:
* I am sturmen on github.
* I am sturmen (https://keybase.io/sturmen) on keybase.
* I have a public key ASD9flhSNpM6cHMBocIgZZeR9fpdXZHMb72sPq8u6QqD_wo
To claim this, I am signing this object:
@sturmen
sturmen / mp4_to_webm.sh
Created May 12, 2017 18:15
Conversion Script from MP4 to WebM in good quality
#!/bin/sh
set -ex
for i in *.mp4; do
ffmpeg -y -i "$i" -c:v libvpx-vp9 -pass 1 -b:v 2M -crf 30 -threads 8 -speed 4 \
-pix_fmt yuv420p -tile-columns 6 -frame-parallel 1 \
-an -f webm /dev/null
ffmpeg -i "$i" -c:v libvpx-vp9 -pass 2 -b:v 2M -crf 30 -threads 8 -speed 2 \