Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
def test_write_frame_image():
    img = Image.fromarray(lena()).convert("RGB")
    b = TheoraEncoder(VIDEO_DIR+"/b.ogv", img.size[0], img.size[1])
    b.write_frame_image(img)