18 May 2022
More and more people are starting to dip their toes into digital video. Usually they start by uploading a few videos to YouTube. But their needs expand - put a video on their website with a clean look (read NOT YouTube embed) or use it in their marketing emails, and sooner or later they bump into what I call The Great Wall of Video Jargon. They give up thinking that digital video is just too complicated for them. Maybe this is you. If so, then read on because digital video is simple if you understand some basic concepts.
Like most technology subjects, digital video has a lot of depth and complexity for those who want to get into that. For example, if you’re a PhD candidate inventing a new codec then you’ll find more than enough material for your thesis. But for an online influencer who just wants to stream great quality videos, this article probably contains everything you need to know.
The buzzwords you need to be familiar with are format, codec, resolution, bitrate, frame rate and size. You need to understand how they affect the quality of your finished video and what are the tradeoffs you need to consider.
A ‘video’ file actually consists of at least three distinct data sets. The video stream, the audio stream and metadata about the file itself. It can also include other data sets such as subtitles and still frames. Packaging all these data sets in a distinct way is called a format. Usually it’s a single file with an extension. For example a popular format is MP4 or MPEG 4 with the .mp4 file extension. These single file formats are what are known as constant bitrate or CBR formats.
There are other formats, called adaptive bit rate or ABR that consist of sets of files. The most common is HTTP Live Streaming or HLS. You'll learn more about why HLS has multiple files in the section on bitrate.
Some other commonly used video formats are AVI, MOV, FLV, WMV, MKV, AVCHD, and WebM. They each have their pros and cons. Really what's important to remember is that formats are nothing but containers for video, audio and other data.
Before you can play a video file, you need to know not only the format, but the codec of the video stream as well. So what are codecs?
Raw video files are huge. For example a single second of 1080p HDTV is 118Mb. This makes it almost impossible to deliver raw video online. To overcome this hurdle, codecs were invented. Codec is compression-decompression. Think if it as zipping a video to reduce it’s size. You can compress a video using an algorithm and send it over the internet to a player on the other end. The player must have the decompress version of that same algorithm to be able to play the video.
There are many different codecs out there. Some of the most popular are H.264 also known as Advanced Video Coding or AVC. This has been around since 2003 and is pretty much everywhere. But beware, H.264 is a licensed codec owned by a consortium of companies that form the MPEG-LA group. It collects royalties on the codec's use. So far, only the device manufacturers have paid the license fees, not the content creators but it’s possible that can change.
Another popular codec is H.265 or High Efficiency Video Coding (HEVC). This is a successor to AVC in that it offers much better video compression and can support resolution up to 8K (more on resolution later).
VP9 is comparable in terms of video quality and compression to H.265. And since it was developed by Google, it’s designed to make video easy to share online. There's also has the added bonus that VP9 is royalty free.
Some other codecs are MPEG-4, DivX, MPEG-2 and many, many others. So now you know about the mechanics of video files and compression-decompression, let’s take a look at some things that affect the quality of the video itself.
You’ll often see video resolutions quoted as 360p, 480p, 720p, or 1080p. This is shorthand for the number of horizontal lines a video has from top to bottom. So, a 480p video is made up of 480 lines stacked one on top of another.
The letter ‘p’ stands for progressive scan. It can also be ‘i’ for interlaced. Progressive scan video is more common and it displays the entire video frame each time. Interlaced video shows odd and even numbered lines alternatively.
If resolutions such as 720p, 480p denote the vertical size, what about the horizontal? Great question. Each also has an associated horizontal width number that’s not usually quoted. So for example, 720p is 1280 pixels wide 480p is 854 pixels. There are widths for all the others too.
You might notice something about these number. If you divide the height by the width, you get the same ratio 1.77. This is known as the aspect ratio of the video. It is more commonly written as 16:9. All 16:9 aspect ratio videos are the same shape rectangle. The only difference is the resolution or the number of pixels per square inch, used to generate the video.
Although 16:9, which is sometimes called widescreen, is the most common aspect ratio for video today, other less common ones also exist. For example 4:3 is a particularly long lived format that has been used on broadcast TV, all over the world for over 50 years. 2.76, 1.78 and 2.35 are some others.
Aspect is the ratio of the width to height of the video frame. This diagram shows relative sizes of different aspect ratios and frame sizes.
Bitrate is a measure of the bits per second that are sent in the video stream. The higher the bitrate, the better the quality and clarity of the image. Low bitrate leads to blurry, pixelated video. We talked about how some formats are fixed, constant bitrate, such as MP4 and others, like HLS have varible, adaptive bitrates.
For constant bitrate (CBR) formats, the video file must be downloaded first before it can play. Most players download and store a couple of seconds of video in a buffer. They then start playing the video. For fast connections this works fine. As the video plays, more is downloaded. But for slower internet connections, the stored buffer might run out and lead to the hated ‘buffering’ message appearing and pausing your enjoyment of the video.
To overcome this, most video streaming services use adaptive bitrate formats. These formats have versions of the video stream encoded to several different bitrates. During playback, the player senses and changes the video stream based on the connection speed that it detects. This is why when watching videos on Netflix for example, the video sometimes gets a little pixelated for a few seconds. This is because your internet connection speed dropped and the ABR format sent a lower bitrate stream to compensate. The beauty of this approach is that ‘buffering’ will never appear during video playback.
As well as HLS, other adaptive bitrate formats include MPEG-DASH, MSS and the newest, CMAF
Frame rate is the number of complete video frames that are displayed per second. For progressive scan resolutions that's all there is to it. But interlaced resolutions, remember, display alternating odd/even lines every frame. So how does frame rate apply here? The answer is that when talking about interlaced video they say field rate instead of frame rate.
Some common frame rates, in frames per second or fps are:
You can have frame rates above 60 fps but when these are played back on LCD displays, they will appear as 60 fps since the max refresh rate on most consumer LCDs is 60Hz.
Field rates only ever come in two flavors: 50i and 59.94i
24fps is considered the minimum to show smooth motion in a video. The higher frame rates are useful for sports videos or news footage, where there is a lot of action and movement in the scenes. Many people don’t enjoy watching movies on high frame rates since it tends to destroy the cinematic quality and gives every scene a smooth ‘soap opera’ effect.
That in a nutshell is the technology behind digital video. Over the next few blogs, I'll expand on some of these topics. But even with these basics you have everything you need to start delivering amazing, high quality videos to your audience. If you want to play around and get a feel for formats, codecs, frame rates and much more, head on over to HTML5VideoBank where you can try it all for free.