NVIDIA、ビデオコーデック SDK 13.1 を公開しゼロコピー転送などを追加
本文の状態
日本語全文を表示中
詳細モードで約20分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
NVIDIA Developer Blog
NVIDIA は開発者向けビデオコーデック SDK のバージョン 13.1 をリリースし、AV1 エンコードにおける B フレーム数の最大拡張やゼロコピー転送機能の追加など、高性能な動画パイプライン実現に向けた新機能を多数実装した。
AI深層分析を開く2026年8月1日 01:08
AI深層分析
キーポイント
AV1 エンコード性能の大幅強化
階層参照モードの実装により、NVIDIA Video Encoder (NVENC) がサポートする B フレーム数を最大 31 に拡張し、時間的冗長性の活用と画質向上を実現した。
ゼロコピー転送機能の追加
アプリケーションが割り当てた CUarray を NVENC の入力や NVDEC の出力として直接使用可能にし、メモリ転送オーバーヘッドを削減する転送機能を新設した。
デコード統計とシーク機能の拡充
H.264 および HEVC におけるマクロブロック単位のデコード統計取得、MV-HEVC デコード時のビュー情報表示、および特定フレームへの正確なシーク機能を追加した。
開発環境とサンプルコードの刷新
公式 Docker ベースの開発環境を提供し、モジュール化されたキューベースアーキテクチャを採用した転送用サンプルアプリを再設計して公開した。
Bフレーム参照によるエンコード品質の向上
B-frames を参照として使用することでエンコード品質が向上する。階層型参照モードでは B-frames を木構造で配置し、NVENC の最大 B-フレーム数を 7 から 31 に引き上げることで時間的冗長性を活用できる。
重要な引用
Hierarchical Reference Mode improves it further by arranging B-frames in a tree-like reference structure
Application-allocated CUarray as NVIDIA Video Encoder (NVENC) input and NVIDIA Video Decoder (NVDEC) output
This structure increases NVENC's maximum number of B-frames from 7 to 31
Using B-frames as references improves encode quality.
編集コメントを表示
編集コメント
NVIDIA は動画処理のボトルネックとなる転送コストとエンコード画質の両面からアプローチし、生成 AI 時代のメディアインフラ基盤を強化した。特に AV1 の B フレーム数制限解除は、高品質なストリーミングやリアルタイム処理が必要な AI アプリケーションにとって無視できない進展である。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
業界全体で高品質な動画への需要が加速しており、没入型のストリーミング体験からリモートコラボレーション、生成 AI によるメディアツール、大規模なコンテンツ配信まで、あらゆる分野を支えています。
これらの体験の背後には、より高速で効率的かつ、複雑化するフォーマットやワークロードを処理できる動画パイプラインへの需要が高まっています。NVIDIA Video Codec SDK は、専用のハードウェアビデオエンジンを通じて GPU 加速による動画エンコードとデコードを提供し、開発者がこの課題に立ち向かうのを支援します。
NVIDIA Video Codec SDK のバージョン 13.1 が利用可能になりました。開発者には、最新の機能を動画パイプラインで活用し、リニューアルされたサンプルアプリを試していただき、NVIDIA Developer フォーラム でフィードバックを共有いただくことをお勧めします。
SDK 13.1 の新機能
エンコード機能:
・AV1 の階層参照モード(最大 31 枚の B フレーム対応)
・UHQ チューニング情報と反復的エンコードの組み合わせ
デコード機能:
・H.264 および HEVC 向けのマクロブロックごとのデコード統計
・MV-HEVC デコード時のビュー情報の表示
・特定のフレームへのシーク対応
トランスコード機能:
・アプリケーション側で割り当てた CUarray を、NVIDIA Video Encoder (NVENC) の入力および NVIDIA Video Decoder (NVDEC) の出力として使用可能
・モジュール化されキューベースのアーキテクチャを採用した、リニューアルされたトランスコーダーサンプル
その他の機能:
公式の Docker ベースの開発環境
エンコード機能の改善
なぜ AV1 の階層参照モードなのか
B フレームを参照フレームとして利用することでエンコード品質が向上します。階層参照モード(Hierarchical Reference Mode)は、この効果をさらに高めるために B フレームを木構造のような参照構造に配置します。具体的には、葉ノードが非参照の B フレーム、ルートノードが中間の B フレームとなります。この構造により、NVENC がサポートする最大 B フレーム数は 7 から 31 に増加し、エンコーダーは時間的な冗長性をより効果的に活用できるようになり、全体の画質が向上します。
このモードを使用してもパフォーマンスへのペナルティはありませんが、ビデオメモリの消費量は増大します。
image*図 1. B フレーム 15 枚を使用した階層参照構造の例*
SDK 13.1 では、AV1 に対して階層参照モードが追加され、B フレーム数として 1、3、7、15、31 がサポートされます。H.264 および HEVC については、今後のドライバーバージョンで対応予定となっています。このモードは B フレーム数が 7 つ以上の場合に最も効果が発揮され、パフォーマンスへの影響も最小限です。
設定の詳細については、『NVENC プログラミングガイド』をご参照ください。
図 2 は、プリセット p7 の NVENC High Quality(HQ)チューニングと比較して、定品質(CQ)モードで B フレームを 15 枚使用した場合のビットレート削減効果を示しています。
image*図 2. CQ モード – B フレーム 15 枚における階層参照モードのビットレート削減効果*
図 3 は、可変ビットレート(VBR)モードで B フレームを 15 枚エンコードした場合のビットレート削減効果を示しています。
image*図 3. VBR モード – 階層参照モードにおける B フレーム 15 枚でのビットレート削減効果*
イテレーティブエンコーディングによる UHQ チューニング情報
イテレーティブエンコーディングは Video Codec SDK 12.1 で導入された機能で、エンコーダーの自動状態進行を一時停止し、ユーザーが異なるパラメータで同じフレームを再エンコードできるようにします。NVENC は各イテレーションの状態を追跡しており、任意のステートを停止して確定することが可能です。
UHQ チューニング情報は Video Codec SDK 12.2 で導入され、ルックアヘッドレベルと時間フィルタリングを組み合わせることで、レイテンシ許容型のエンコーディングにおいて最適な品質とパフォーマンスのバランスを実現します。時間フィルタリングは、動き推定を用いて隣接フレームから類似するパッチを検出し、現在のフレームに適用することで自然動画のノイズを低減し、自然コンテンツに対して平均 4〜5% の符号化効率向上をもたらします。また、ルックアヘッドレベル機能は未来のフレームを分析し、符号化ツリーユニット(CTU)やその他の統計情報を用いてレート制御のためのビット配分を最適化します。現在、パフォーマンスと品質のトレードオフが異なる 4 つのルックアヘッドレベルをサポートしています。
バージョン 13.1 では、UHQ(Ultra High Quality)の調整情報を反復エンコードと組み合わせることで、ルックアヘッドレベルや時間フィルタリングが、反復ごとの再エンコード処理とも連携して動作するようになりました。
デコード機能の強化
マクロブロック単位のデコード統計情報
NVDECODE API は、H.264 および H.265(HEVC)コンテンツの各デコード済みフレームに対して、詳細なマクロブロック単位のデコード統計情報を取得できるようになりました。16×16 のブロックごとに、輝度量子化パラメータ(QP)、コーディングユニットタイプ(Intra、Inter、Skip、または PCM)、そして最大 2 つの動きベクトル(順方向と逆方向)が、ハードウェアデコードに伴う自然な副産物として抽出されます。これにより、追加の CPU オーバーヘッドなしでこれらの情報を取得可能です。
これらの統計情報は、これまで CPU 側でのビットストリーム解析を必要としていた GPU アクセラレーション対応のビデオ分析ワークフローを実現します。動きベクトルを用いることで、シーン変化の検出、オブジェクト追跡、ショット境界の分析が可能になります。QP 値は、ブロックごとのエンコード品質を示すため、適応的ビットレート最適化や品質モニタリングに役立ちます。また、マクロブロックタイプを解析することでコンテンツ分類や圧縮研究に有用なコーディング構造を把握できます。
処理フローはシンプルです。アプリケーションは cuvidGetDecoderCaps() を通じてデコーダーの機能を照会し、デコーダー作成時に統計情報の収集を有効化します。その後、cuvidMapVideoFrame() によって各フレームごとに GPU 上に格納された統計バッファを取得できます。ユーザーはこの統計情報をホストメモリへコピーするか、CUDA カーネルで直接 GPU 上で処理してリアルタイムパイプラインを実現することも可能です。SDK にはこの一連の流れを示すサンプル「AppDec -dumpstats」が同梱されています。
フレーム単位でのシーク
AI ワークフローでは、物体検出やコンテンツモデレーション、動画要約のための推論パイプラインや、大規模データセットから多様なフレームをサンプリングするトレーニングデータの準備などにおいて、連続的なデコードではなく特定のフレームが必要になるケースが頻繁に発生します。
動画編集やノンリニアなポストプロダクションでも同様の要件があります。Video Codec SDK では、NvVideoDecoder クラスを通じて包括的なシークおよびランダムフレームアクセス API を提供しており、必要なフレームのみを取得しながら、フレーム単位でのアクセスを配列のインデックス指定のように簡単に実現できます。
この機能は GOP 認識型のシークアーキテクチャによって支えられています。対象となるフレーム N の場合、SDK はその手前にある最も近い IDR フレームを検索し、デマルチプレクサをそこへシークします。その後、CUVID_PKT_DISCONTINUITY を介してデコーダーの状態をフラッシュ処理します。
IDR フレーム以降、N に到達するために必要なフレームのみが処理されます。パーサーは非参照フレームをフラグ付けしてスキップし、参照フレームはデコードされますが、PTS ベースのフィルタリングを通じてマッピングやポストプロセッシング(cuvidMapVideoFrame() を介したフォーマット変換、スケーリング、クロッピング)をバイパスします。フルなデコード、マッピング、ポストプロセッシングパイプラインを実行するのはフレーム N のみです。
image*図 4. 従来の逐次デコードと GOP 対応シークの比較*
NvVideoDecoder クラスは、低レベルの SeekUtils エンジンをラップし、クリーンで演算子ベースのインターフェースを公開しています。以下の図 5 は、フレームの要求時に内部で行われるシークフローを示しています。
image*図 5. フレーム N の取得(decoder[N])におけるシークフロー*
主な機能:
- プレイリスト用のデコーダーキャッシュ:NvVideoDecoder は、コーデック、ビット深度、クロマフォーマットごとにデコーダーインスタンスをキャッシュし、LRU(Least Recently Used)方式で.eviction して再利用します。これにより、繰り返しの作成オーバーヘッドを回避できます。
- シーク不可ストリーム:エレメンタリストリーム、ネットワークストリーム、パイプは自動検出されます。前方シークは効率的に動作し、後方シークもデコーダーの自動リセットをサポートしています。
- 柔軟なフレーム指定:AppDecVideoDecoder サンプルでは、個々のインデックス(0,10,20)、ステップ付きの範囲(0:100:10)、時間ベースのアクセス(-t 1.5,3.0)、バッチ処理用のプレイリストファイルに対応しています。
Open GOP のサポートが強化されました。非 IDR I フレームを含むストリームのシーク時に、最も近いキーフレームではなく、最も近い IDR フレームへ移動します。これにより、参照フレームがすべて利用可能になり、再生の安定性が確保されます。
MV-HEVC による立体映像(3D ビデオ)のサポートも改善されました。デコーダーからビュー ID やレイヤーメタデータを取得できるようになったほか、高解像度でのマルチ GPU エンコーディングに対応し、サードパーティ製ソフトウェアとの互換性も向上しています。
MV-HEVC デコード機能のアップデート内容は以下の通りです。
- ビュー情報の報告:デコーダーが nuh_layer_id などの特定のレイヤーおよび参照情報を出力するため、アプリケーション側でビューごとにフレームを識別してルーティングし、立体映像処理が可能になります。
- より広範なビットストリーム対応:サードパーティ製エンコーダーで作成された MV-HEVC 3D ビットストリームもデコードできるようになり、左右のビューが正しく再生されます。
MV-HEVC エンコード機能のアップデート内容は以下の通りです。
- FFmpeg 用メタデータの簡素化:FFmpeg を介してエンコードする際、HEVC 3D の表示メタデータがビットストリーム内に正しく記述されるようになりました。これにより、3D ビデオの作成が容易になります。
- スプリットフレームエンコーディング(SFE):1 つのフレームを複数のエンコーダーで並列処理できるため、単一のエンコーダーでは処理しきれない高解像度の 3D や XR 動画のエンコード速度が大幅に向上します。
トランスコーダーパイプラインが再設計され、柔軟性、パフォーマンス、カスタマイズ性が重視されました。アップデートされたスイートには、以下の 4 つのアプリケーションが含まれています。
- AppTransPerf:NVDEC と NVENC の最大スループットをベンチマークするツール
- AppTrans:1:1 トランスコードに対応し、ビット深度変換もオプションで選択可能
- AppTransOneToN:1:N トランスコードとスケール処理に対応
AppTransZeroCopy(新機能):1:1 のゼロコピーによる純粋なトランスコードングに最適化され、可能な限り低いレイテンシを実現するアプリケーション
モジュラーでキューベースのアーキテクチャ
以前のバージョンは高速でしたが、単一の巨大なモノリス構造でした。ユーザーが修正を加えるにはパイプライン全体を理解する必要がありました。バージョン 13.1 では、サンプルを厳密にモジュール化され、キューベースのアーキテクチャへと再設計しました。これにより、並行処理の保証、カスタマイズの簡素化、そしてハードウェア利用率の最大化が可能になりました。
この再設計では、パイプラインの各ステージごとに専用の CPU スレッドが割り当てられ、生産者・消費者モデルとして動作します。スレッド間は、事前にサイズを指定した入力キューと出力キューを通じて通信を行います。コアとなる AppTrans パイプライン(図 6)は、4 つの独立した実行コンテキストに分割されます。
- Decode Thread (NVDEC): デマルチプレックスとデコードを担当
- Compute Thread (CUDA): 処理を担当
- Encode Thread (NVENC): エンコードを担当
- Output Thread: 出力の収集とマultiplexing を担当
各スレッドは単一のステップに特化し、同期をネイティブで処理できる疎結合な設計を実現しています。フレームはキューを通じて順次通過するため、安全なデータフローが保証されます。
image*図 6. AppTrans のモジュラー再設計。各スレッドがパイプラインのステップを実装し、入力および出力キューを介して次のステップと接続されています。緑色のブロックは GPU への作業送信を、青色のブロックは CPU への作業送信を示します*
再設計による主な利点
モジュール性:必要なパイプラインステップのみをコピーして調整できます。コンポーネントが独立しているため、エラーや例外はそれぞれのスレッド内に閉じ込められます。
パフォーマンス:パイプラインの各ステップ間で完全な並行処理が保証されます。CPU の送信スレッドを分離することで、GPU が常に稼働状態を維持します。一度飽和すると、ハードウェアエンジン(NVDEC、CUDA、NVENC)は異なるフレーム上でそれぞれのステージを並列実行します。
カスタマイズ性:独立したキューにより、完全な制御が可能になります。エンコードのみが必要なら、デコードスレッドを削除して計算とエンコードのキューに直接データを流し込みます。スループットよりも超低遅延を重視する場合は、キューサイズを小さくしてバッファ待ち時間を最小化します。独自の AI フィルタを実装したい場合も、デコーダーやエンコーダーのスループループをブロックすることなく、CUDA カーネルを独立した計算スレッドで実行できます。
image*図 7. パイプラインステップ間の完全な並行処理*
CUarray を用いたゼロコピートランスコード
従来のトランスコードパイプライン(AppTrans など)では、デコードされたフレームがエンコーダーに到達するまでに、内部で複数のフォーマット変換とデータ転送を経由します。これは標準的な NvDecoder および NvEncoder API に inherent な仕様です。具体的には、デコーダーの出力がアプリケーションからアクセス可能なサーフェスに変換され、それをアプリケーション側でエンコーダーの入力バッファーへコピーし、さらにエンコーダー側で再度必要なフォーマットに変換するという流れになります。
AppTransZeroCopy は、NVDEC と NVENC が互いにネイティブに理解する形式で同じ GPU メモリ上で直接動作することで、このコピー連鎖を解消します。この仕組みは以下の 4 つの要素から構成されています。
- 共有バッファプール割り当て: アプリケーション起動時に、
cuArray3DCreateを用いて CUDA アレイ(CUarray)のプールを割り当てます。ここでCUDA_ARRAY3D_VIDEO_ENCODE_DECODEフラグを指定することで、CUDA ドライバに対してこれらのサーフェスが両方のビデオコーデックエンジン間で共有されることを通知します。各 CUarray は 1 フレーム分(輝度面と色度面)を保持し、NVDEC と NVENC の双方がネイティブにアクセスできる形式となっています。これにより、従来のパイプラインで必要だった中間変換を回避できます。
- デュアル登録: 同じ CUarray を両方のコーデックに登録します。デコーダ側では
SetExternalOutputArrays()を介して外部出力サーフェスとして提供され、NVDEC が復号したフレームを直接これらに書き込むよう指示されます。エンコーダ側では、リソースタイプをNV_ENC_INPUT_RESOURCE_TYPE_CUDAARRAYとしてnvEncRegisterResourceAPI を呼び出すことで入力リソースとして登録し、エンコーダが変換なしで直接読み込めるようにします。
- パイプライン実行: デコード、エンコード、出力の 3 つのスレッドが、トークンベースのフロー制御を備えた並列キューを通じて接続され、デコーダとエンコーダ間での CUarray の所有権管理を行います。
- ストリーム順序同期: NVDEC と NVENC は同じ CUDA ストリームを共有するため、明示的な CPU-GPU 間の同期を行わずとも、デコードによる書き込みとエンコードによる読み込みの順序が正しく保証されます。
Key advantages
SM の利用率低下:従来のパイプラインでは、ストリーミングマルチプロセッサ(SM)上で複数の CUDA コピー変換カーネルを逐次実行し、フレームを各ステージ間で転送していました。ゼロコピー方式はこの中間処理用カーネルを排除するため、SM リソースを CUDA 前処理、推論、または描画に回すことができます。
GPU メモリ使用量の削減:従来のパイプラインでは各ステージで独立したバッファを確保していましたが、ゼロコピー方式ではこれらを単一の共有プールに統合します。その結果、セッションあたりのメモリ消費量が大幅に減少します。
並列セッションでのスループット向上:SM 利用率の低下とメモリ使用量の削減により、スケーラビリティが向上します。GPU は SM の飽和やメモリの枯渇を起こす前に、より多くの同時トランスコードセッションを維持できるようになります。
以下の図 8 は、新サンプルアプリケーション「AppTransZeroCopy」と従来型の「AppTransPerf」を比較した SM 利用率を示しています。
image*図 8. 1080p H.264 の SM 利用率(%)。従来のパイプラインとゼロコピー方式の比較*
以下の図 9 は、新サンプルアプリケーション「AppTransZeroCopy」と従来型の「AppTransPerf」を比較したビデオメモリ帯域幅利用率を示しています。
image*図 9. 1080p H.264 のメモリ帯域幅利用率(%)。従来のパイプラインとゼロコピー方式の比較*
Docker 開発環境
従来の Video Codec SDK のセットアップでは、CUDA ツールキットや Vulkan SDK、システムライブラリ、FFmpeg をインストールし、サンプルをビルドする必要がありました。これらはホストのディストリビューションやドライババージョンが異なる環境で実行されることも多く、手間がかかるのが常でした。
Video Codec SDK 13.1 では、公式の Docker ベースの開発環境が導入されました。これは一貫性のある事前設定済みスタックを単一のコンテナにパッケージ化したものです。イメージはオープンソースの Dockerfile からビルドされるため、ローカルやクラウド環境で同じ環境を再現でき、ビルド引数を通じてカスタマイズも可能です。
このイメージは 2 つのステージを経て構築されます。1 つ目のビルダーステージでは SDK サンプルがコンパイルされ、Vulkan SDK と FFmpeg がインストールされます。2 つ目のランタイムステージでは、実行と開発に必要な最小限の構成のみが残されます。スタックには CUDA 12.3.2、Vulkan SDK 1.4.304.1、Ubuntu 22.04 LTS が固定されています。
SDK_ZIP ビルド引数を使って Video_Codec_SDK_13.1.x.zip を指定し、オプションの FFMPEG_URL 引数でカスタム FFmpeg ターボール(例えば NVENC 対応の LGPL バージョン)をデフォルトの BtbN LGPL バージョンに代えて供給することもできます。
コンテナ内では、/video-codec-sdk/Samples/build/ に事前ビルド済みのサンプルが配置されています。AppDec や AppEncCuda などがあり、テストベクトルを使ってすぐに実行可能です。FFmpeg (LGPL) は /opt/ffmpeg にインストールされており、YUV の生成や MJPEG/MPEG エンコード、エンコードストリームの検査に利用できます。
テストベクタースクリプトは、複数の形式の生 YUV、JPEG、MPEG-1/2/4 を生成します。GPU へのアクセス権限があれば AppEncCuda を使用して H.264 や HEVC も出力可能で、パイプライン全体を網羅的に検証できます。コンテナは非ルートユーザーとして実行され、オーケストレーター向けのヘルスチェック機能も備えています。
事前準備
- ビデオエンコード・デコード対応の NVIDIA GPU
- GPU サポート有効化済みの Docker
- NVIDIA Container Toolkit
- SDK パッケージファイル
SDK の zip ファイル(例:Video_Codec_SDK_13.1.x.zip)を Docker ビルドコンテキストに配置し、以下のようにビルドします。
cd ubuntu22.04
docker build -t nvidia/video-codec-sdk:13.1-ubuntu22.04 \
--build-arg SDK_ZIP=Video_Codec_SDK_13.1.x.zip \
.
GPU へのアクセス権限を付与して起動します。コンテナ起動時にテストベクターを生成するか、シェルを開くことができます。
原文を表示
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 theNVIDIA 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.

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 theNVENC 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 3, below, shows bitrate savings when encoding 15 B-frames in Variable Bitrate (VBR).

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.

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])](https://developer-blogs.nvidia.com/wp-content/uploads/2026/07/image10.webp)
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.
MV-HEVC decode updates:
- View-information reporting: The decoder outputs specific layer and reference info such as nuh_layer_id, letting applications identify and route frames by view for stereo handling
- Wider bitstream support: The decoder now handles MV-HEVC 3D bitstreams created by third-party encoders, so both left and right views play correctly
MV-HEVC encode updates:
- Simplified metadata for FFmpeg: HEVC 3D display metadata now appears correctly in the bitstream when encoding via FFmpeg, making 3D-video creation easier
- Split Frame Encoding (SFE): Multiple encoders can work on a single frame, boosting speed for high-resolution 3D and XR video that exceeds a single encoder’s capacity
Redesigned transcoder pipeline
The transcoding samples now favor flexibility, performance, and customization. The updated suite ships four applications:
- AppTransPerf. Benchmarks the maximum throughput of NVDEC and NVENC
- AppTrans. 1:1 transcoding with optional bit-depth conversion
- AppTransOneToN. 1:N transcoding with scaling
- AppTransZeroCopy (new). 1:1 zero-copy pure-transcoding application optimized for the lowest possible latency
Modular, queue-based architecture
The previous implementation was fast but monolithic: the user had to understand the entire pipeline before modifying it. Version 13.1 redesigns the samples around a strictly modular, queue-based architecture that guarantees concurrency, simplifies customization, and maximizes hardware utilization.
The redesign allocates a dedicated CPU thread per pipeline stage, operating as a producer-consumer system where threads communicate through explicitly sized input and output queues. The core AppTrans pipeline (Figure 6, below) breaks into four isolated execution contexts: a Decode Thread (NVDEC) handles demux and decode; a Compute Thread (CUDA) handles processing; an Encode Thread (NVENC) handles encode; and an Output Thread gathers output and muxes.

Each thread isolates one step, producing a decoupled design that handles synchronization natively. Frames pass through the queues sequentially, ensuring safe data flow.
Key advantages of the redesign
- Modularity: Copy and tweak only the pipeline steps you need. Decoupled components keep errors and exceptions isolated within their threads
- Performance: Full concurrency between pipeline steps is guaranteed. Separating the CPU submission threads ensures the GPU is never starved; once saturated, the hardware engines (NVDEC, CUDA, NVENC) run their stages in parallel on different frames
- Customizability: Decoupled queues give you total control. Need encoding only? Remove the decode thread and feed the compute and encode queues directly. Want ultra-low latency over throughput? Reduce queue sizes to minimize buffer wait. Have a custom AI filter? Modify the Compute Thread to dispatch your CUDA kernels in isolation, without blocking the decoder or encoder submission loops

Zero-copy transcode with CUarray
In a traditional transcoding pipeline (as in AppTrans), the decoded frame passes through multiple internal format conversions and copies before reaching the encoder. These are inherent to the standard NvDecoder and NvEncoder APIs. The decoder output converts into an application-accessible surface; the application copies it into the encoder’s input buffer; the encoder converts that input again into its required format.
AppTransZeroCopy eliminates this copy chain by having NVDEC and NVENC operate directly on the same GPU memory in a format both engines understand natively. The mechanism has four parts:
- Shared buffer pool allocation: At startup, the application allocates a pool of CUDA arrays (CUarray) using cuArray3DCreate with the CUDA_ARRAY3D_VIDEO_ENCODE_DECODE flag, which tells the CUDA driver these surfaces will be shared between both video-codec engines. Each CUarray holds one frame (luma plus chroma planes) in a format both NVDEC and NVENC access natively, bypassing the traditional pipeline’s intermediate conversions.
- Dual registration: The same CUarray register with both codecs. On the decoder side, they are provided as external output surfaces via SetExternalOutputArrays(), telling NVDEC to write decoded frames directly into them. On the encoder side, they register as input resources via NVENC’s nvEncRegisterResource API with resource type NV_ENC_INPUT_RESOURCE_TYPE_CUDAARRAY, letting the encoder read them directly without input conversion.
- Pipelined execution: Three threads—decode, encode, and output—connect through concurrent queues with token-based flow control to manage CUarray ownership between decoder and encoder.
- Stream-ordered synchronization: NVDEC and NVENC share the same CUDA stream, guaranteeing correct ordering between decode writes and encode reads without explicit CPU-GPU synchronization.
Key advantages
- Lower SM utilization: The traditional pipeline uses multiple CUDA copy and conversion kernels on Streaming Multiprocessors to shuttle frames between stages. Zero-copy eliminates these intermediate kernels, freeing SM resources for CUDA preprocessing, inference, or rendering
- Reduced GPU memory footprint: The traditional pipeline keeps separate buffers at each stage. Zero-copy collapses these into a single shared pool, significantly reducing per-session memory consumption
- Higher throughput with concurrent sessions: Lower SM utilization plus a smaller memory footprint improve scalability. The GPU can sustain more concurrent transcode sessions before hitting SM saturation or memory exhaustion
Figure 8, below, shows lower SM utilization in the new AppTransZeroCopy sample application compared to legacy AppTransPerf sample application.

Figure 9, below, shows lower video memory bandwidth utilization in the new AppTransZeroCopy sample application compared to legacy AppTransPerf sample application.

Docker development environment
Setting up the Video Codec SDK traditionally requires installing the CUDA toolkit, Vulkan SDK, system libraries, and FFmpeg, then building the SDK samples—often across different host distributions and driver versions. Video Codec SDK 13.1 introduces an official Docker-based development environment that packages a consistent, pre-configured stack into a single container. The image builds from an open Dockerfile, so you can reproduce the environment locally or in the cloud and customize it via build arguments.
The image is built in two stages: a builder stage compiles the SDK samples and installs the Vulkan SDK and FFmpeg; the runtime stage keeps only what is needed to run and develop. The stack pins CUDA 12.3.2, Vulkan SDK 1.4.304.1, and Ubuntu 22.04 LTS.
Use the SDK_ZIP build argument to point at Video_Codec_SDK_13.1.x.zip, and the optional FFMPEG_URL argument to supply a custom FFmpeg tarball (for example, an LGPL build with NVENC) instead of the default BtbN LGPL build.
Inside the container, pre-built samples live in /video-codec-sdk/Samples/build/, including AppDec and AppEncCuda, ready to run with test vectors. FFmpeg (LGPL) is installed at /opt/ffmpeg for YUV generation, MJPEG and MPEG encoding, and inspection of encoded streams.
A test-vector script produces raw YUV in multiple formats, JPEG, MPEG-1/2/4, and — with GPU access — H.264 and HEVC using AppEncCuda, so you can exercise the full pipeline. The container runs as a non-root user and includes a HEALTHCHECK for orchestrators.
Prerequisites
- an NVIDIA GPU with video encode/decode support
- Docker with GPU support enabled
- the NVIDIA Container Toolkit, and
- the SDK package file
Place the SDK zip (for example, Video_Codec_SDK_13.1.x.zip) in the Docker build context and build:
cd ubuntu22.04
docker build -t nvidia/video-codec-sdk:13.1-ubuntu22.04 \
--build-arg SDK_ZIP=Video_Codec_SDK_13.1.x.zip \
.
Launch with GPU access. You can generate test vectors at startup or open a shell an
関連記事
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み