Archive for the ‘Video editing’ Category

Script for using ffmpeg to crop, pan and scale WMV to MOV

Monday, September 21st, 2009

I’m responsible for coordinating weekly new-functionality demos for my company’s R&D organization.  Each week, a developer or product manager presents a half-hour demo of some new functionality to a local audience in one of our offices, using a big 1920×1080 digital TV as the local display, with a GoToMeeting session set up so that people in other offices can watch the demos.  We record the GoToMeeting session, and then after the demo we publish it internally for people who weren’t able to watch it live or who want to watch it again.

A 30-minute 1920×1080 WMV is very large, like around 50MB.  We want it to be smaller before we publish it.  One way to make it smaller is to simply scale it down, but when the entire 1920×1080 canvas is shrunk down to a reasonable size, text which was perfectly legible before becomes unreadable.  Since the text is usually a crucial part of the demo, that’s unacceptable.

Usually, the presenter isn’t using the whole screen at any given time.  Rather, he’ll be focused on the content in one particular window for an extended period of time, and that window often takes up only around half of the screen.  Therefore, cropping the WMV to the active area is a possible way to the video file smaller without sacrificing legibility.  There’s just one problem — what happens when the presenter jumps around from window to window during the demo?

There are various expensive commercial video editors which will let you crop different segments of the video differently and then glom them all together into one video at the end.  However, I don’t like using commercial software when I can do it for free (this is probably about half on principle and half out of stubbornness).  Therefore, I set out to figure out how to do this with free tools.  The result is a script called wmv-to-panned-mov.pl.

This script uses the excellent free tool ffmpeg to slice and dice the input video with the appropriate cropping and produces a much smaller MOV file (i.e., QuickTime video) as its output.  You feed the script a CSV file indicating the start times, end times, and cropping areas of the various slices, and it does the rest.  There’s more information in the comment at the top of the script about how to use it.

Please comment here to let me know if you find this useful.  If the time I spent writing this script saves you some time or money, please consider sending a little something to my tip jar (but if you don’t, that’s OK too).

AVS Video Converter to the rescue

Wednesday, July 29th, 2009

I found a decent tool to solve the video conversion problem I’ve wasted days on which I complained about yesterday.

What’s amusing is that the way I found it through a Google AdSense ad that appeared alongside my complaint :-).

AVS Video Converter will convert from just about any format to just about any other format, including allowing segments of the video to be clipped during the conversion. Furthermore, it gives you complete control over all the encoding parameters in an obvious way, so you can play with them to figure out the settings that are best for you.

(more…)

Why is it so friggin’ hard to make trivial changes to a video?

Wednesday, July 29th, 2009

I’ve got a video in WMV format that was recorded from a GoToMeeting session that I hosted.

I want to chop a little off the front and a little off the end and otherwise leave the video unchanged.  I don’t want to change the format, the resolution, the compression, or anything — I just want to produce a video which is the same as the original but with a bit chopped off the beginning and end.

I’ve spent two days for a tool that will do this easily (or at all!) on either Windows or Linux.  I started out with free tools, and when none of them panned out moved onto the ones that cost money.  The two closest possibilities I’ve found are Pinnacle VideoSpin and Adobe Premiere Elements.  VideoSpin refuses to export the edited video at the same resolution as the original — it insists on shrinking it down, and I can’t figure out how to convince it not to.  Furthermore, the video produced by VideoSpin is about twice as big as the original, so it’s obviously not preserving encoding or compression.

Premiere Elements offers many different output formats but offers no guidance about which one to choose.  Furthermore, all of the combinations of export settings I chose seem to produce videos that are humongous compared to the original.

So, can anybody offer any useful suggestions for how to do what I’m trying to do?