Repository navigation
Releases: hamr-hub/jetson-ffmpeg-tutorial
Releases · hamr-hub/jetson-ffmpeg-tutorial
Release list
v1.0.0 — Initial release for FFmpeg on Jetson Orin (L4T r36.4)
v1.0.0 — Initial release
Tested with FFmpeg git-2026-09-15-aa63c63 on:
- Jetson Orin (t234)
- L4T 36.4.7 (JetPack 6)
- Ubuntu 22.04.5 LTS
- CUDA 12.6.68
- Driver 540.4.0
What's included
scripts/build.sh— one-shot apt + configure + make + installscripts/rebuild.sh— incremental rebuild after source editsscripts/ffmpeg-gpu-decode.sh— end-to-end GPU decode wrapperscripts/libv4l2_shim.c— LD_PRELOAD shim for v4l2 interceptionpatches/00-jetson-v4l2-m2m.diff— three source patches to upstream FFmpeg:- extend
/dev/v4l2-*device scan - replace probe
VIDIOC_TRY_FMTwithVIDIOC_S_FMT - use
V4L2_MEMORY_DMABUFfor buffer allocation
- extend
docs/build.md— full build walk-throughdocs/gpu-integration.md— how the shim worksdocs/comparison.md— why the wrapper, not directffmpeg -c:v h264_v4l2m2mdocs/troubleshooting.md— common errors and fixes
What works
- All 10 CUVID decoders + 3 NVENC encoders + 9 v4l2m2m decoders + 5 v4l2m2m encoders are compiled in.
hwaccelsshowscudaanddrm.- The LD_PRELOAD shim + patches let
ffmpegopen/dev/v4l2-nvdecand reachNvMMLiteBlockCreate : Block : BlockType = 261(Jetson NVDEC session creation). - End-to-end GPU decode via
ffmpeg-gpu-decode.sh(gstreamernvv4l2decoder→ ffmpeg): 141 frames at 1366×768 decode in ~3 s on the integrated NVDEC.
Known limitations
h264_cuviddoes not work on Jetson: L4T shipslibnvcuvidv4l2.so, but FFmpeg'scuvidglue expectslibnvcuvid.so.1(incompatible ABIs).h264_nvencdoes not work with FFmpeg ≥ 7.x: those releases require driver ≥ 610 for NVENC API; L4T 36.4 ships 540.4.0. Uselibx264or pin FFmpeg to 6.1.- Direct
ffmpeg -c:v h264_v4l2m2m -i in.mp4 -frames:v 30 out.mp4does not produce frames despite the patches + shim: the Jetsonlibv4l2_nvvideocodecplugin accepts REQBUF but QUERYBUF fails. Useffmpeg-gpu-decodeinstead. scale_cudaand other CUDA filters fail withCUDA_ERROR_OUT_OF_MEMORYbecauseNvMapallocation requires privileges not granted to non-root users on r36.4.
See docs/comparison.md for the full design rationale.