def test_recoding1(): a = Theora(test_files[1]) b = TheoraEncoder(VIDEO_DIR + "/a.ogv", a.width, a.height) a.seek(time=0.75) while a.read_frame() and a.time < 0.90: A = a.get_frame_array() b.write_frame_array(A)
def convert(infile, outfile, start, end): print "converting %s to %s, between the times %d:%d" % \ (infile, outfile, start, end) a = Theora(infile) b = TheoraEncoder(outfile, a.width, a.height, quality=63) a.seek(time=start) while a.read_frame() and a.time < end: print "frame: %d, time=%f" % (a.frame, a.time) A = a.get_frame_array() b.write_frame_array(A)