NVIDIA Video Codec SDK 13.1: Zero-Copy Transcode, AV1 B-Frames, and Frame-Accurate Seek
https://developer.nvidia.com/blog/nvidia-video-codec-sdk-13-1-zero-copy-transcode-av1-b-frames-and-frame-accurate-seek/📌 【NVIDIA 更新】Video Codec SDK 13.1 發布:支援 AV1 階層式參考與精準跳轉
TL;DR:SDK 13.1 透過 AV1 階層式 B-frames 與 GOP 感知跳轉,大幅提升影片編碼品質與解碼效率。
隨著串流媒體、生成式 AI 媒體工具與遠距協作需求的激增,開發者對高效能影片處理管線(Video Pipeline)的需求日益嚴苛。NVIDIA Video Codec SDK 13.1 正式發布,透過 GPU 加速的硬體編碼與解碼引擎,為開發者提供更強大的格式處理能力與工作負載效能。
🧩 AV1 階層式參考模式:提升 B-frames 數量至 31 個
在 AV1 編碼中,使用 B-frames 作為參考幀能有效提升畫質。SDK 13.1 引入了「階層式參考模式」(Hierarchical Reference Mode),其設計理念如下:
- 樹狀結構設計:將 B-frames 排列成樹狀參考結構,葉節點為非參考 B-frames,而根節點則是中間的 B-frame。
- 提升時域冗餘利用率:此模式將 NVENC 的最大 B-frames 數量從 7 個大幅提升至 31 個。
- 效能表現:使用此模式不會增加效能負擔,但會增加顯存(Video Memory)消耗。在高品質編碼下,使用 15 個 B-frames 的階層式參考模式,相較於高品質預設值,能節省顯著的位元率(Bitrate)。
💡 迭代編碼與 UHQ 調校的結合
SDK 13.1 整合了先前版本推出的兩項關鍵技術,讓延遲容忍型編碼(Latency-tolerant encoding)達到最佳的品質與效能平衡:
- 迭代編碼 (Iterative Encoding):允許使用者對同一幀使用不同參數進行多次重新編碼,並能從中選擇最佳狀態提交。
- UHQ 調校 (UHQ Tuning):結合了 Lookahead(預視)層級與時間濾波(Temporal Filtering)。時間濾波透過動作估計(Motion Estimation)來減少自然影片的雜訊,平均可帶來 4–5% 的編碼增益。
📊 解碼效能提升:獲取逐宏區塊(Per-macroblock)統計數據
針對 H.264 與 HEVC 內容,NVDEC API 現在能直接提取詳細的逐宏區塊解碼統計數據,且無需額外的 CPU 負擔:
- 提取資訊:包含亮度量化參數 (QP)、編碼單元類型(Intra, Inter, Skip, 或 PCM)以及最多兩個動作向量(Motion Vectors)。
- 應用場景:這些數據能直接解鎖 GPU 加速的影片分析工作流,例如場景變更檢測、物體追蹤與鏡頭邊界分析,無需再透過 CPU 端進行位元流解析(Bitstream Parsing)。
🎯 精準跳轉:實現 GOP 感知的隨機存取
在 AI 推理管線或影片編輯中,開發者往往需要直接存取特定幀,而非依序解碼。SDK 13.1 透過 NvVideoDecoder 類別提供了全新的跳轉 API:
- GOP 感知架構:當請求第 N 幀時,SDK 會定位到該目標前的最近一個 IDR 幀,從該處開始解碼並跳過非參考幀,直到到達目標幀,確保僅對目標幀執行完整的解碼與後處理流程。
- 靈活的存取方式:支援單一索引(如 0, 10, 20)、帶步長的範圍(如 0:100:10)或基於時間的存取(如 -t 1.5)。
- 快取機制:透過 LRU(Least Recently Used)機制快取解碼器實例,避免重複建立的開銷。
⚠️ 限制
- 使用階層式參考模式會增加顯存(Video Memory)的消耗。
- H.264 與 HEVC 的階層式參考模式預計將於未來的驅動程式版本中提供。
🔗 來源
- 標題:NVIDIA Video Codec SDK 13.1: Zero-Copy Transcode, AV1 B-Frames, and Frame-Accurate Seek
- 作者/機構:Elizabeth Goodman @ NVIDIA Developer
- 連結:developer.nvidia.com/blog/nvidia-video-codec-sdk-13-1-zero-copy-transcode-av1-b-frames-and-frame-accurate-seek/
#NVIDIA #VideoCodecSDK #AV1 #NVENC #NVDEC #GPUAcceleration #VideoEncoding #VideoDecoding #MachineLearning #VideoAnalytics
原始資料 NVIDIA Developer · 收集於 2026-08-01
摘要原文
The demand for high-quality video continues to accelerate across industries, powering everything from immersive streaming experiences to remote collaboration, generative AI media tools, and large-scale content delivery. Behind these experiences is a growing need for video pipelines that are faster, more efficient, and capable of handling increasingly complex formats and workloads. NVIDIA Video Codec SDK helps developers meet that challenge by providing access to GPU-accelerated video encoding and decoding through NVIDIA dedicated hardware video engines. NVIDIA Video Codec SDK 13.1 is now available. We encourage developers to explore the latest features in their video pipelines, take advantage of the redesigned sample apps, and share feedback via the NVIDIA Developer forums . What’s new in SDK 13.1 Encode features : · Hierarchical Reference Mode for AV1 with up to 31 B-frames · UHQ tuning info combined with iterative encoding Decode features : · Per-macroblock decode statistics for H.264 and HEVC · View information during MV-HEVC decode · Seek to a specific frame Transcode features : · Application-allocated CUarray as NVIDIA Video Encoder (NVENC) input and NVIDIA Video Decoder (NVDEC) output · Redesigned transcoder samples with a modular, queue-based architecture Other features : · Official Docker-based development environment Encode improvements Why AV1 hierarchical reference mode Using B-frames as references improves encode quality. Hierarchical Reference Mode improves it further by arranging B-frames in a tree-like reference structure: leaf nodes are non-reference B-frames, and the root is the middle B-frame. This structure increases NVENC’s maximum number of B-frames from 7 to 31, enabling the encoder to exploit temporal redundancy and improve overall quality. Use of this mode does not add any performance penalty, but video memory consumption goes higher. Figure 1. Example of a hierarchical reference structure with 15 B-frames SDK 13.1 adds Hierarchical Reference Mode for AV1, supporting 1, 3, 7, 15, and 31 B-frames; H.264 and HEVC will follow in future driver versions. The mode is most effective at seven or more B-frames and has minimal performance impact. For configuration details, see the NVENC Programming Guide . Figure 2, below, shows bitrate savings when encoding 15 B-frames in Constant Quality (CQ) mode, compared with NVENC’s High Quality (HQ) tuning in preset p7. Figure 2. CQ mode – Bitrate savings for Hierarchical Reference Mode with 15 B-frames Figure 3, below, shows bitrate savings when encoding 15 B-frames in Variable Bitrate (VBR). Figure 3. VBR mode – Bitrate savings for Hierarchical Reference Mode with 15 B-frames UHQ tuning info with iterative encoding Iterative encoding (introduced in Video Codec SDK 12.1 ) freezes the encoder’s automatic state advancement and lets the user re-encode the same frame with different parameters. NVENC tracks each iteration’s state, and can stop and commit to any one of them. UHQ tuning info (introduced in Video Codec SDK 12.2 ) combines lookahead level and temporal filtering to deliver the best quality-vs-performance tradeoffs in latency-tolerant encoding. Temporal filtering reduces noise in natural video by using motion estimation to find matching patches in adjacent frames and applying them to filter the current frame, yielding average coding gains of 4–5% on natural content. The lookahead level feature analyzes future frames and uses coding tree units (CTUs) and other statistics to allocate bits efficiently for rate control. Four lookahead levels with different performance and quality tradeoffs are currently supported.. Version 13.1 combines UHQ tuning info with iterative encoding, so lookahead level and temporal filtering now work alongside per-iteration re-encode. Decode improvements Per-macroblock decode statistics The NVDECODE API now retrieves detailed per-macroblock decode statistics for each decoded frame of H.264 and H.265 (HEVC) content. For every 16×16 block, the decoder exposes the luma quantization parameter (QP), the coding unit type (Intra, Inter, Skip, or PCM), and up to two motion vectors (forward and backward), all extracted as a natural byproduct of hardware decode with no additional CPU overhead. These statistics unlock GPU-accelerated video-analytics workflows that previously required CPU-side bitstream parsing. Motion vectors enable scene-change detection, object tracking, and shot-boundary analysis. QP values give a per-block view of encoding quality for adaptive bitrate optimization and quality monitoring. Macroblock types reveal coding structure useful for content classification and compression research. The workflow is straightforward: applications query decoder capabilities via cuvidGetDecoderCaps() , enable statistics collection at decoder creation, and retrieve a GPU-resident statistics buffer with each decoded frame from cuvidMapVideoFrame() . The user can copy the statistics to host memory or process them directly on the GPU with CUDA kernels for real-time pipelines. The SDK ships a ready-to-use sample, AppDec -dumpstats , that demonstrates the full flow. Frame-accurate seek AI workflows—from inference pipelines for object detection, content moderation, and video summarization, to training-data preparation that samples diverse frames across large datasets—frequently need specific frames rather than sequential decode. Video editing and non-linear post-production have the same requirement. The Video Codec SDK now provides a comprehensive seeking and random-frame-access API through the NvVideoDecoder class, making frame-accurate access as simple as array indexing while fetching only the frames you need. A GOP-aware seek architecture handles the request. For frame N, the SDK locates the nearest IDR frame before the target, seeks the demuxer there, and flushes decoder state via CUVID_PKT_DISCONTINUITY . From that IDR forward, only frames needed to reach N are processed: the parser flags and skips non-reference frames, and reference frames decode but bypass mapping and post-processing (format conversion, scaling, cropping via cuvidMapVideoFrame() ) through PTS-based filtering. Only frame N runs the full decode, mapping, and post-processing pipeline. Figure 4. Traditional sequential decode compared to GOP-aware seek The NvVideoDecoder class wraps the low-level SeekUtils engine and exposes a clean, operator-based interface. Figure 5, below, shows the internal seek flow when a frame is requested. Figure 5. Seek flow for fetching frame N (decoder[N]) Key capabilities: Decoder caching for playlists: NvVideoDecoder caches decoder instances by codec, bit depth, and chroma format, and reuses them via LRU eviction to avoid repeated creation overhead Non-seekable streams: Elementary streams, network streams, and pipes are auto-detected. Forward seeking works efficiently; backward seeking is supported with an automatic decoder reset Flexible frame specification: The AppDecVideoDecoder sample supports individual indices (0,10,20), ranges with step (0:100:10), time-based access (-t 1.5,3.0), and playlist files for batch processing Open GOP support: Streams with non-IDR I-frames seek to the nearest IDR rather than the nearest keyframe, ensuring all reference frames are available MV-HEVC stereoscopic enhancements The Video Codec SDK now offers better 3D-video support: view-ID and layer metadata from the decoder; multi-GPU encoding at high resolutions; and improved compatibility with third-party software.
由 tencent/hy3:free 自動生成