HW encode/decode in docker

Hello, is it possible to use HW encode/decode inside docker container with nvidia-docker2?

I use TX2 L4T R32.4.3. Jocover’s FFMPEG works fine in root system, but I cannot get it compile inside docker.

If I try to install to instal l4t-multimedia package inside docker I get:

dpkg: error processing archive /var/cache/apt/archives/nvidia-l4t-core_32.4.4-20201016123640_arm64.deb (--unpack):
unable to make backup link of './usr/lib/aarch64-linux-gnu/tegra/libnvddk_vic.so' before installing new version: 
Invalid cross-device link
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)

That mean some files are already linked to container by nvidia-docker2 runtime.

If I copy source files from host:

docker cp /usr/src/jetson_multimedia_api Zoneminder:/usr/src/jetson_multimedia_api

I can pass trough first build but second end in configure with:

./configure --enable-nvmpi
ERROR: nvmpi not found using pkg-config

My docker Run command contain:

--runtime=nvidia \
-e NVIDIA_VISIBLE_DEVICES=all \
-e NVIDIA_DRIVER_CAPABILITIES=compute,utility,video

Hi,
We have a package enabling hardware decoding. Please check if you can build it:


Reference post for downloading and building the source code:

Hello @DaneLLL,

I tried both, Jcover’s ffmpeg and also one provided by you. Both can sucesfully decode video by:

    ffmpeg -c:v h264_nvmpi -i 1.mp4 -f null -
    ffmpeg -c:v h264_nvv4l2dec -i 1.mp4 -f null -

Problems come when I want to use them with rtsp stream in Zoneminder

avcodec_find_decoder_by_name("h264_nvv4l2dec")

I get following errors:

Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession

I tried:

sudo nvpmodel -m 0 
sudo jetson_clocks

Suggested here, but it did not help.

1 Like

Hi @skala.antonin
The issue looks different from this topic. For clearness, please make a new topic. Thanks.