Skip to content

Instantly share code, notes, and snippets.

View iluvcapra's full-sized avatar

Jamie Hardt iluvcapra

View GitHub Profile
@iluvcapra
iluvcapra / dnx_data_rates.csv
Last active April 23, 2023 20:32
A CSV of all the allowed Avid DNxHD data rates
Resolution Frame Width Frame Height Scan Chroma Subsampling Frame Rate Megabits per second Minutes per Gigabyte
Avid DNxHD 440x 1920 1080 p yuv422p10 60/1 440 0.325
Avid DNxHD 440 1920 1080 p yuv422p 60/1 440 0.325
Avid DNxHD 290 1920 1080 p yuv422p 60/1 291 0.492
Avid DNxHD 90 1920 1080 p yuv422p 60/1 90 1.585
Avid DNxHD 440x 1920 1080 p yuv422p10 60000/1001 440 0.325
Avid DNxHD 440 1920 1080 p yuv422p 60000/1001 440 0.325
Avid DNxHD 290 1920 1080 p yuv422p 60000/1001 291 0.493
Avid DNxHD 90 1920 1080 p yuv422p 60000/1001 90 1.585
Avid DNxHD 365x 1920 1080 p yuv422p10 50/1 367 0.39
#!/bin/bash
ffmpeg -i {} -vf drawtext="fontsize=15:\
timecode='01\:00\:00\:00':rate=25:text='TCR\:':fontsize=72:fontcolor='white':\
boxcolor=0x000000AA:box=1:x=10:y=10" -vcodec prores -profile:v 0
--[[
Detect Cuts.lua
Jamie Hardt 16 Dec 2020
]]
ScriptExtKey = "COM_SQUAD51ENTERPRISES_DETECTCUTS"
FFmpegPathKey = "FFMPEG_PATH"
LastThresholdKey = "LAST_THRESHOLD"
@iluvcapra
iluvcapra / lib2flac.py
Last active October 3, 2020 22:53
lib2flac.py - Paranoid-convert your sound library to FLAC
#!/usr/local/bin/python3
"""lib2flac
Usage:
lib2flac.py [DEST] [SOURCE]...
Options:
-h --help Show this message.
"""
extension Data {
func getInteger<Value: FixedWidthInteger>(at: Int, count: Int, as: Value.Type,
bigEndian : Bool = false) -> Value {
var rawValue = Value.zero
for i in 0..<count {
let byte = withUnsafeBytes { $0.load(fromByteOffset: at + i, as: UInt8.self) }
rawValue <<= 8
rawValue ^= Value(byte)
}
struct Bitfield<Value: FixedWidthInteger> {
let value : Value
func split(widths : [Int]) -> [Value] {
var ranges = [Range<Int>]()
var at = 0
for width in widths {
let thisRange = Range(uncheckedBounds: (lower: at, upper: at + width))
ranges.append(thisRange)
at += width
@iluvcapra
iluvcapra / ptparser.py
Created October 6, 2019 04:09
Pro Tools Text Export Parser Grammar
from parsimonious.grammar import Grammar
protools_text_export_grammar = Grammar(
r"""
document = header files_section? clips_section? plugin_listing? track_listing? markers_listing?
header = "SESSION NAME:" fs field_value rs
"SAMPLE RATE:" fs field_value rs
"BIT DEPTH:" fs field_value rs
"SESSION START TIMECODE:" fs field_value rs
"TIMECODE FORMAT:" fs field_value rs
@iluvcapra
iluvcapra / Pycairo_text_arcs.py
Created August 15, 2019 17:47
Helpers to draw text arcs in Pycairo #python #cairo #pycairo
import cairo
import math
from collections import namedtuple
def warp_path(ctx, function):
first = True
for type, points in ctx.copy_path():
if type == cairo.PATH_MOVE_TO:
@iluvcapra
iluvcapra / Cmx3600.swift
Last active June 30, 2018 20:43
CMX3600 EDL parser, also auto-detects file32 form
//
// Cmx3600.swift
// EDL Scene List
//
// Created by Jamie Hardt on 6/29/18.
// Copyright © 2018 Jamie Hardt. All rights reserved.
//
import Foundation
/*
//
// SpotToProToolsOperation.swift
// Bag of Holding
//
// Created by Jamie Hardt on 12/8/14.
// Copyright (c) 2014 Jamie Hardt. All rights reserved.
//
import Cocoa
import Foundation