Skip to content

Commit acdc664

Browse files
committed
Merge branch 'dev' of github.com:ccrisan/motioneye into dev
2 parents 6118386 + dce1395 commit acdc664

File tree

5 files changed

+79
-2
lines changed

5 files changed

+79
-2
lines changed

motioneye/handlers.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ def get(self):
248248
admin_username=config.get_main().get('@admin_username'),
249249
has_h264_omx_support=motionctl.has_h264_omx_support(),
250250
has_h264_v4l2m2m_support=motionctl.has_h264_v4l2m2m_support(),
251+
has_h264_nvenc_support=motionctl.has_h264_nvenc_support(),
252+
has_h264_nvmpi_support=motionctl.has_h264_nvmpi_support(),
253+
has_hevc_nvenc_support=motionctl.has_hevc_nvenc_support(),
254+
has_hevc_nvmpi_support=motionctl.has_hevc_nvmpi_support(),
255+
has_h264_qsv_support=motionctl.has_h264_qsv_support(),
256+
has_hevc_qsv_support=motionctl.has_hevc_qsv_support(),
251257
has_motion=bool(motionctl.find_motion()[0]),
252258
mask_width=utils.MASK_WIDTH)
253259

motioneye/meyectl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import sys
2424

2525
# make sure motioneye is on python path
26-
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
26+
sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
2727

2828
import settings
2929

motioneye/motionctl.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,59 @@ def has_h264_v4l2m2m_support():
377377

378378
return 'h264_v4l2m2m' in codecs.get('h264', {}).get('encoders', set())
379379

380+
def has_h264_nvenc_support():
381+
binary, version, codecs = mediafiles.find_ffmpeg()
382+
if not binary:
383+
return False
384+
385+
# TODO also check for motion codec parameter support
386+
387+
return 'h264_nvenc' in codecs.get('h264', {}).get('encoders', set())
388+
389+
def has_h264_nvmpi_support():
390+
binary, version, codecs = mediafiles.find_ffmpeg()
391+
if not binary:
392+
return False
393+
394+
# TODO also check for motion codec parameter support
395+
396+
return 'h264_nvmpi' in codecs.get('h264', {}).get('encoders', set())
397+
398+
def has_hevc_nvmpi_support():
399+
binary, version, codecs = mediafiles.find_ffmpeg()
400+
if not binary:
401+
return False
402+
403+
# TODO also check for motion codec parameter support
404+
405+
return 'hevc_nvmpi' in codecs.get('hevc', {}).get('encoders', set())
406+
407+
def has_hevc_nvenc_support():
408+
binary, version, codecs = mediafiles.find_ffmpeg()
409+
if not binary:
410+
return False
411+
412+
# TODO also check for motion codec parameter support
413+
414+
return 'hevc_nvenc' in codecs.get('hevc', {}).get('encoders', set())
415+
416+
def has_h264_qsv_support():
417+
binary, version, codecs = mediafiles.find_ffmpeg()
418+
if not binary:
419+
return False
420+
421+
# TODO also check for motion codec parameter support
422+
423+
return 'h264_qsv' in codecs.get('h264', {}).get('encoders', set())
424+
425+
def has_hevc_qsv_support():
426+
binary, version, codecs = mediafiles.find_ffmpeg()
427+
if not binary:
428+
return False
429+
430+
# TODO also check for motion codec parameter support
431+
432+
return 'hevc_qsv' in codecs.get('hevc', {}).get('encoders', set())
380433

381434
def resolution_is_valid(width, height):
382435
# width & height must be be modulo 8

motioneye/static/js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var passwordHash = '';
1818
var basePath = null;
1919
var signatureRegExp = new RegExp('[^A-Za-z0-9/?_.=&{}\\[\\]":, -]', 'g');
2020
var deviceNameValidRegExp = new RegExp('^[A-Za-z0-9\-\_\+\ ]+$');
21-
var filenameValidRegExp = new RegExp('^([A-Za-z0-9 \(\)/._-]|%[YmdHMSqv])+$');
21+
var filenameValidRegExp = new RegExp('^([A-Za-z0-9 \(\)/._-]|%[CYmdHMSqv])+$');
2222
var dirnameValidRegExp = new RegExp('^[A-Za-z0-9 \(\)/._-]+$');
2323
var emailValidRegExp = new RegExp('^[A-Za-z0-9 _+.@^~<>,-]+$');
2424
var initialConfigFetched = false; /* used to workaround browser extensions that trigger stupid change events */

motioneye/templates/main.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,13 +763,31 @@
763763
<option value="flv">Flash Video (.flv)</option>
764764
<option value="mov">QuickTime (.mov)</option>
765765
<option value="mp4">H.264 (.mp4)</option>
766+
{% if has_h264_nvenc_support %}
767+
<option value="mp4:h264_nvenc">H.264/NVENC (.mp4)</option>
768+
{% endif %}
769+
{% if has_h264_nvmpi_support %}
770+
<option value="mp4:h264_nvmpi">H.264/NVMPI (.mp4)</option>
771+
{% endif %}
772+
{% if has_h264_qsv_support %}
773+
<option value="mp4:h264_qsv">H.264/QSV (.mp4)</option>
774+
{% endif %}
766775
{% if has_h264_omx_support %}
767776
<option value="mp4:h264_omx">H.264/OMX (.mp4)</option>
768777
{% endif %}
769778
{% if has_h264_v4l2m2m_support %}
770779
<option value="mp4:h264_v4l2m2m">H.264/V4L2M2M (.mp4)</option>
771780
{% endif %}
772781
<option value="hevc">HEVC (.mp4)</option>
782+
{% if has_hevc_nvenc_support %}
783+
<option value="mp4:hevc_nvenc">HEVC/NVENC (.mp4)</option>
784+
{% endif %}
785+
{% if has_hevc_nvmpi_support %}
786+
<option value="mp4:hevc_nvmpi">HEVC/NVMPI (.mp4)</option>
787+
{% endif %}
788+
{% if has_hevc_qsv_support %}
789+
<option value="mp4:hevc_qsv">HEVC/QSV (.mp4)</option>
790+
{% endif %}
773791
<option value="mkv">Matroska Video (.mkv)</option>
774792
{% if has_h264_omx_support %}
775793
<option value="mkv:h264_omx">Matroska Video/OMX (.mkv)</option>

0 commit comments

Comments
 (0)