is CUDA HW Acceleration working?

  • Hi, A couple of days ago I set up the CUDA support for Shinobi, i'm using a Xtreamer Ultra 2 with a nVidia 520M (I know it is not a high end card, but is CUDA compatible)

    I installed nvidia drivers and CUDA on my Ubuntu 16.04 it looks ok, I can get info on nvidia-smi command and have no obvious errors on logs.

    The point is that after everything is installed i can configure the camera enabling the HW acceleration and selecting cuvid as acceleration engine, but i cant not set the nvidia Video Decoder H.264 CUVID (actually ffmpeg fails with any Video Decoder except AUTO) this is the errror in syslog:

    kernel: [82201.751126] ffmpeg[1772]: segfault at 0 ip           (null) sp 00007ffc42116988 error 14 in ffmpeg[400000+2cbe000]

    and this is for the UI log window:

    msg : Process Crashed for Monitor : PiTDSnd0dq
    cmd : -loglevel warning -analyzeduration 1000000 -probesize 1000000 -rtsp_transport tcp -hwaccel auto -c:v h264_cuvid -i "rtsp://user:[email protected]:port/path" -c:v mjpeg -f mpjpeg -boundary_tag shinobi -q:v 15 -r 2 -s 1280x720 pipe:1 -f singlejpeg -vf fps=2 -s 1280x720 pipe:3 -an -c:v copy -f hls -tune zerolatency -g 1 -hls_time 2 -hls_list_size 4 -start_number 0 -live_start_index -3 -hls_allow_cache 0 -hls_flags +delete_segments+omit_endlist /dev/shm/streams/sdf/sdf/detectorStream.m3u8

    I have disable the JPG API as stated in docs.

    My question is, is there a way to determine if the GPU is being used for video procesing or not?

    Thanks for your help!

    EDIT1: Trying the ffmpeg command on the console get this:

    [hls @ 0x55b98403e060] pkt->duration = 0, maybe the hls segment duration will not precise
       Last message repeated 5 times
    Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'
    Error reinitializing filters!
    Failed to inject frame into filter network: Function not implemented
    Error while processing the decoded data for stream #0:0

    I'm using driver 340 now but i've tryed with 390 with the same result for everything.

  • administrators

    It seems that i need to find a suitable work around for JPEG based outputs. It looks like you are using MJPEG as your stream type.

    Try setting your Stream Type to Poseidon, HLS, or FLV with the codec set to copy for Video and for Audio do No Audio or aac.

  • @mdps said in is CUDA HW Acceleration working?:

    Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'

    Hi, it look likes from the ffmpeg command but is not true jeje (I'm not sure if I took the wrong ffmpeg command...)

    I'm testing the software with a Foscam C2, I'm consuming the secondary stream configured as 1280x720 512K bit rate at 10FPS CBR, VLC says the stream is Códec: H264 - MPEG-4 AVC (part 10) (h264)

    In Shinobi my config is:

    Input Type: H.264 / H.265 /H.265+

    Input Settings
    Acceleration Engine: cuvid
    Video Decoder: Auto (any other option make the process die)

    Stream Type: HLS
    Video Encoder: Copy
    Audio Encoder: No Audio

    Enable: No

  • I've been able to capture from console with ffmpeg with the following command:

    ffmpeg -loglevel debug -analyzeduration 1000000 -probesize 1000000 -rtsp_transport tcp -hwaccel cuvid -c:v mpeg4_cuvid -i "rtsp://user:[email protected]:port/path" -t 00:00:10 file_cuvid.mp4

    But if i set mpeg4_cuvid in Shinobi the monitor crashes.

  • Finally I've been able to get the monitors (three at the time of writing) working with CUDA, after thousands of tests and parameter changes i was able to get them working adding the acceleration device parameter, in my case /dev/nvidia0 (i just took a look on /dev looking for something familiar 🙂

    The acceleration final acceleration config looks like this:


    Now I'm running the cameras in watch only and record mode but without Motion or Object detection, the ffmpeg process of the monitors looks fragile and it crash as soon as i try to use those features...

    Just for the record i'm now with nvidia drivers 390.

    @moeiscool Shinobi is really great pice of software, just a bit young, but that is a matter of time 😉

    RIP Zoneminder Long live Shinobi.


Looks like your connection to Shinobi Forum was lost, please wait while we try to reconnect.