Video shortening with seam carving

November 13, 2021

Sometimes TV reruns are quite noticeably sped up. They do this to fit more ads into a programming block, which is pretty shitty of the network executives.

On the other hand, it got me thinking about better ways to make a video shorter. Ideally, you would have a program to cut out parts of the video where nothing was happening, and keep the important parts intact.

I wrote a program to do that using a technique called liquid rescaling. The video on the left shows me dancing like an idiot in different parts of the frame. The video on the right was automatically generated using my program to reduce the length by 50%.


If you're interested, you can read the implementation details here. This program was written using "literate programming," in which source and explanation are woven together.

Alternatively, if you just want the source then you can download that too.

Copyright © 2020 Sal Elder