3
  • I want to run ZoneMinder on Jetson-nano as an IP CAM server, but it seems that Jetson nano can not handle many cams which are using ffmpeg for decoding.

  • If I open three cams on ZoneMinder, CPU usage is always 100%, but GPU usage is 0%, and I can not open more cams.

FFMPEG without hardware acceleration?

In this discussion, the NV Moderator said that

ffmpeg with GPU support is not enabled on Jetson platform ...

I know that NVENC/NVDEC can help ffmpeg hardware acceleration, but these hardware blocks are being now executed on CPU, not on the GPU.

Custom FFMPEG for jetson-nano don't support GPU acceleration?

I found this jetson-ffmpeg repo, can this repo use GPU acceleration? Because I tried but didn't work (still using NVENC/NVDEC acceleration of CPU).

If GPU on Jetson nano is sure that can not support ffmpeg acceleration, but I want to use ZoneMinder, is there a better way to solve this problem? e.g. using GStreamer?

imbr
  • 6,226
  • 4
  • 53
  • 65
Vincent_Wang
  • 71
  • 1
  • 7
  • Isn't NVENC a feature of the *GPU*? Did you see [this issue](https://github.com/jocover/jetson-ffmpeg/issues/42)? – Hernán Alarcón Aug 19 '20 at 03:09
  • In [this](https://forums.developer.nvidia.com/t/ffmpeg-using-hardware-gpu-cuda/72312/13) discussion, it is confirmed that NVENC is not a feature of the GPU on Jetson platform. – Vincent_Wang Aug 20 '20 at 02:54
  • jetson-nano has specify hardware for decoding video like `MPEG2, H.264/AVC, HEVC, VP8 and VP9` formats, [look bellow](https://stackoverflow.com/a/70611629/1207193). Don't need to use GPU for that! – imbr Jan 06 '22 at 18:20

2 Answers2

4

ffmpeg support has been added to the Jetson platform. From nvidia's docs:

To install the ffmpeg binary package
•Enter these commands:
$ sudo apt install ffmpeg

To get source files for the ffmpeg package
•Enter this command:
$ apt source ffmpeg

To include the ffmpeg library in L4T builds
1.Add the following lines to /etc/apt/sources.list:
$ echo "deb https://repo.download.nvidia.com/jetson/ffmpeg main main" |  sudo tee -a /etc/apt/sources.list
$ echo "deb-src https://repo.download.nvidia.com/jetson/ffmpeg main main" |  sudo tee -a /etc/apt/sources.list
2.Enter the command:
$ sudo apt update

To be clear, on the standard Jetson image, append

deb https://repo.download.nvidia.com/jetson/ffmpeg main main

to your /etc/apt/sources.list file, and then run sudo apt update && sudo apt install ffmpeg .

Simon Labrecque
  • 577
  • 7
  • 15
  • 1
    Note that they've only integrated ffmpeg decode support. The patched ffmpeg github repo mentioned in the original question also supports hardware encoding on the jetson. – gps Feb 16 '21 at 05:52
0

Use (jetson-ffmpeg) a ffmpeg patched for jetson-nano

  • Jetson nano don't need to use GPU for hardware decoding MPEG2, H.264/AVC, HEVC, VP8 and VP9.

  • Those formats are decoded by specific video hardware decoder (NVDEC) that can be accessed by L4T Multimedia API that patches the ffmpeg above. That hardware is separated from GPU that can be used by you for other purposes.

  • You can also use @Simon Labrecque answer if you don't plan using encoding. Although I still prefer the first.

Command line hardware decoding jetson-ffmpeg

You did something wrong with the above ffmpeg. To use hardware decoding you have to specify the decoder. From their repo README some examples.

  • For decoding a H.264 stream/file ffmpeg -c:v h264_nvmpi -i yourfile\or\stream...

  • For decoding a HEVC stream/file ffmpeg -c:v hevc_nvmpi -i yourfile\or\stream....

ZoneMinder

I don't use Zoneminder but MotionProject that also uses ffmpeg as a backend library. I have been using 4 IP Cameras without problems for some months already. CPU usage around 20% for 8 RTSP streams (high and low resolutions).

For ZoneMinder I am not sure but I think that DecoderHWAccelName, DecoderHWAccelDevice parameters should do the trick. Specifying for example h264_nvmpi or nvmpi or whatever needed for your stream. But I can't be precise though because I don't use it anymore. Try their docs look for those parameters on adding-monitors section.

imbr
  • 6,226
  • 4
  • 53
  • 65