From 7f8badc3340c4ca89e9d665219cdf881db62bad8 Mon Sep 17 00:00:00 2001 From: AngeloGioacchino Del Regno Date: Thu, 24 Nov 2022 00:09:02 +0100 Subject: [PATCH 1/3] zm_ffmpeg_camera: Add support for Jetson Nano/Xavier NVMPI Add support for the NVMPI hardware decoders (not CUDA decoders!) of the Tegra SoCs found in the Jetson Nano/TX/TX2 and Xavier NX/AGX. This platform supports hardware decoding of H264, HEVC, MPEG2, MPEG4, VP8 and VP9. --- src/zm_ffmpeg_camera.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 5cdc38636..cb6c9dff8 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -385,6 +385,42 @@ int FfmpegCamera::OpenFfmpeg() { } else { Debug(1, "Success finding decoder (h264_mmal)"); } + + if ((mVideoCodec = avcodec_find_decoder_by_name("h264_nvmpi")) == nullptr) { + Debug(1, "Failed to find decoder (h264_nvmpi)"); + } else { + Debug(1, "Success finding decoder (h264_nvmpi)"); + } + } else if (mVideoStream->codecpar->codec_id == AV_CODEC_ID_HEVC) { + if ((mVideoCodec = avcodec_find_decoder_by_name("hevc_nvmpi")) == nullptr) { + Debug(1, "Failed to find decoder (hevc_nvmpi)"); + } else { + Debug(1, "Success finding decoder (hevc_nvmpi)"); + } + } else if (mVideoStream->codecpar->codec_id == AV_CODEC_ID_VP8) { + if ((mVideoCodec = avcodec_find_decoder_by_name("vp8_nvmpi")) == nullptr) { + Debug(1, "Failed to find decoder (vp8_nvmpi)"); + } else { + Debug(1, "Success finding decoder (vp8_nvmpi)"); + } + } else if (mVideoStream->codecpar->codec_id == AV_CODEC_ID_VP9) { + if ((mVideoCodec = avcodec_find_decoder_by_name("hevc_nvmpi")) == nullptr) { + Debug(1, "Failed to find decoder (hevc_nvmpi)"); + } else { + Debug(1, "Success finding decoder (hevc_nvmpi)"); + } + } else if (mVideoStream->codecpar->codec_id == AV_CODEC_ID_MPEG2VIDEO) { + if ((mVideoCodec = avcodec_find_decoder_by_name("mpeg2_nvmpi")) == nullptr) { + Debug(1, "Failed to find decoder (mpeg2_nvmpi)"); + } else { + Debug(1, "Success finding decoder (mpeg2_nvmpi)"); + } + } else if (mVideoStream->codecpar->codec_id == AV_CODEC_ID_MPEG4) { + if ((mVideoCodec = avcodec_find_decoder_by_name("mpeg4_nvmpi")) == nullptr) { + Debug(1, "Failed to find decoder (mpeg4_nvmpi)"); + } else { + Debug(1, "Success finding decoder (mpeg4_nvmpi)"); + } } if (!mVideoCodec) { From 83a401fc4452ba273aef033ed42823dc3e8b6fe0 Mon Sep 17 00:00:00 2001 From: Oleg Date: Fri, 2 Dec 2022 21:43:45 +0000 Subject: [PATCH 2/3] Fix typo fwrite -> write --- src/zm_sendfile.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zm_sendfile.h b/src/zm_sendfile.h index a4f703efc..4f5452c08 100644 --- a/src/zm_sendfile.h +++ b/src/zm_sendfile.h @@ -36,7 +36,7 @@ ssize_t zm_sendfile(int out_fd, int in_fd, off_t *offset, size_t size) { return -errno; } - err = fwrite(out_fd, buffer, size); + err = write(out_fd, buffer, size); if (err < 0) { Error("Unable to write %zu bytes: %s", size, strerror(errno)); return -errno; From 9666ddf030beb1eaae65f508f71fd599eba13ad3 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Tue, 6 Dec 2022 14:26:41 +0100 Subject: [PATCH 3/3] Added debian backports option to install a newer version of Zoneminder --- docs/installationguide/debian.rst | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/installationguide/debian.rst b/docs/installationguide/debian.rst index c38e24364..e1c2408b0 100644 --- a/docs/installationguide/debian.rst +++ b/docs/installationguide/debian.rst @@ -58,12 +58,25 @@ By default MariaDB uses `unix socket authentication`_, so no root user password **Step 4:** Install zoneminder -Run the following commands. +By default Debian will install the version published in Debian (stable). However you also have the option to install a newer version using backports. +For example, at the time of this writting, bullseye (stable) ships with v.1.34.x and bullseye-backports with v.1.36.x. + +To install the version in bullseye stable, just run the following command. :: sudo apt install zoneminder + +If instead you prefer to install the newer version using backports, run the following commands. +The first line will add bullseye-backports repository. +The backports repository is deactivated by default, so with the second line we explicityly state we want the backported version of zoneminder. + +:: + sudo echo 'deb http://deb.debian.org/debian bullseye-backports main contrib' >> /etc/apt/sources.list + sudo apt update && sudo apt -t bullseye-backports install zoneminder + + **Step 5:** Configure database ::