A (175)

(Tuis.) #1
CHAPTER 11: Digital Video: Streaming Video, MediaPlayer, and MediaController classes 421

Digital Video Optimization: Codec and Settings


Digital Video is compressed using a software utility called a codec, which stands for COde-DECode.
There are two opposing sides to each video codec; one encodes your video data (for captive
or streaming), and the other decodes this video data (captive video or streamed video). A video
decoder will be part of the OS (Android or HTML5), or the HTML5 browser, on other operating
systems, which uses it.


The decoder side of the codec will always be optimized for speed, as smoothness of video playback
is a key issue, and the encoder side will be optimized to reduce data footprint for the digital video
asset that it is generating. For this reason, the encoding process may take a long time, depending on
how many processing cores your workstation contains. Most video content production workstations
should support 8, 12, or 16 processor cores.


Codecs (on the encoder side) are like plug-ins, in the sense that they can be installed into different
digital video editing software packages, in order to enable them to encode different digital video
asset file formats. Since the Android OS supports H.263 and H.264 MPEG-4 formats, and the ON2
VP8 WebM format for video, you need to make sure that you are using one of the codecs which
encodes video data into these digital video file formats.


More than one software manufacturer makes MPEG encoding software, so there will be different
MPEG codecs (encoder software) that will yield different (better or worse) results, as far as encoding
speed and file size goes. The professional solution I recommend that you secure if you wish to
produce professional video is called Sorenson Squeeze, which is currently at version 9. Squeeze
has a professional-level version, which I will be using in this book, which costs less than a thousand
dollars, and whose value is in excess of that suggested list price amount.


There is also an open source solution called EditShare LightWorks 11.5 that is scheduled to
natively support output using the MPEG4 and WebM VP8 codec sometime in 2014. So for now, I will
have to use Squeeze Pro 9 for this book, until the codec support for Android and HTML5 is added to
EditShare LightWorks 11.5 in 2014.


When optimizing for digital video data file size using encoder settings, there are a number of
important settings which directly affect the data footprint. I’ll cover these in the order in which they
affect file size, from the most impact to the least impact, so you know which parameters to “tweak”
or adjust in order to obtain the results that you are looking for.


As in digital image compression, the resolution, or number of pixels, in each frame of video is
the best place to start your data optimizing process. If you are targeting 854x480 or 1280x720
smartphones or tablets, you don’t need to use 1920x1080 resolution to get great visual results from
your digital video assets.


With high-density (also termed high dot pitch) displays (HDPI, XHDPI and XXHDPI) currently
common in the Android market, you can scale 1280 video up 33% and it will look reasonably good.
The exception to this might be iTV apps for GoogleTV, which has a medium (or even low) dot pitch,
due to large 55 to 75 inch screen sizes. In this use-case, if you are developing applications for iTV
sets, you would want to use “True HD” 1920x1080 resolution.


The next level of optimization would come in the number of frames used for each second of video,
called FPS, assuming the actual seconds contained in the video itself cannot be shortened by
editing. This is known as your frame rate, and instead of setting the video standard 30 FPS frame
rate, consider using a film standard frame rate of 24 FPS, or the multimedia standard frame rate of

Free download pdf