Merge branch 'master' of github.com:ZoneMinder/zoneminder
commit
1e75ab7541
|
@ -543,6 +543,7 @@ CREATE TABLE `Monitors` (
|
|||
`Palette` int(10) unsigned NOT NULL default '0',
|
||||
`Orientation` enum('ROTATE_0','ROTATE_90','ROTATE_180','ROTATE_270','FLIP_HORI','FLIP_VERT') NOT NULL default 'ROTATE_0',
|
||||
`Deinterlacing` int(10) unsigned NOT NULL default '0',
|
||||
`Decoder` varchar(32),
|
||||
`DecoderHWAccelName` varchar(64),
|
||||
`DecoderHWAccelDevice` varchar(255),
|
||||
`SaveJPEGs` TINYINT NOT NULL DEFAULT '3' ,
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
SET @s = (SELECT IF(
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
||||
AND table_name = 'Monitors'
|
||||
AND column_name = 'Decoder'
|
||||
) > 0,
|
||||
"SELECT 'Column Decoder already exists in Monitors'",
|
||||
"ALTER TABLE `Monitors` ADD `Decoder` varchar(32) AFTER `Deinterlacing`"
|
||||
));
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
|
@ -67,6 +67,8 @@ static enum AVPixelFormat find_fmt_by_hw_type(const enum AVHWDeviceType type) {
|
|||
return AV_PIX_FMT_VDPAU;
|
||||
case AV_HWDEVICE_TYPE_CUDA:
|
||||
return AV_PIX_FMT_CUDA;
|
||||
case AV_HWDEVICE_TYPE_QSV:
|
||||
return AV_PIX_FMT_VAAPI;
|
||||
#ifdef AV_HWDEVICE_TYPE_MMAL
|
||||
case AV_HWDEVICE_TYPE_MMAL:
|
||||
return AV_PIX_FMT_MMAL;
|
||||
|
@ -387,47 +389,11 @@ int FfmpegCamera::OpenFfmpeg() {
|
|||
mVideoStreamId, mAudioStreamId);
|
||||
|
||||
const AVCodec *mVideoCodec = nullptr;
|
||||
if (mVideoStream->codecpar->codec_id == AV_CODEC_ID_H264) {
|
||||
if ((mVideoCodec = avcodec_find_decoder_by_name("h264_mmal")) == nullptr) {
|
||||
Debug(1, "Failed to find decoder (h264_mmal)");
|
||||
if (!monitor->DecoderName().empty()) {
|
||||
if ((mVideoCodec = avcodec_find_decoder_by_name(monitor->DecoderName().c_str())) == nullptr) {
|
||||
Debug(1, "Failed to find decoder %s, falling back to auto", monitor->DecoderName().c_str());
|
||||
} 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)");
|
||||
Debug(1, "Success finding decoder %s", monitor->DecoderName().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ std::string load_monitor_sql =
|
|||
"`LinkedMonitors`, `EventStartCommand`, `EventEndCommand`, `AnalysisFPSLimit`, `AnalysisUpdateDelay`, `MaxFPS`, `AlarmMaxFPS`,"
|
||||
"`Device`, `Channel`, `Format`, `V4LMultiBuffer`, `V4LCapturesPerFrame`, " // V4L Settings
|
||||
"`Protocol`, `Method`, `Options`, `User`, `Pass`, `Host`, `Port`, `Path`, `SecondPath`, `Width`, `Height`, `Colours`, `Palette`, `Orientation`+0, `Deinterlacing`, "
|
||||
"`DecoderHWAccelName`, `DecoderHWAccelDevice`, `RTSPDescribe`, "
|
||||
"`Decoder`, `DecoderHWAccelName`, `DecoderHWAccelDevice`, `RTSPDescribe`, "
|
||||
"`SaveJPEGs`, `VideoWriter`, `EncoderParameters`, "
|
||||
"`OutputCodec`, `Encoder`, `OutputContainer`, "
|
||||
"`RecordAudio`, "
|
||||
|
@ -451,7 +451,8 @@ void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) {
|
|||
deinterlacing = atoi(dbrow[col]); col++;
|
||||
deinterlacing_value = deinterlacing & 0xff;
|
||||
|
||||
/*"`DecoderHWAccelName`, `DecoderHWAccelDevice`, `RTSPDescribe`, " */
|
||||
/*"`Decoder`, `DecoderHWAccelName`, `DecoderHWAccelDevice`, `RTSPDescribe`, " */
|
||||
decoder_name = dbrow[col] ? dbrow[col] : ""; col++;
|
||||
decoder_hwaccel_name = dbrow[col] ? dbrow[col] : ""; col++;
|
||||
decoder_hwaccel_device = dbrow[col] ? dbrow[col] : ""; col++;
|
||||
rtsp_describe = (dbrow[col] && *dbrow[col] != '0'); col++;
|
||||
|
|
|
@ -414,6 +414,7 @@ protected:
|
|||
Orientation orientation; // Whether the image has to be rotated at all
|
||||
unsigned int deinterlacing;
|
||||
unsigned int deinterlacing_value;
|
||||
std::string decoder_name;
|
||||
std::string decoder_hwaccel_name;
|
||||
std::string decoder_hwaccel_device;
|
||||
bool videoRecording;
|
||||
|
@ -639,6 +640,7 @@ public:
|
|||
DecodingOption Decoding() const {
|
||||
return decoding;
|
||||
}
|
||||
const std::string &DecoderName() const { return decoder_name; }
|
||||
bool JanusEnabled() {
|
||||
return janus_enabled;
|
||||
}
|
||||
|
|
|
@ -91,21 +91,40 @@ RETSIGTYPE zm_die_handler(int signal)
|
|||
int trace_size = 0;
|
||||
trace_size = backtrace(trace, TRACE_SIZE);
|
||||
|
||||
char cmd[1024] = "addr2line -e ";
|
||||
char cmd[1024] = "addr2line -Cfip -e ";
|
||||
char *cmd_ptr = cmd + strlen(cmd);
|
||||
cmd_ptr += snprintf(cmd_ptr, sizeof(cmd) - (cmd_ptr - cmd), "%s", self);
|
||||
|
||||
char **messages = backtrace_symbols(trace, trace_size);
|
||||
char *ofs_ptr;
|
||||
char *end_ptr;
|
||||
bool found_offset = false;
|
||||
|
||||
// Print the full backtrace
|
||||
for (int i = 0; i < trace_size; i++) {
|
||||
Error("Backtrace %u: %s", i, messages[i]);
|
||||
cmd_ptr +=
|
||||
snprintf(cmd_ptr, sizeof(cmd) - (cmd_ptr - cmd), " %p",
|
||||
trace[i]);
|
||||
if (strstr(messages[i], self) == nullptr)
|
||||
continue;
|
||||
ofs_ptr = strstr(messages[i], "(+0x");
|
||||
if (ofs_ptr == nullptr)
|
||||
continue;
|
||||
ofs_ptr += 2;
|
||||
end_ptr = strchr(ofs_ptr, ')');
|
||||
if (end_ptr == nullptr)
|
||||
continue;
|
||||
found_offset = true;
|
||||
int rc = snprintf(cmd_ptr, sizeof(cmd) - (cmd_ptr - cmd), " %.*s", static_cast<int>(end_ptr - ofs_ptr), ofs_ptr);
|
||||
if (rc < 0 || static_cast<size_t>(rc) > sizeof(cmd) - (cmd_ptr - cmd))
|
||||
break;
|
||||
cmd_ptr += rc;
|
||||
}
|
||||
free(messages);
|
||||
|
||||
Info("Backtrace complete, please execute the following command for more information: %s", cmd);
|
||||
if (found_offset) {
|
||||
Error("Backtrace complete, please install debug symbols (typically zoneminder-dbg)");
|
||||
Error("and execute the following command for more information:");
|
||||
Error("%s", cmd);
|
||||
}
|
||||
#endif // ( !defined(ZM_NO_CRASHTRACE) && HAVE_DECL_BACKTRACE && HAVE_DECL_BACKTRACE_SYMBOLS )
|
||||
#endif // (defined(__i386__) || defined(__x86_64__)
|
||||
exit(signal);
|
||||
|
|
|
@ -42,18 +42,21 @@ extern "C" {
|
|||
VideoStore::CodecData VideoStore::codec_data[] = {
|
||||
#if HAVE_LIBAVUTIL_HWCONTEXT_H && LIBAVCODEC_VERSION_CHECK(57, 107, 0, 107, 0)
|
||||
{ AV_CODEC_ID_H265, "h265", "hevc_vaapi", AV_PIX_FMT_NV12, AV_PIX_FMT_VAAPI, AV_HWDEVICE_TYPE_VAAPI },
|
||||
{ AV_CODEC_ID_H265, "h265", "hevc_qsv", AV_PIX_FMT_YUV420P, AV_PIX_FMT_QSV, AV_HWDEVICE_TYPE_QSV },
|
||||
{ AV_CODEC_ID_H265, "h265", "hevc_nvenc", AV_PIX_FMT_NV12, AV_PIX_FMT_NV12, AV_HWDEVICE_TYPE_NONE },
|
||||
{ AV_CODEC_ID_H265, "h265", "libx265", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P, AV_HWDEVICE_TYPE_NONE },
|
||||
{ AV_CODEC_ID_H265, "h265", "libx265", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P, AV_HWDEVICE_TYPE_NONE },
|
||||
|
||||
{ AV_CODEC_ID_H264, "h264", "h264_vaapi", AV_PIX_FMT_NV12, AV_PIX_FMT_VAAPI, AV_HWDEVICE_TYPE_VAAPI },
|
||||
{ AV_CODEC_ID_H264, "h264", "h264_qsv", AV_PIX_FMT_YUV420P, AV_PIX_FMT_QSV, AV_HWDEVICE_TYPE_QSV },
|
||||
{ AV_CODEC_ID_H264, "h264", "h264_nvenc", AV_PIX_FMT_NV12, AV_PIX_FMT_NV12, AV_HWDEVICE_TYPE_NONE },
|
||||
{ AV_CODEC_ID_H264, "h264", "h264_omx", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P, AV_HWDEVICE_TYPE_NONE },
|
||||
{ AV_CODEC_ID_H264, "h264", "h264", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P, AV_HWDEVICE_TYPE_NONE },
|
||||
{ AV_CODEC_ID_H264, "h264", "libx264", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P, AV_HWDEVICE_TYPE_NONE },
|
||||
{ AV_CODEC_ID_H264, "h264", "libx264", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P, AV_HWDEVICE_TYPE_NONE },
|
||||
{ AV_CODEC_ID_MJPEG, "mjpeg", "mjpeg", AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ422P, AV_HWDEVICE_TYPE_NONE },
|
||||
{ AV_CODEC_ID_VP9, "vp9", "libvpx-vp9", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P, AV_HWDEVICE_TYPE_NONE },
|
||||
{ AV_CODEC_ID_AV1, "av1", "libsvtav1", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P, AV_HWDEVICE_TYPE_NONE },
|
||||
{ AV_CODEC_ID_AV1, "av1", "libaom-av1", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P, AV_HWDEVICE_TYPE_NONE },
|
||||
{ AV_CODEC_ID_VP9, "vp9", "libvpx-vp9", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P, AV_HWDEVICE_TYPE_NONE },
|
||||
{ AV_CODEC_ID_AV1, "av1", "libsvtav1", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P, AV_HWDEVICE_TYPE_NONE },
|
||||
{ AV_CODEC_ID_AV1, "av1", "libaom-av1", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P, AV_HWDEVICE_TYPE_NONE },
|
||||
{ AV_CODEC_ID_AV1, "av1", "av1_qsv", AV_PIX_FMT_YUV420P, AV_PIX_FMT_QSV, AV_HWDEVICE_TYPE_QSV },
|
||||
#else
|
||||
{ AV_CODEC_ID_H265, "h265", "libx265", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P },
|
||||
|
||||
|
@ -323,12 +326,11 @@ bool VideoStore::open() {
|
|||
}
|
||||
#if HAVE_LIBAVUTIL_HWCONTEXT_H && LIBAVCODEC_VERSION_CHECK(57, 107, 0, 107, 0)
|
||||
if (codec_data[i].hwdevice_type != AV_HWDEVICE_TYPE_NONE) {
|
||||
Debug(1, "Setting up hwdevice");
|
||||
ret = av_hwdevice_ctx_create(&hw_device_ctx,
|
||||
codec_data[i].hwdevice_type,
|
||||
nullptr, nullptr, 0);
|
||||
if (0>ret) {
|
||||
Error("Failed to create hwdevice_ctx");
|
||||
Error("Failed to create hwdevice_ctx %s", av_make_error_string(ret).c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -183,6 +183,7 @@ public static function getStatuses() {
|
|||
'Palette' => '0',
|
||||
'Orientation' => 'ROTATE_0',
|
||||
'Deinterlacing' => 0,
|
||||
'Decoder' => '',
|
||||
'DecoderHWAccelName' => null,
|
||||
'DecoderHWAccelDevice' => null,
|
||||
'SaveJPEGs' => 2,
|
||||
|
|
|
@ -330,8 +330,8 @@ $SLANG = array(
|
|||
'FilterEmailEvents' => 'Envoyer les évènements par email',
|
||||
'FilterExecuteEvents' => 'Exécuter une commande',
|
||||
'FilterLog' => 'Filtre', // Added - 2015-04-18
|
||||
'FilterMessageEvents' => 'Envoyer les évènements par message',
|
||||
'FilterMoveEvents' => 'Move all matches', // Added - 2018-08-30
|
||||
'FilterMessageEvents' => 'Envoyer les détails par message',
|
||||
'FilterMoveEvents' => 'Déplacer tous les évènements', // Added - 2018-08-30
|
||||
'FilterPx' => 'Filtre Px',
|
||||
'FilterUnset' => 'Vous devez spécifier une largeur et une hauteur de filtre',
|
||||
'FilterUpdateDiskSpace'=> 'Mies à jour de l\'espace disque utilisé', // Added - 2018-08-30
|
||||
|
|
|
@ -817,6 +817,39 @@ include('_monitor_source_nvsocket.php');
|
|||
<label><?php echo translate('SourceSecondPath') ?></label>
|
||||
<input type="text" name="newMonitor[SecondPath]" value="<?php echo validHtmlStr($monitor->SecondPath()) ?>" data-on-input-this="SecondPath_onChange"/>
|
||||
<li>
|
||||
<li class="Decoder">
|
||||
<label><?php echo translate('Decoder') ?></label>
|
||||
<?php
|
||||
$decoders = array(
|
||||
'auto' => translate('Auto'),
|
||||
'libx264' => 'libx264',
|
||||
'h264' => 'h264',
|
||||
'h264_cuvid' => 'h264_cuvid',
|
||||
'h264_mmal' => 'h264_mmal',
|
||||
'h264_omx' => 'h264_omx',
|
||||
'h264_qsv' => 'h264_qsv',
|
||||
'h264_vaapi' => 'h264_vaapi',
|
||||
'h264_v4l2m2m' => 'h264_v4l2m2m',
|
||||
'libx265' => 'libx265',
|
||||
'hevc_cuvid' => 'hevc_cuvid',
|
||||
'hevc_nvmpi' => 'hevc_nvmpi',
|
||||
'hevc_qsv' => 'hevc_qsv',
|
||||
'vp8_nvmpi' => 'vp8_nvmpi',
|
||||
'libvpx-vp9' => 'libvpx-vp9',
|
||||
'vp9_qsv' => 'vp9-qsv',
|
||||
'vp9_cuvid' => 'vp9_cuvid',
|
||||
'vp9_nvmpi' => 'vp9_nvmpi',
|
||||
'vp9_v4l2m2m' => 'vp9_v4l2m2m',
|
||||
'libsvtav1' => 'libsvtav1',
|
||||
'libaom-av1' => 'libaom-av1',
|
||||
'libdav1d' => 'libdav1d',
|
||||
'av1' => 'av1',
|
||||
'av1_qsv' => 'av1_qsv',
|
||||
'av1_cuvid' => 'av1_cuvid',
|
||||
);
|
||||
echo htmlSelect('newMonitor[Decoder]', $decoders, $monitor->Decoder());
|
||||
?>
|
||||
</li>
|
||||
<li class="DecoderHWAccelName">
|
||||
<label>
|
||||
<?php echo translate('DecoderHWAccelName'); echo makeHelpLink('OPTIONS_DECODERHWACCELNAME') ?>
|
||||
|
@ -1137,13 +1170,17 @@ $videowriter_encoders = array(
|
|||
'h264' => 'h264',
|
||||
'h264_nvenc' => 'h264_nvenc',
|
||||
'h264_omx' => 'h264_omx',
|
||||
'h264_qsv' => 'h264_qsv',
|
||||
'h264_vaapi' => 'h264_vaapi',
|
||||
'libx265' => 'libx265',
|
||||
'hevc_nvenc' => 'hevc_nvenc',
|
||||
'hevc_qsv' => 'hevc_qsv',
|
||||
'hevc_vaapi' => 'hevc_vaapi',
|
||||
'libvpx-vp9' => 'libvpx-vp9',
|
||||
'vp9-qsv' => 'vp9-qsv',
|
||||
'libsvtav1' => 'libsvtav1',
|
||||
'libaom-av1' => 'libaom-av1'
|
||||
'libaom-av1' => 'libaom-av1',
|
||||
'av1_qsv' => 'av1_qsv'
|
||||
);
|
||||
echo htmlSelect('newMonitor[Encoder]', $videowriter_encoders, $monitor->Encoder());
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue