Skip to content

H.264 / H.265 DECODING


VIDEO CODECS

Video codecs conveniently fall into two categories:
Edit-friendly and edit-unfriendly codecs.

Edit-Friendly Codecs

Professional filmmaking demands not only high-quality imaging but also efficient and flexible post-production workflows. This requirement foregrounds the importance of using robust, edit-friendly codecs like ProRes, DNxHD, DNxHR, BRAW, R3D, and ARRIRAW, which are often employed by top-tier cinema camera manufacturers such as ARRI, Blackmagic Design, and RED.

ProRes
Developed by Apple, ProRes is widely embraced for its balance between maintaining high-quality video and ensuring responsive editing experiences, supporting up to 8K resolutions.

DNxHD & DNxHR
Avid Technology’s DNxHD and DNxHR codecs are optimized for high-definition video editing, providing smooth editing and quality preservation, especially within their Media Composer environment.

BRAW (Blackmagic RAW)
BRAW, designed by Blackmagic Design, melds the detailed image data of RAW video with traditional codec efficiency and flexibility, offering extensive color grading possibilities.

R3D (REDCODE RAW)
R3D, the proprietary codec from RED Digital Cinema, is a compact, variable bitrate wavelet codec that doesn’t compromise on quality, providing vast post-production latitude.

ARRIRAW
ARRIRAW from ARRI captures uncompressed RAW data directly from the sensor, resulting in large file sizes but providing unmatched post-production flexibility and quality.

Edit-Unfriendly Codecs

While some codecs are engineered to preserve quality and assist in post-production editing, others prioritize compressing data to facilitate efficient storage and streaming. Such codecs, like H.264, H.265, HEVC, AVC, and MPEG-4, which typically employ “Group of Pictures (GOP)” compression, can be notably challenging to work with in an editing context.

H.264 & H.265
H.264 and H.265 are prevalent codecs, integrated into various devices like smartphones, DSLRs, drones, and consumer cameras. Despite being incredibly efficient in reducing file sizes and thereby enabling smoother streaming experiences, they become burdensome in an editing context. The heavy compression demands significant decoding by editing software, which often results in sluggish and jerky playback, obstructing smooth editing workflows.

HEVC (High Efficiency Video Coding)
HEVC, or H.265, which is known for its adeptness at compressing video files to roughly half the size of H.264 while maintaining comparable quality, is widely used in 4K video compression and streaming. However, the intense compression algorithm makes it less straightforward and time-efficient to reverse in editing software, meaning alterations are computationally expensive and often slow.

AVC (Advanced Video Coding)
Also known as H.264, AVC is acclaimed for delivering high-quality video at lower bit rates. While it is an industry standard for video compression and is utilized in various applications, from broadcasting to online streaming, its high compression rate proves to be a bottleneck during editing, where frame-by-frame precision is paramount.


THE PROBLEMATIC NATURE
OF GOP CODECS IN EDITING

Let’s take a closer look at “edit-unfriendly” codecs by delving into the concept of the “Group of Pictures” (GOP) structure. The GOP structure represents a compressive technique that is predominantly utilized in codecs like H.264 and MPEG-4. While it successfully achieves impressive data compression and is widely implemented for streaming and data storage, GOP can bring forth numerous challenges when it comes to video editing, particularly within professional editing software like DaVinci Resolve. Here’s a more detailed look:

WHAT IS GOP?

The Group of Pictures (GOP) structure is a method that involves grouping frames together, typically involving one “I-frame” (intra-coded picture) followed by multiple “P” (predicted picture) and “B” (bi-directional predicted picture) frames. The I-frame contains complete image data, while P and B frames store only the differential data, referring back to previous I-frames or forward to subsequent frames for the information required to decode them. While this methodology achieves substantial compression, the inherent dependencies between frames can invoke complexities during editing.

DIFFICULTIES IN EDITING

  1. File Access Issues:
    The interconnectedness of frames within a GOP can induce challenges right from the inception of editing. Editing software, when trying to access and process individual frames, must decode not only the target frame but also its reference frames within the GOP. Consequently, the frame interdependencies can restrict software from quickly and easily opening or manipulating the file.

  2. Stuttering:
    Real-time playback is an essential aspect of the video editing process, enabling editors to preview edits and effects immediately. However, due to the reliance of P and B frames on their surrounding counterparts within the GOP, swift and accurate decoding becomes critical. If editing software struggles with this, it can lead to stuttering or juddering during playback, hampering the editor’s ability to accurately assess changes.

  3. Decoding Issues:
    The requirement to decode multiple interlinked frames to access and visualize a single frame presents not only an increase in computational load but also a risk of decoding errors. If any issues or inefficiencies occur during the decoding process, they can manifest as playback issues or visual artifacts, potentially disrupting the editing workflow and compromising the quality of the output.

H.264 DECODING

SUPPORT IN DAVINCI RESOLVE STUDIO

DaVinci Resolve Studio brings forth capabilities for hardware decoding of H.264 and H.265 media, albeit with certain limitations and dependencies. Not all types of H.264 and H.265 media are supported, and aside from the codec itself, factors like bit depth (8-bit, 10-bit) and chroma subsampling (4:2:0, 4:2:2, 4:4:4) come into play. Moreover, your computer’s GPU plays a crucial role, influencing whether hardware decoding can be leveraged effectively or not. Here is an overview of H.264 decoding support in DaVinci Resolve Studio 17.4:

H.265 DECODING

For H.265, 8-bit 4:2:0 and 10-bit 4:2:0 seem to work well. But for 4:2:2 / 4:4:4 you have to be lucky to have the right GPU/CPU for DaVinci Resolve Studio to take advantage of hardware decoding.


PROXY WORKFLOW

MAY PRESENT ISSUES

The proxy workflow, while beneficial for smoother editing, may present issues, specifically in the rendering stage of the post-production process. The primary concern lies in the need to render using the original files, not the proxy versions. Here’s a clear explanation:

When transitioning back from proxy files to the original H.264 GOP files, these original files need to be decoded for rendering. The decoding process relies on understanding and correctly interpreting the dependencies between frames in the GOP structure. However, this decoding is influenced by a multitude of factors including the capabilities of the hardware, efficiency of the software, and the complexity of the video itself.


SOLUTION

CONVERT TO DNxHR

In contrast, converting original files to a format like DNxHR that handles each frame independently, rather than in groups, could alleviate these issues. This can offer more efficient editing and smoother implementation of effects and transitions, all while preserving the high-quality visual details of the original files.

I suggest converting H.264/H.265 files into a codec that is suitable for editing, such as DNxHR. Several tools are available for transcoding your footage, and I will provide a step-by-step guide using “Shutter Encoder“, a free tool designed specifically for video conversion.

Step 1 = Browse and choose your H.264/H.265 file.
Step 2 = Choose function and select DNxHR.
Step 3 = Choose HQX for 12-bit 4:2:2 Broadcast-quality.
Step 4 = Start function.


DNxHR

CODEC

DNxHR is a lossy-compressed video data format developed by Avid. Initially designed as an “intermediate format” for video editing in post-production, DNxHR has now become widely utilized across the entire production process. Unlike DNxHD, DNxHR supports resolutions of 4k and beyond, offering increased flexibility. Below is a list of various quality settings available for transcoding your acquired media:

DNxHR LB – 8-bit 4:2:2 – Low Bandwidth
DNxHR SQ – 8-bit 4:2:2 – Standard Quality
DNxHR HQ – 8-bit 4:2:2 – High Quality
DNxHR HQX – 12-bit 4:2:2 – 4K Broadcast-quality delivery
DNxHR 444 – 12-bit 4:4:4 – Cinema-quality delivery


ADDITIONAL LINKS

FOR FURTHER EXPLORATION