Skip to content

Instantly share code, notes, and snippets.

View kevinkirkup's full-sized avatar

Kevin S Kirkup kevinkirkup

  • Digital Realty Trust
  • Raleigh, NC
View GitHub Profile
@kevinkirkup
kevinkirkup / gist:3673925
Created September 8, 2012 11:32
Rubyx Choice parameter block
require 'choice'
# Choice Block for argument definition
Choice.options do
header 'Application options:'
option :template, :required => true do
short '-t'
long '--template=TEMPLATE'
desc 'The path to the preset settings template'
@kevinkirkup
kevinkirkup / gist:3674112
Created September 8, 2012 11:46
Pythonx - argparse example
import argparse
##################################################
# Create the argument parser
# http://docs.python.org/dev/library/argparse.html
##################################################
parser = argparse.ArgumentParser(description="Parse arguments")
parser.add_argument("input_file", action="store", help="File to read", metavar="INFILE")
parser.add_argument("output_file", action="store", default="output.txt", help="File to write", metavar="OUTFILE")
@kevinkirkup
kevinkirkup / gist:3674134
Created September 8, 2012 11:51
Rubyx - Array natural number sorting
##################################################
# Add natural number sorting to arrays
##################################################
class Array
# Method which sort an array composed of strings with embedded numbers by
# the 'natural' representation of numbers inside a string.
def natcmp
reg_number = /\d+/
@kevinkirkup
kevinkirkup / gist:3674147
Created September 8, 2012 11:53
FFMPEGx - Dump MpegTS file timestamp information to the console
ffmpeg -debug_ts -re -copyts -i <intput_ts> -f null out.null
@kevinkirkup
kevinkirkup / gist:3674168
Created September 8, 2012 11:54
FFMPEGx - UDP Broadcast MpegTS file
ffmpeg -re -copyts -i <input_ts> -f mpegts -c copy udp://localhost:4567
@kevinkirkup
kevinkirkup / gist:3674206
Created September 8, 2012 12:00
FFMPEGx - output video frames as a sequence of bitmap images
ffmpeg -i <input_file> -f image2 "img-%03d.bmp"
@kevinkirkup
kevinkirkup / gist:3674223
Created September 8, 2012 12:02
FFMPEGx - Create a movie from a sequence of jpeg images
ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi
@kevinkirkup
kevinkirkup / gist:3674231
Created September 8, 2012 12:03
FFMPEGx - Output Packet information from a TS File
ffprobe -i <input file> -sexagesimal -show_packets -print_format compact > output.log
@kevinkirkup
kevinkirkup / gist:3674248
Created September 8, 2012 12:05
FFMPEGx - Output the frame information in compact format from the specified video file
ffprobe -show_frames -pretty -print_format compact <input file>
@kevinkirkup
kevinkirkup / gist:3674259
Created September 8, 2012 12:07
FFMPEgx - Re-encode the audio and video of specific tracks from the input video file, copy the second audio track
ffmpeg -i <input> -map 0:v -vcodec copy -map 0:1 -c:a:0 libfaac -b:a 384k -map 0:1 -c:a:1 copy <output>