How does video transcoding work?
Video transcoding is an umbrella term that refers to the decoding, processing, and encoding of media files. Transcoding video content begins with software analysis of the original files to determine the audio and video codecs, bitrate, frame rate, and resolution. Then the software compares this information to the required specification of a playback platform. If the extracted information isn’t optimal for the platform, it transcodes the video and audio files by using the following steps.
De-multiplexing the video files
De-multiplexing (or demuxing) analyzes a video file to determine each individual signal—such as video, audio, and subtitles—from inside the video file. The process separates each of these signals into separate components. Then it can optimize each component individually, depending on the desired output format. For example, the audio component might require a compression format, and the video component might require re-encoding at a different bitrate. The separation of the video file into its components facilitates these specific adaptations.
Video decoding and post-processing
The compressed video component, isolated in the first step, is decoded into an uncompressed format. Standard, intermediate formats such as RGB and YUV help maintain the quality of the video. You can use either software or hardware decoding. Software decoding is more flexible, and hardware decoding is faster.
Next, inverse quantization is used to recover the original pixel values for each video frame. Inverse quantization reconstructs the simplified video data by multiplying the quantized coefficient by the same step size and rounding the result. Alongside deblocking and compensation, this reconstructs the video and smooths it out.
Then the video data goes through postprocessing optimization, involving changes such as scaling, frame-rate conversion, and color correction.
Video encoding
After the software processes the uncompressed video, it’s encoded into a new video codec or format. This step compresses the video into the video codec type that is compatible with the target format or platform. The correct encoding settings enable the transcoding software to optimize the output video for that specific platform.
Multiplexing
Finally, the transcoding software uses multiplexing (or muxing) to combine all separated components into one multimedia file. The re-encoded video, subtitles, and audio streams merge into a single file. The software can also add metadata to the output file at this stage.
Standard codec formats and video containers
A video codec (short for coder-decoder) is the component that compresses and decompresses video and audio data. H.264 is one of the most prominent video codecs. It comes from a family of MPEG (the Motion Picture Experts Group). Other common codecs include VP9, Theora, and AV1.
A video container is a multimedia file that can hold various data streams in one file. The standard video containers are QuickTime File Format, MP4, FLV, WebM, Ogg, and Advanced Systems Format (ASF).
What is a video transcoding server?
What are the types of video transcoding?
The video transcoding process can change depending on your criteria for the final media file. Here are the distinctions between the main types of transcoding.
Interframe vs. intraframe transcoding
Interframe transcoding changes the video compression settings between different frames in a video. It can adjust the specific bitrate, quality, and compression ratio across each frame. Interframe transcoding offers increased video smoothness.
Intraframe transcoding adjusts the compression settings within individual frames, without changing these settings across the frames. This approach provides a consistent level of quality within each frame of a video.
Lossless vs. lossy transcoding
Lossless transcoding doesn’t result in data quality loss and retains the original video quality. This higher quality result results in larger file sizes.
Lossy transcoding compresses the video, which results in the reduction of quality. The loss of data also reduces the file size of the video. For video streaming, lossy transcoding can balance quality and file size for a smooth viewing experience.
Audio vs. video transcoding
Audio transcoding involves the conversion of audio files from one codec or format to another. For example, you can convert audio from MP3 to WAV or the other way around to change the file size, quality, or compatibility.
Video transcoding is converting video files from one codec or format to another. It includes changing video resolution, codec, and bitrate to adapt the media to different platforms.
Local transcoding vs. cloud transcoding
Local transcoding happens on local or on-premises software or hardware. You have to configure and maintain the IT infrastructure required for the transcoding process, which can be expensive and challenging at scale.
Cloud transcoding is performed over cloud infrastructure. It’s scalable, accessible, and cost-effective because you don’t have to maintain your own local hardware and software.
From time to time, I see NAS or homelab server benchmarking videos on YouTube mentioning video transcoding performance on those devices, but I'm not sure in what cases a video transcoding service would be needed in a homelab environment. For a decade I have my various NAS devices on my home network serving my Blu-ray and now UHD backups via DLNA; even with 4K UHD videos directly backed up from a disc (~55GB per movie), when being played on the LAN via DLNA the bandwidth usage is well below 100Mbps, any properly wired or WiFi connections can handle that.
So I'm curious, what use cases require to transcode the videos to lower resolutions/bitrates in a homelab and LAN playback setting?