bluecherrydvr / bluecherry-apps

Bluecherry surveillance system (server application)
http://www.bluecherrydvr.com
GNU General Public License v2.0
216 stars 68 forks source link

Re-encoding not working with Nvidia Graphic card #462

Open tegiac97 opened 3 years ago

tegiac97 commented 3 years ago

OS: Ubuntu 18.04LTS Nvidia Driver version: 395, 460, 465 (GTX 050TI (GP107) card) Bluecherry version: 3.0.6 (latest). I tried running the re-encoding with the ffmpeg command: ffmpeg -hwaccel vdpau -i input.mp4 output.ts and it works with both VAAPIand VDPAUvalue. The av_hwdevice_ctx_create function in vaapi.cpp file returns "Input/output error" with AVHWDeviceTypeof AV_HWDEVICE_TYPE_VAAPIand returns "Cannot allocate memory" with other types. How can I run re-encoding with that graphic card?

iNotMario commented 3 years ago

I suspect you need to make sure /dev/dri/renderD* device is r/w-able by bluecherry user.

To use VAAPI with nvidia, make sure you have the libva-vdpau-driver adapter. Sounds like you already have that if ffmpeg seemed to work.

hongson23 commented 3 years ago

hello, I have the same issue, How to check /dev/dri/renderD* device is r/w-able by bluecherry user?

iNotMario commented 3 years ago

You have to run something like $ su bluecherry -s /bin/bash -c 'touch /dev/dri/renderD128 || echo Not Permitted'

If it says not permitted, you need to change the permissions of the device; $ chgrp video /dev/dri/renderD128 $ chmod g+rw /dev/dri/renderD128

Most of the time this isn't necessary, except for people using containers.

tegiac97 commented 3 years ago

@iNotMario Thank you for your interest! This command: su bluecherry -s /bin/bash -c 'touch /dev/dri/renderD128 || echo Not Permitted' not working because bluecherry user not set password, I can't access bin/bash. Should be replaced with su - bluecherry command from root (sudo -i). I tried touch /dev/dri/renderD128 || echo Not Permitted command, it show nothing. I tried the following 2 commands but it still doesn't work :)) Do you have any more suggestions? @iNotMario System log in webserver show: VAAPI device is not initialized!