Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:ccrisan/motioneye into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrisan committed Jun 6, 2020
2 parents 6118386 + dce1395 commit acdc664
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 2 deletions.
6 changes: 6 additions & 0 deletions motioneye/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion motioneye/meyectl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
53 changes: 53 additions & 0 deletions motioneye/motionctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion motioneye/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
18 changes: 18 additions & 0 deletions motioneye/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -763,13 +763,31 @@
<option value="flv">Flash Video (.flv)</option>
<option value="mov">QuickTime (.mov)</option>
<option value="mp4">H.264 (.mp4)</option>
{% if has_h264_nvenc_support %}
<option value="mp4:h264_nvenc">H.264/NVENC (.mp4)</option>
{% endif %}
{% if has_h264_nvmpi_support %}
<option value="mp4:h264_nvmpi">H.264/NVMPI (.mp4)</option>
{% endif %}
{% if has_h264_qsv_support %}
<option value="mp4:h264_qsv">H.264/QSV (.mp4)</option>
{% endif %}
{% if has_h264_omx_support %}
<option value="mp4:h264_omx">H.264/OMX (.mp4)</option>
{% endif %}
{% if has_h264_v4l2m2m_support %}
<option value="mp4:h264_v4l2m2m">H.264/V4L2M2M (.mp4)</option>
{% endif %}
<option value="hevc">HEVC (.mp4)</option>
{% if has_hevc_nvenc_support %}
<option value="mp4:hevc_nvenc">HEVC/NVENC (.mp4)</option>
{% endif %}
{% if has_hevc_nvmpi_support %}
<option value="mp4:hevc_nvmpi">HEVC/NVMPI (.mp4)</option>
{% endif %}
{% if has_hevc_qsv_support %}
<option value="mp4:hevc_qsv">HEVC/QSV (.mp4)</option>
{% endif %}
<option value="mkv">Matroska Video (.mkv)</option>
{% if has_h264_omx_support %}
<option value="mkv:h264_omx">Matroska Video/OMX (.mkv)</option>
Expand Down

0 comments on commit acdc664

Please sign in to comment.