What Is Video Encoding?
Only a few many years again, cell telephones weighed greater than right this moment’s laptops and residential theaters overflowed with VHS tapes. The power to suit extra information into much less house has been probably the most exceptional feats of the previous century — and compression applied sciences like video encoding have made all of it doable.
Streaming now makes up a substantial chunk of the digital data floating round, with video anticipated to account for 82 p.c of all web site visitors by 2022. On this weblog, we’ll take a look at what video encoding is and its position in stay video supply. We’ll additionally discover the variations between lossy and lossless compression, widespread video encoding codecs used for streaming, and the way to shortly encode your streams utilizing free software program like OBS Studio.
What Is Video Encoding
Video encoding describes the method of changing uncooked video right into a compressed digital format for environment friendly supply throughout the web. Encoding happens as quickly as a video stream is captured and performs a necessary position in all stay streaming workflows. The encoder itself may be constructed right into a digital camera, however it will probably additionally take the type of a {hardware} encoding equipment, laptop software program like OBS Studio, or a cellular app.
How Does Encoding Work?
To view this video please allow JavaScript, and think about upgrading to a
internet browser that
helps HTML5 video
Milliseconds after a stay stream is captured, the info should be shrunk down for environment friendly transportation throughout the web. Typically, streams are diminished from gigabytes of knowledge to megabytes of knowledge.
Video encoding software program and {hardware} depend on two-part compression instruments referred to as codecs to realize this. Particularly, codecs apply algorithms to the video and audio information to condense it in each approach doable. As soon as the stream reaches viewers, a video decoder constructed into the participant software program or set-top field decompresses the info for playback.
What Is a Codec
A codec refers back to the compression know-how that acts upon video and audio information to shrink it right into a streamable dimension. Actually ‘coder-decoder’ or ‘compressor-decompressor,’ codecs apply algorithms to initially compress the info for transmission, and later decompress for viewing.
Relating to streaming stay video, each video and audio codecs come into play. H.264, also called AVC (Superior Video Coding), is the commonest video codec. AAC (Superior Audio Coding) is the commonest audio codec.
Encoding in Motion à la the MP3 Codec
For the sake of illustration, let’s focus in on an audio compression know-how you’re certain to know by identify: MPEF-1 Audio Layer III, a.okay.a. MP3.
The MP3 codec revolutionized music consumption within the Nineties. In a single day, music libraries that after crammed storage cupboards with CDs may very well be crammed into hand-held MP3 gamers — with no noticeable change in high quality.
The MP3 codec did this by discarding all audio parts past the restrictions of human listening to for environment friendly transportation and storage. That is referred to as lossy compression, a necessary encoding methodology for video streaming.
Lossy vs. Lossless Video Encoding
Lossless compression happens when the info is compacted with none data being discarded. A trusty ZIP file does simply this, permitting us to cram a bunch of knowledge right into a small quantity of house whereas preserving information integrity.
On the opposite hand, lossy compression allows a a lot larger discount in file dimension by tossing out pointless information. Dimension is essential in relation to streaming, making lossy compression a should.
The objectives of lossy compression are threefold:
- Drop all information that will go undetected by the human eye or ear
- Cut back the standard the place doable
- Shortly compress all remaining information
When encoding for stay streaming, lossy compression ensures environment friendly transmission throughout the web. As such, all of the encoding codecs in our listing under fall on this camp.
Subscribe and keep updated
Get all the main points on codecs and protocols, the newest stay streaming traits, and way more.
Subscribe
Video Encoding Codecs for Stay Streaming
Earlier than stepping into our advisable encoding codecs, a fast observe on terminology.
Video encoding codecs describe the compression specs accessible, whereas video codecs describe the software program or {hardware} implementation of those codecs. For the sake of this text, that distinction has little bearing. Nonetheless, needless to say for any given specification, there could also be a number of codec implementations accessible.1
With out additional ado, right here’s our listing of the preferred codecs in 2021.
Advisable Stay Streaming Encoding Codecs:
- H.264/AVC: H.264 is an environment friendly and broadly adopted video compression know-how that lends properly to low-latency streaming workflows.
- VP9: VP9 is a extra superior and higher-quality compression know-how than H.264/AVC that enjoys larger compatibility than lots of its options and works properly for 4K streaming.
- H.265/HEVC: When delivering premium OTT content material to lounge units, the royalty-bearing H.265 codec is the perfect encoding format at present accessible.
- AV1: AV1 is the newest and best open-source video encoding know-how, however prolonged encoding instances at present translate to excessive encoding prices.
See our deep-dive weblog on video codecs for a extra complete take a look at the perfect video encoding codecs for streaming — or try the video under.
To view this video please allow JavaScript, and think about upgrading to a
internet browser that
helps HTML5 video
Encoding vs. Transcoding: What’s the Distinction?
It’s actually doable to encode a video as soon as and by no means contact it once more. However most streaming workflows make the most of video transcoding at a later step to additional course of the stream.
Video transcoding includes decompressing an encoded video file, (usually) altering it, after which recompressing — doubtlessly in a unique encoding format — for supply to finish customers. This conversion course of can happen on the media server or in a cloud-based streaming platform.
Listed below are the important thing areas the place encoding and transcoding differ:
1. Encoding happens first; transcoding happens second.
Simply as one should write a guide earlier than translating it, a stream should be encoded earlier than it may be transcoded.
2. Encoding is important; transcoding isn’t.
It’s not doable to stay stream a video over the web with out encoding. This means of condensing uncooked video right into a digital format for environment friendly supply throughout the net all the time happens, even when the encoder is constructed into the seize machine from which you’re broadcasting.
Video transcoding, however, isn’t a should. Loads of workflows, equivalent to these utilizing WebRTC from finish to finish, don’t require any transcoding infrastructure.
Learn how to Encode Stay Streams With OBS and Transcode With Wowza
Open Broadcaster Software program (OBS) Studio is a free and open-source stay streaming encoder that may simply be built-in right into a Wowza-based workflow for large-scale streaming.
Justin demonstrates the way to use OBS to encode a Actual-Time Messaging Protocol (RTMP)-based stay video stream within the video under. From there, he walks by means of the method of sending the stay content material to Wowza Streaming Cloud, repackaging it as an adaptive bitrate Apple HLS stream, and distributing it for playback utilizing THEOplayer.
To view this video please allow JavaScript, and think about upgrading to a
internet browser that
helps HTML5 video
Get Began Right now
It doesn’t matter what kind of streaming structure you’re attempting to construct, Wowza makes it occur. Our full-service platform could be built-in with production-quality encoding home equipment, browser-based Net Actual-Time Communications (WebRTC) encoding, a big selection of software program encoders, and all the things in between. Give it a spin right this moment by signing up for a free Wowza trial.
1. Streaming codec knowledgeable Jan Ozer explains this distinction in additional element in his article on the H.264/AVC specification:
“As a video normal, there are a number of implementations of the H.264 codec, together with the x264 codec in FFmpeg, and the Beamr codec used within the Wowza Streaming Engine. Intel and NVIDIA each supply hardware-accelerated H.264 codecs that may be accessed from the Wowza Streaming Engine.
As a result of H.264 is an ordinary, all video encoded by any H.264 codec ought to play on any H.264 decoder or participant, whether or not in a browser, smartphone, or Sensible TV.”
Grow to be a Streaming Skilled
Subscribe to Weblog
Extra Sources:
- Optimizing Video Encoding Settings for Your Use Case
- Greatest Encoding Software program for Stay Streaming
- The Full Information to Stay Streaming
About Traci Ruether
As a Colorado-based B2B tech author, Traci Ruether serves as Wowza’s content material advertising and marketing supervisor. Her background is in streaming and community infrastructure. Except for writing, Traci enjoys cooking, gardening, and spending high quality time along with her kith and kin. Comply with her… View extra