Jeffrey McManus

The New Thing

Jeffrey McManus header image 2

Determining the Dimensions of a Video Programmatically

September 7th, 2007 · 1 Comment · Web/Tech

I know a guy who runs a web site that wants to enable users to upload video files of arbitrary sizes. We won’t be converting video, at least not at first, just letting people upload files they’ve created. The trick is, we want to let users preview the video in the browser, which means we’ll need to create an EMBED tag programmatically based on the true height and width of the video.

This problem must have come up before, but I can’t find a solution for Flash Video (.FLV). How can you determine the dimensions of a Flash Video file programmatically?

Apple provides a COM interface to QuickTime that let you do this, although it’s clunky (the interface was only intended to support the use case of creating custom clients that play QuickTime video — doing something to a video file without playing it requires some contortions). Fortunately you can run Windows Forms on the server side so it’s not impossible to get around this. But I can’t even figure out where to start with Flash Video.

Related posts:

  1. Screencast Video: Installing WordPress 3.0
  2. Comcast Blocks Most Bittorrent Traffic
  3. Tokbox: A Platform for Adding Live Video Chat to Your Web Site

Tags:

One Comment so far ↓

Leave a Comment