Skip to content

Instantly share code, notes, and snippets.

@cbhl
cbhl / video_trimmer.py
Created October 13, 2012 21:50
Trimming a video in Python
from subprocess import Popen, PIPE, STDOUT
import subprocess
import math, sys
from time import sleep
from os import path, access, W_OK, R_OK, F_OK
def cut(movie, start, clip):
subprocess.Popen(["ffmpeg", #Calls ffmpeg program
"-ss",str(start), #Begining of recording, must be string
"-t", '30', #How long to record clip for, must be a string
@cbhl
cbhl / progtest.sh
Created October 8, 2012 23:29 — forked from jlfwong/progdiff.sh
Diff the stdout, stderr and return code of a program with known stdout, stderr, and return code
#!/bin/bash
# CS 343 - A#Q# Test Script
# by m9chang
# based on progtest.sh by m9chang
# based on progdiff.sh by jlfwong (available at https://gist.github.com/3829517)
retval1=0 retval2=0 retcode=0
# Method: run