Skip to main content

Getting clips from DVD

Sometimes I find howlers on DVD that I want to store. On a Mac the sequence is:
  1. Open the DVD in VLC and find out which title and chapter the clip is in.
  2. Use MacTheRipper to extract that title and chapter to .vob format
  3. Open it up in VLC, note the seconds offset for the part of the clip we want and then use File->Streaming/Export wizard to export the clip. I use H.264 (3072 kb/s) for video and MPEG-4 audio and mp4 container.
Here's an example:


The what controls what again?

Comments

  1. the sound and the video are out of sync for me. also, that's a pretty high bitrate for just DVD's. I'd imagine 1000 kbps or less would be sufficient without resizing, assuming you are actually using a good codec (x264). I've never used VLC to extract clips before, but I suppose that's what you resort to when you use a mac!

    ReplyDelete
  2. "Shorted out the left occipital lobe in his brain, which controls the ability to speak and form words."

    I love how TV shows just make stuff up, stuff that is close to right but is actually wrong.

    The occipital lobe--in the back of the head--in humans is the *visual* part of the brain. It is not thought to have much to do with language at all.

    Forming words is done by Broca's area and related structures, which are in the frontal lobe, at the front of the head. Most people use the left side to process language, though some use the right side.

    And all this is a big simplification anyway.

    ReplyDelete
  3. Ahh, but we are talking about Monk. He's different....

    ReplyDelete
  4. Killer - with all the gibberish, how can you tell? Any hoo - it was all synced up when I uploaded, I blame blogger...

    ReplyDelete

Post a Comment

Popular posts from this blog

A note on Python's __exit__() and errors

Python's context managers are a very neat way of handling code that needs a teardown once you are done. Python objects have do have a destructor method ( __del__ ) called right before the last instance of the object is about to be destroyed. You can do a teardown there. However there is a lot of fine print to the __del__ method. A cleaner way of doing tear-downs is through Python's context manager , manifested as the with keyword. class CrushMe: def __init__(self): self.f = open('test.txt', 'w') def foo(self, a, b): self.f.write(str(a - b)) def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): self.f.close() return True with CrushMe() as c: c.foo(2, 3) One thing that is important, and that got me just now, is error handling. I made the mistake of ignoring all those 'junk' arguments ( exc_type, exc_val, exc_tb ). I just skimmed the docs and what popped out is that you need to return True or...

Store numpy arrays in sqlite

Use numpy.getbuffer (or sqlite3.Binary ) in combination with numpy.frombuffer to lug numpy data in and out of the sqlite3 database: import sqlite3, numpy r1d = numpy.random.randn(10) con = sqlite3.connect(':memory:') con.execute("CREATE TABLE eye(id INTEGER PRIMARY KEY, desc TEXT, data BLOB)") con.execute("INSERT INTO eye(desc,data) VALUES(?,?)", ("1d", sqlite3.Binary(r1d))) con.execute("INSERT INTO eye(desc,data) VALUES(?,?)", ("1d", numpy.getbuffer(r1d))) res = con.execute("SELECT * FROM eye").fetchall() con.close() #res -> #[(1, u'1d', <read-write buffer ptr 0x10371b220, size 80 at 0x10371b1e0>), # (2, u'1d', <read-write buffer ptr 0x10371b190, size 80 at 0x10371b150>)] print r1d - numpy.frombuffer(res[0][2]) #->[ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] print r1d - numpy.frombuffer(res[1][2]) #->[ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] Note that for work where data ty...