diff --git a/motioneye/handlers.py b/motioneye/handlers.py
index da9e3afa0..48a6fc915 100644
--- a/motioneye/handlers.py
+++ b/motioneye/handlers.py
@@ -248,6 +248,12 @@ def get(self):
admin_username=config.get_main().get('@admin_username'),
has_h264_omx_support=motionctl.has_h264_omx_support(),
has_h264_v4l2m2m_support=motionctl.has_h264_v4l2m2m_support(),
+ has_h264_nvenc_support=motionctl.has_h264_nvenc_support(),
+ has_h264_nvmpi_support=motionctl.has_h264_nvmpi_support(),
+ has_hevc_nvenc_support=motionctl.has_hevc_nvenc_support(),
+ has_hevc_nvmpi_support=motionctl.has_hevc_nvmpi_support(),
+ has_h264_qsv_support=motionctl.has_h264_qsv_support(),
+ has_hevc_qsv_support=motionctl.has_hevc_qsv_support(),
has_motion=bool(motionctl.find_motion()[0]),
mask_width=utils.MASK_WIDTH)
diff --git a/motioneye/meyectl.py b/motioneye/meyectl.py
index 64a445a1f..a2ad61294 100755
--- a/motioneye/meyectl.py
+++ b/motioneye/meyectl.py
@@ -23,7 +23,7 @@
import sys
# make sure motioneye is on python path
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import settings
diff --git a/motioneye/motionctl.py b/motioneye/motionctl.py
index ee34ede1e..0801a65a8 100644
--- a/motioneye/motionctl.py
+++ b/motioneye/motionctl.py
@@ -377,6 +377,59 @@ def has_h264_v4l2m2m_support():
return 'h264_v4l2m2m' in codecs.get('h264', {}).get('encoders', set())
+def has_h264_nvenc_support():
+ binary, version, codecs = mediafiles.find_ffmpeg()
+ if not binary:
+ return False
+
+ # TODO also check for motion codec parameter support
+
+ return 'h264_nvenc' in codecs.get('h264', {}).get('encoders', set())
+
+def has_h264_nvmpi_support():
+ binary, version, codecs = mediafiles.find_ffmpeg()
+ if not binary:
+ return False
+
+ # TODO also check for motion codec parameter support
+
+ return 'h264_nvmpi' in codecs.get('h264', {}).get('encoders', set())
+
+def has_hevc_nvmpi_support():
+ binary, version, codecs = mediafiles.find_ffmpeg()
+ if not binary:
+ return False
+
+ # TODO also check for motion codec parameter support
+
+ return 'hevc_nvmpi' in codecs.get('hevc', {}).get('encoders', set())
+
+def has_hevc_nvenc_support():
+ binary, version, codecs = mediafiles.find_ffmpeg()
+ if not binary:
+ return False
+
+ # TODO also check for motion codec parameter support
+
+ return 'hevc_nvenc' in codecs.get('hevc', {}).get('encoders', set())
+
+def has_h264_qsv_support():
+ binary, version, codecs = mediafiles.find_ffmpeg()
+ if not binary:
+ return False
+
+ # TODO also check for motion codec parameter support
+
+ return 'h264_qsv' in codecs.get('h264', {}).get('encoders', set())
+
+def has_hevc_qsv_support():
+ binary, version, codecs = mediafiles.find_ffmpeg()
+ if not binary:
+ return False
+
+ # TODO also check for motion codec parameter support
+
+ return 'hevc_qsv' in codecs.get('hevc', {}).get('encoders', set())
def resolution_is_valid(width, height):
# width & height must be be modulo 8
diff --git a/motioneye/static/js/main.js b/motioneye/static/js/main.js
index 7f655da00..5da730bf1 100644
--- a/motioneye/static/js/main.js
+++ b/motioneye/static/js/main.js
@@ -18,7 +18,7 @@ var passwordHash = '';
var basePath = null;
var signatureRegExp = new RegExp('[^A-Za-z0-9/?_.=&{}\\[\\]":, -]', 'g');
var deviceNameValidRegExp = new RegExp('^[A-Za-z0-9\-\_\+\ ]+$');
-var filenameValidRegExp = new RegExp('^([A-Za-z0-9 \(\)/._-]|%[YmdHMSqv])+$');
+var filenameValidRegExp = new RegExp('^([A-Za-z0-9 \(\)/._-]|%[CYmdHMSqv])+$');
var dirnameValidRegExp = new RegExp('^[A-Za-z0-9 \(\)/._-]+$');
var emailValidRegExp = new RegExp('^[A-Za-z0-9 _+.@^~<>,-]+$');
var initialConfigFetched = false; /* used to workaround browser extensions that trigger stupid change events */
diff --git a/motioneye/templates/main.html b/motioneye/templates/main.html
index 9b71f3223..07fd17606 100644
--- a/motioneye/templates/main.html
+++ b/motioneye/templates/main.html
@@ -763,6 +763,15 @@
+ {% if has_h264_nvenc_support %}
+
+ {% endif %}
+ {% if has_h264_nvmpi_support %}
+
+ {% endif %}
+ {% if has_h264_qsv_support %}
+
+ {% endif %}
{% if has_h264_omx_support %}
{% endif %}
@@ -770,6 +779,15 @@
{% endif %}
+ {% if has_hevc_nvenc_support %}
+
+ {% endif %}
+ {% if has_hevc_nvmpi_support %}
+
+ {% endif %}
+ {% if has_hevc_qsv_support %}
+
+ {% endif %}
{% if has_h264_omx_support %}