Ffmpeg failed to decode with h264_nvv4l2dec, Segmentation fault!

I compiled and installed FFmpeg using the NVIDIA FFmpeg source code.

ffmpeg version 4.4-1-2-g911d118cde-1ubuntu0.1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
configuration: --prefix=/opt/ffmpeg_jetson --enable-nvv4l2dec --enable-nvmpi --enable-libv4l2 --enable-shared --extra-libs=‘-L/usr/lib/aarch64-linux-gnu/tegra -lv4l2 -lnvbufsurface -lnvbuf_utils -lnvbufsurftransform’ --extra-cflags=-I/usr/src/jetson_multimedia_api/include/ --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-libaom --enable-libass --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-openal --enable-opengl --enable-sdl2 --enable-libdrm --enable-libx264 --enable-shared --extra-cflags=‘-I /usr/src/jetson_multimedia_api/include/’
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘input.mp4’:
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
Duration: 00:00:58.97, start: 0.000000, bitrate: 2792 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 2736 kb/s, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 48 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
File ‘output.yuv’ already exists. Overwrite? [y/N] y
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NvMMLiteBlockCreate : Block : BlockType = 261
Stream mapping:
Stream #0:0#0:0 (h264 (h264_nvv4l2dec) → rawvideo (native))
Press [q] to stop, [?] for help
Segmentation fault (core dumped)

Hi,
Please share which Jetpack version you are using. ffmpeg 4.4.2 is for Jetpack 6 Orin series.

R35 (release), REVISION: 5.0, GCID: 35550185, BOARD: t186ref, EABI: aarch64, DATE: Tue Feb 20 04:46:31 UTC 2024.
nvidia-l4t-core 35.5.0-20240219203809.
The two above methods cannot definitively determine the version. Please provide a command to check the version.
I am using the Jetson Xavier NX series.

Hi,
We can run the commands successfully on clean Jetpack 5.1.3:

$ sudo apt update
$ sudo apt install nvidia-l4t-jetson-multimedia-api
$ sudo apt install ffmpeg=7:4.2.7-nvidia
$ ffmpeg -c:v h264_nvv4l2dec -i /home/nvidia/test.mp4 a.yuv

Please give it a try. If you still hit failure, please re-flash the system and try again.

Is this the only version that supports hardware decoding? Are other versions or source compilations not capable of it? And this version doesn’t include a hardware encoder.

Hi,
This is the version for Jetpack 5 and hardware decoding is supported.

If you need hardware encoding, we suggest use jetson_multimedia_api. The samples are installed to

/usr/src/jetson_multimedia_api

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.