nvidia accelerated decoder #1375
Replies: 7 comments
-
Please upload your compile logs |
Beta Was this translation helpful? Give feedback.
-
Ah, I see you are using the deb version. You'll have to try to compile motion from sources and specify the location of your accelerated ffmpeg libs |
Beta Was this translation helpful? Give feedback.
-
Where would have to specify the location of the libs? Is this really necessary? Thought it should be enough to have the ffmpeg libs replaced. Mine are in /usr/lib. Well, when trying to build, despite the packages being installed, configure complains about ffmpeg not being installed: configure: error: Required ffmpeg packages 'libavutil-dev libavformat-dev libavcodec-dev libswscale-dev libavdevice-dev' were not found. Please check motion_guide.html and install necessary dependencies or use the '--without-ffmpeg' configuration option. apt install libavutil-dev libavformat-dev libavcodec-dev libswscale-dev libavdevice-dev |
Beta Was this translation helpful? Give feedback.
-
You can compile ffmpeg locally and then you will be able to specify lib and headers location. Follow this example: https://github.com/tosiara/motion/wiki/ffmpeg |
Beta Was this translation helpful? Give feedback.
-
Managed to build motion myself, but unfortunately this did not change anything. I also tried to add AV_CODEC_CAP_DR1 to the decoders capabilities, despite to this not really making sense (in the hope the decoder is ignored somehow due to the missing capability mentioned in the documentation), but also no change. What might cause avcodec_find_decoder_by_name to refuse finding the existing and otherwise (with commandline ffmpeg and mpv) operational decoder? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Just to comment you are missing something. As @tosiara said you are not installing the jetson-ffmpeg properly. And then not pointing to the installed libraries of ffmpeg. My 2 cents:
Just found that for motion better use |
Beta Was this translation helpful? Give feedback.
-
I have tried to enable nvidia hardware decoding on nvidia jetson for a rtsp stream with nvidias accelerated ffmpeg package using:
netcam_decoder hevc_nvmpi
This failes with:
[3:ml3] [INF] [NET] [Jul 12 18:04:15] netcam_rtsp_open_context: High resolution: Opened camera((null))
[2:av0] [ERR] [NET] [Jul 12 18:04:15] netcam_rtsp_decoder_error: Normal resolution: avcodec_find_decoder_by_name: Failed,Interrupt False
[2:av0] [NTC] [NET] [Jul 12 18:04:15] netcam_rtsp_decoder_error: Normal resolution: Ignoring user requested decoder hevc_nvv4l2dec
[2:ml2] [INF] [ENC] [Jul 12 18:04:15] ffmpeg_avcodec_log: deprecated pixel format used, make sure you did set range correctly
The documentations says "Users can find the names of the decoders on their system by going to a command prompt and typing ffmpeg -decoders and looking for the name of the decoder with a 'D' next to it and correlating this with the type of image provided from the camera."
Well, the decoder does not have the D next to it, "ffmpeg -decoders | grep hevc" shows:
VFS..D hevc HEVC (High Efficiency Video Coding)
V..... hevc_v4l2m2m V4L2 mem2mem HEVC decoder wrapper (codec hevc)
V..... hevc_nvv4l2dec hevc (nvv4l2dec) (codec hevc)
Using "netcam_decoder hevc" or no setting works, but obviously uses no hardware acceleration.
Maybe this is the reason it does not work with motion. However, calling ffmpeg manually works and uses acceleration:
ffmpeg -c:v hevc_nvv4l2dec -i rtsp://user:Pass@192.168.XXX.XXX:554/1/h264major test.avi
Same happens with a custom compiled ffmpeg as described in https://github.com/jocover/jetson-ffmpeg and using hevc_nvmpi for the netcam_decoder option. This decoder also does not show a "D" aka "direct rendering method 1"
I am unsure why we need (do we?) direct rendering here.
What can be done to get acceleration to work?
Beta Was this translation helpful? Give feedback.
All reactions