Uploading and Displaying Video


I’m pitching for a site where they need to upload video, and it’s not something I’ve tried before.

Any suggestions?



There are a couple of issues that need to be addressed here.

  1. Uploading large files. There can be challenges here.
  2. Video format conversion. This isn’t something I’ve ever done. You might want to figure out how or if you are going to do this. I usually use flv to display video, but the clients format could be in any format.

If its appropriate for your client, Youtube is a shortcut you can sometimes take.

Will they be uploading videos that are already encoded? If not, you will have to handle the encoding on the server side. I think what you will be looking for (server side) is called ffmpeg, I may be spelling that wrong…?

If they are encoding the videos pre-upload then your job is MUCH easier. You will just need to upload the file and store it’s pointer in a database.

Video encoding (server side) is VERY processor intensive and takes quite a while. So you’re going to have to have either a dedicated server just for handling the video (serving and encoding). or if the site itself is low traffic you may be able to get by with just using one server for the whole thing.

Thanks for the replies.

The server side encoding option sounds a bit challenging, I’m not sure what hosting arrangements have been made, but I very much doubt that it’s a dedicated server.

Any idea what’s involved when encoding pre-upload? And what would this do to the file size (piece of string question, I expect).



encoding pre-upload can be done by various programs. I would personally recommend Sorenson Squeeze. It’s not the cheapest solution but I prefer it. Also there is an encoder packaged with Flash that is decent (although I haven’t used it in years).

Encoding video is tricky… it’s more of an art than science (although there is science involved lol). The trick is getting one encoder setting that makes your video look good and keeps the file size to something manageable. Once you get an encoder preset worked out for them you would basically hand it over to the client, then it’s basically a drag-drop and start process. Then depending on the video length the video will encode, then they can upload it.

I encode video on a VERY regular basis. Getting started you need to know a few things about your source video.

  1. Is the source Interlaced? If it is, you need to de-interlace it while encoding.

  2. What is the frame rate? You will need to match or divide this source framerate when encoding.

  3. What size is the video? When encoding you can go smaller but NOT larger. You should only go smaller by factors of 16 to maintain quality.

  4. Is the video NTSC or PAL?

  5. You need to keep the aspect ratio the same as the source but you can crop to change the ‘feel’ of the video.

Hopefully these will help get you started. If you don’t know the terms above google them and read up. You could write a book about each line item above :smiley:

For encoding, unless you’re doing high volume, probably better to use a 3rd party service/API e.g encoding.com/heywatch.com
Saves all the headaches pointed out above