Skip to content

Instantly share code, notes, and snippets.

View reidransom's full-sized avatar

Reid Ransom reidransom

View GitHub Profile
@reidransom
reidransom / gist:1286360
Created October 14, 2011 05:58
Encoding 5D to Avid MXF media
$ ffmpeg -i input.mov -vcodec dnxhd -b:v 175M -pix_fmt yuv422p -s 1920x1080 -acodec pcm_s16le -ar 48000 -ac 2 -y -threads 8 -vf "crop=in_w:in_h-8:0:0, scale=1920:1080" temp.mov
$ ffmpeg -i temp.mov -an -vcodec copy -y temp.m2v
$ ffmpeg -i temp.mov -vn -acodec pcm_s16le -y temp.wav
$ writeavidmxf --prefix clipname --film23.976 --DNxHD1080p115 temp.m2v --wavpcm temp.wav
@reidransom
reidransom / tif2dpx
Created October 19, 2011 17:15
Batch convert .tif images to .dpx images with ImageMagick
#!/bin/bash
usage()
{
cat << EOF
usage: $0 -i input_folder -o output_basename -s starting_frame
This script uses ImageMagick to convert a sequence of .tif images to .dpx
images, then rename them per Walt Disney Animation's DPX delivery specs.
@reidransom
reidransom / gist:1307639
Created October 23, 2011 17:52
Check a disk's SMART status
smartctl -l selftest /dev/da15
@reidransom
reidransom / gist:1314217
Created October 25, 2011 20:51
ffmpeg - iphone compatible libx264 preset
-vcodec libx264 -b 512k -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 0 -flags2 +mixed_refs -coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4
@reidransom
reidransom / ooextract.py
Created October 28, 2011 03:11
Convert a word doc to plain text with OpenOffice
import getopt, sys, os
#OOo_program_dir = '/Applications/OOo-dev.app/Contents/basis-link/program'
OOo_program_dir = '/Applications/OpenOffice.org 2.4.app/Contents/program'
sys.path.append(OOo_program_dir)
#os.environ['DYLD_LIBRARY_PATH'] += OOo_program_dir
import uno
from unohelper import Base, systemPathToFileUrl, absolutize
from os import getcwd
from os.path import splitext
@reidransom
reidransom / qt2dv
Created October 28, 2011 03:39
Convert a video to DV Stream in CLI with QTKit
// compile with:
// $ gcc -o qt2dv -framework Foundation -framework QTKit qt2dv.m
#import <QTKit/QTKit.h>
int main (int argc, char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSUserDefaults *args = [NSUserDefaults standardUserDefaults];
@reidransom
reidransom / batchdpx
Created November 17, 2011 01:54
batch converting folders of dpx files
#!/bin/bash
Q3="/Volumes/PROJECTS/Walt Disney Animation/11408-Mini Winnie Q3/MEDIASERVER/Xfer_Assets/From_Avid/MAWTP_Q3_INT_DPX_Delivery2"
LANG=GRK
SPOT=Best
CLOSE=89689
PRE=${SPOT}_${LANG}
waltdpx -i ${PRE}_open -o MAWTP_${PRE} -s 86400
cp -R ${PRE}_open/MAWTP_${PRE} "${Q3}/"
@reidransom
reidransom / waltdpx
Created November 17, 2011 22:14
Bash script to convert .tif sequences to .dpx sequences
#!/bin/bash
usage()
{
cat << EOF
usage: waltdpx5 -l language [-m -d -v -s -f base_folder]
This script uses ImageMagick to convert a sequence of .tif images to .dpx
images, then rename them per Walt Disney Animation's DPX delivery specs.
@reidransom
reidransom / dvdsp
Created December 8, 2011 22:06
Convert a video for use in DVD Studio Pro with ffmpeg
#!/bin/bash
# dvdsp -i inputvideo [-w]
usage()
{
cat << EOF
usage: dvdsp -i inputvideo [-w]
This script will create a .ac3 and .m2v for use with DVD Studio Pro.
@reidransom
reidransom / gist:1468351
Created December 12, 2011 17:59
Enable legacy codecs in OSX
$ qtdefaults write LegacyCodecsEnabled yes