Thursday, December 18, 2008

User Generated Video Workflows

The explosion of YouTube and user generated video (UGV) have introduced a new kind of workflow in the video space. Its popularity really got started with American Funnies Home Videos, where the public would submit a video to compete in a contest for the funniest video. The show is still on the air and enjoys great ratings. In its origins, the public would send their videos in the mail in the form of a video tape, a DVD, and now a digital file through the internet.

Today, videos are sent to a plethora of video aggregators and sharing sites that collect in mass from the public. Further, video sharing sites are not only interested in funny videos, but also serve as outlets for independent news, video productions, viral marketing and promotions among other uses.

A typical UGV work flow is described in the figure below.



Today users, the public, create videos using many different devices such as mobile phones, DV Cameras or WebCams and store these videos on tape or digital files. They use many different video tools across platforms to extract their videos from their devices or tapes and then send them to a video site. These videos are then stored and processed to meet the video site’s streaming server’s specifications. Videos are then made available for viewers to download or stream.

To limit bandwidth and storage use, users are asked to limit the size of the video file they are submitting. Some video sharing sites have a file limit of 100MB others go as high as 2GB. Video encoding parameters can be adjusted to generate a file of a particular size using the formula below.

(videoBitrate+audioBitrate)=(fileSizeLimit*8)/videoDuration

Just fix the audio bit rate to 64 kilo bits per second (Kbs), or a higher value if you would like better audio quality, and you can obtain the video bit rate settings.
For example:

A video sharing site has a 100MB file size limit and my video is 10 minutes long. I set my audio bit rate to 64 Kbs. The video bit rate setting should then be:

(100MB*8bits)/(10min*60sec)- 64000bps=1269.3Kbs

Although there is nothing magical about the above formula, most users will have a hard time doing all the unit conversions required to figure out the parameters. In my experience, users produce files smaller than the file restriction through trial an error. Besides the video and audio bit rate settings on the encoding software, frame size or resolution has a great impact in video quality and size. The smaller the resolution or picture size the smaller the file size. Lossy encoders will not necessarily allocate more bandwidth (larger bit rate) if the picture is small because there is simply not enough data in the resulting picture. (In my opinion, resizing images should be avoided using consumer applications as it may degrade the quality of the video tremendously. )

Users send the resulting video file to the video sharing site where it is stored and usually it is reviewed for content. Videos are then sent to a queue in video aggregator’s Transcoding system where it eventually gets converted and posted for streaming or user download.

An alternative way of processing user generated videos is through a distributed encoding application as illustrated below:



The most prominent competitors in this space are On2’s flix publisher, Framecaster’s iNCoderPro, Sorenson Squish and the late VideoEgg. These systems allow the video sharing site or aggregator to set up a file format and video setting to receive videos through a web plug-in or widget embedded in their submission page. The plug-in or widget is really a video encoder that processes the user’s video to the video aggregator’s specifications. This option can improve the resulting video quality as videos are transcoded from the original source. This systems offer a varying degree of device support. From no device support to Webcam, and DVCam support as in the case of VideoEgg and Squish, but the only product that also supports mobile phones via Bluetooth is iNCoderPro. The supported video formats also vary. Flix Publisher and VideoEgg only support. VP6 (flash 8). Squish only outputs Flash video (maybe the Spark codec or flash 7. It’s not clear on the Sorenson website,) iNCoderPro supports VP6, h.264, MPEG4, MPEG2, Windows Media and 3GP (Try it for free at www.compressmyvideos.com.)

This alternative kind of workflow for UGV has many advantages for both the user and the video sharing site such as:
  1. Better user experience as users are not required to use third video tools.
  2. Better video quality as videos are converted from the original video and the right settings are applied automatically by the software.
  3. Minimizes the need for an in-house Transcoding system.
  4. Saves bandwidth as smaller video files are sent to the aggregator.
  5. Saves storage space as only one file is stored.
  6. Less time to post as videos don’t need to go through a queue to be formatted for streaming.
  7. Self scalable Transcoding. Video sharing sites won’t have to worry about increasing their Transcoding capacity for higher volumes.
  8. Lower startup cost for video sharing sites as they don’t have to buy hardware and only minimal programming or scripting is required.

Next time I will discuss Generation Loss and how to minimize it.

Thursday, December 11, 2008

Transcoding Automation

Below are some of the most important questions and concepts you need to keep in mind when designing or choosing a video Transcoding system. They are described in general terms and more detail is needed to really optimize a Transcoding system for your particular workflow. Keep in mind that there are systems that require some level of programming or scripting and that might have a big impact on your budget.

In deciding how to automate your video Transcoding workflow, you should ask your self the following questions:

1) What is the volume of videos you need to process?

2) How fast do you need the output videos?

3) Where do the input videos reside? (Single or multiple locations.)

4) What is the input format(s)? (Device, file format.)

5) What is the output file format(s)?

6) Where do you need to deliver the output videos?


The answer to the first couple of questions will help you determine how large and complex your system is going to be. If your volume is very low, from 1 to a couple of dozen videos a week, you could set up a simple software-based, batch encoding system in a single computer. As your video demands begin to grow, you could batch process the videos in more than one computer, and manage the queue manually.

There is a point where manually managing a queue not only becomes a full time job, but also introduces too many human errors. You should consider setting up a system with automated queue management. The queue system should provide you with different error handling choices. How you handle encoding errors will ensure that your Transcoding system continues to operate on subsequent files. It is critical to prevent your queue from jamming up due to an expected error. They queue system should allow you to set and change priority levels for your Transcoding jobs and ultimately, it should let you dictate how you allocate both processing and storage resources. It should let you bring online and take off line additional hardware without shutting down the system.

As your volume and throughput demand increases, you need to begin to consider what kind of hardware you need to use with your software solution or whether you need a hardware accelerated platform. If you want to stay with a software based solution you need to look at multiple CPU computer systems, what kind of file storage (disk I/O is usually the slowest part of the system) is available, and Network connectivity. Keep in mind that the Transcoding process takes a good portion of the time in processing your videos, but it is network latencies and disk I/O bottlenecks what often brings down productivity. A good system makes sure that more than enough bandwidth is allocated for file I/O.

The location of your input videos is an important consideration on how you design your system. Do you have a library of content that resides in a single location? You should have then a Transcoding system that is located closest to the content and make sure that the data throughput from your sources has enough bandwidth to avoid I/O bottlenecks.

Does the content reside at multiple locations? You might increase your throughput by having a encoding system at a few of the source locations. Your queue system and asset management system should be designed in a way that it allows you to distribute the load across locations if necessary.

Is the content being sent to you from many locations? Here, you have different factors at play and a few options. First, you must make sure that you have enough bandwidth to receive the input videos. Here you can leverage a CDN to increase your bandwidth and take advantage of the geographical proximity to the submitter. Second, you must make sure that your file storage (for input files) is adequate and scalable. Third, you might be better off setting up a distributed encoding solution where videos are converted at a point closest to the submitter, or even at the submitter end. Fourth, content management must be able to track all the incoming videos and move them to the output location(s) with flexibility.

Input formats or devices that need to be supported are important constrains in designing the Transcoding system. Do you need tape support? Do you need analog or digital video inputs? (SDI?) If so, you need a capture card with a serial machine control interface and make sure that it supports the right kind of video inputs. You also need to make sure that the input file format is supported by your hardware of software Transcoding system.

The output file format(s) is also an important consideration. Do you need to output videos in one single format? What format? Some systems charge more for certain output formats or doesn’t support them at all. Don’t assume, read the specifications or ask the vendor.

Where and how you are going to deliver your videos is the last piece of the Transcoding system. Again, you need to make sure that you have enough bandwidth to support your desired output rate. Consider a CDN when you need to deliver to multiple geographic locations.
Next post will cover user generated video transcoding workflows.

Thursday, December 4, 2008

Video Mastering Transcoding Workflows

Encoding of videos for mastering is driven by quality. The objective is to achieve a video file that adheres to strict industry standards.
Usually, a single or a series of masters are created to be to be replicated or to be used as sources in making copies of the video to other formats.
As an example, a video master for a DVD is created with a professional MPEG-2 video encoder from a video tape (a master video tape itself, usually.) Great attention is placed on creating a pristine, free of artifacts MPEG 2 file that goes through a quality control process (QC) by a human that watches the video in a room equipped with video monitors that have been calibrated for color, brightness, etc. The QC process also involves looking at the video signal on a waveform monitor and vector scope to verify its integrity. There are also QC software programs that can analyze the file for anomalies in the stream.
It is not uncommon that file candidates to be masters are rejected. Video material varies greatly and that makes the video encoding for masters challenging. Parameters in mastering type video encoders can be adjusted for scenes with fast motion, noise, or scene changes. Some encoding packages allow the encoding operator to adjust these parameters on a scene by scene basis. And as you can imagine, this process becomes very time consuming.
A good video mastering workflow is illustrated in the figure below.


To avoid storing RGB or YUV files, some facilities and studios have been creating high quality compressed files like MPEG-2 @ 50Mbs I frame only to be stored and used as masters to create other files down stream. They call them “mezzanine” files as they are an intermediate master in the creation of other videos. These mezzanine files should also follow the same type of workflow as they are a master on their own. Mezzanine files are being used today to create podcast, streaming files for web delivery in many formats as FLV, H.264, WMV or several flavors of Quicktime. The great advantage of using a mezzanine file as the source is that the encoding of new target files can be automated, and managed by a computer. Also, it uses less bandwidth on the network as compared to uncompressed videos or using tapes as sources.
In my opinion, H.264 should be used to create mezzanine files as greater video quality can be obtained while producing smaller files.
Next post will cover transcoding automation

Monday, December 1, 2008

Free and Open Source Transcoding Software

First of all I would like to thank all of you for the great topic suggestions. I'll try to get to them in a timely manner.

To conclude a cursory review of the different Transcoding options, I will examine some of the most popular free or open source solutions available.

As with any free software or open source package, if there are any problems, you won’t have any body to complain to or to help you. Also, some free codec packs and encoding packages may contain spy ware. Definitely Caveat Emptor.
There are some very good video Transcoding tools available as open source or free. Probably the most popular open source software package is FFMPEG.

FFMPEG:
This is an open source video Transcoding platform that covers pretty much every video codec out there with the exception of On2’s VP6 Flash-8 codec.
There are many graphic user interfaces to FFMPEG’s command line interface. I have tried the SUPER package and found the UI intuitive and easy to use.

http://www.theinquirer.net/en/inquirer/news/2006/07/31/dont-buy-any-video-converter-before-trying-this-freebie
http://www.erightsoft.com/SUPER.html
http://ffmpeg.mplayerhq.hu/

Riva FLV Encoder
Converts to Flash FLV 1.1 from many input formats including AVI, MPEG, DV, MOV and WMV.

http://www.download.com/Riva-FLV-Encoder/3000-2140_4-10320097.html?cdlPid=10381392

Windows Media Encoder
Converts to wmv files. It accepts many input video files as long as the codecs are installed in your system. Free from Microsoft. If your input file doesn’t work, you might need to install a codec pack.

http://www.microsoft.com/windows/windowsmedia/forpros/encoder/default.mspx

DivX Encoder
Converts to DivX format. The input support also depends on the codecs you have installed in your computer. You can get it free at the DivX website

http://www.divx.com/divx/windows/

TubeTilla YouTube downloader
Downloads a YouTube video from a URL and converts it to mp4 or wmv. A couple of people seem to have liked the software.

http://www.snapfiles.com/Freeware/gmm/fwvideconvert.html

Next week I will be talking about some of the best video transcoding practices for mastering and how to optimize that workflow.