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 test_recoding2(): a = Theora(test_files[1]) b = TheoraEncoder(VIDEO_DIR + "/b.ogv", a.width, a.height) a.seek(time=0.75) while a.read_frame() and a.time < 0.90: data = a.get_frame_data() b.write_frame_data(data)
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)
def test_seek3(): t = Theora(test_files[1]) t.seek(frame=23) assert t.time > 0.75 assert t.frame == 23
def test_seek2(): t = Theora(test_files[1]) t.seek(time=0.75) assert t.time > 0.75 assert t.frame == 23