Compile FFmpeg with NVENC/NVDEC on NVIDIA Jetson AGX Orin 64GB
These articles are AI-generated summaries. Please check the original sources for full details.
Building Hardware-Accelerated FFmpeg on NVIDIA Jetson AGX Orin 64GB
Sergio Andres Usma published a comprehensive walkthrough for installing FFmpeg with NVENC/NVDEC support on an NVIDIA Jetson AGX Orin 64GB. The guide targets JetPack 6.2.2 with CUDA 12.6 and demonstrates compilation using all 12 ARMv8 CPU cores.
Why This Matters
Stock FFmpeg from Ubuntu repositories forces video encoding/decoding onto ARM CPU cores via software codecs like libx264, wasting the dedicated hardware video codecs and Ampere GPU on Jetson. By compiling from source with NVENC/NVDEC, the ARM CPU is freed entirely for application logic, which is critical for edge deployments running multi-agent analytics or real-time AI pipelines.
Key Insights
- NVENC/NVDEC offload: Compiling FFmpeg with —enable-cuda-nvcc and —enable-nvenc ensures video tasks use Jetson’s dedicated hardware, not CPU cores.
- JetPack 6.2.2 integration: The configure script uses explicit paths /usr/local/cuda/include and /usr/local/cuda/lib64 for CUDA 12.6 and cuDNN 9.3.0.
- Performance ceiling: The AGX Orin 64GB module is capable of >30 concurrent 1080p@30 FPS streams when using NVIDIA DeepStream SDK instead of FFmpeg for AI analytics.
- Verification method: Run ffmpeg -encoders | grep nv and ffmpeg -decoders | grep nv to confirm h264_nvenc, hevc_nvenc, and cuvid decoders are present.
Working Examples
Install system dependencies and NVIDIA codec headers globally
sudo apt update && sudo apt install -y build-essential yasm cmake libtool libc6 libc6-dev unzip wget git
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers
sudo make install
cd ..
Clone FFmpeg and configure with CUDA 12.6 paths and hardware acceleration flags
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg/
cd ffmpeg
./configure \
--enable-cuda-nvcc \
--enable-cuvid \
--enable-nvenc \
--enable-nvdec \
--enable-libnpp \
--extra-cflags="-I/usr/local/cuda/include" \
--extra-ldflags="-L/usr/local/cuda/lib64" \
--enable-nonfree \
--enable-gpl
Compile using all 12 ARMv8 CPU threads and install the binary
make -j12
sudo make install
Verify that NVIDIA hardware encoders (NVENC) and decoders (NVDEC/cuvid) are available
ffmpeg -encoders | grep nv
ffmpeg -decoders | grep nv
Practical Applications
- Batch transcoding: Use FFmpeg to convert 4K H.265 RTSP streams from IP cameras to H.264/HLS for web delivery. Pitfall: using stock FFmpeg without hardware acceleration forces CPU-only encoding, causing frame drops on high-bitrate streams.
- Real-time AI analytics: Switch to NVIDIA DeepStream SDK for object tracking or ANPR. Pitfall: trying to run inference inside FFmpeg pipelines instead of DeepStream leads to host-to-device memory serialization bottlenecks, losing the zero-copy advantage.
References:
Continue reading
Next article
...
Related Content
NVIDIA Releases Nemotron Speech ASR: Low-Latency Speech Recognition
NVIDIA released Nemotron Speech ASR, an open-source transcription model achieving approximately 7.84% WER at a 0.16s chunk size for low-latency applications.
MySQL 8.4 Performance Tuning Guide: Achieve Over 99% Buffer Pool Hit Ratio
Boost production database speed by tuning innodb_buffer_pool_size (70‑80% RAM), using composite indexes, enabling slow query log (<0.5s), and leveraging Performance Schema — all without new hardware.
Custom Policy Enforcement with Reasoning: Faster, Safer AI Applications
NVIDIA’s Nemotron Content Safety Reasoning achieves 40% faster policy enforcement with dynamic, context-aware AI safety.