Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion motioneye/motionctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,21 @@ def find_motion():

return _motion_binary_cache

def find_libcamerify():

if settings.LIBCAMERIFY:

if os.path.exists(settings.LIBCAMERIFY):
Comment thread
strips marked this conversation as resolved.
logging.debug(f'Found {settings.LIBCAMERIFY}')
return settings.LIBCAMERIFY

else:
binary = utils.call_subprocess(['which', 'libcamerify'])
if os.path.exists(binary):
logging.debug(f'Found {binary}')
return binary

return None, None
Comment thread
strips marked this conversation as resolved.
Outdated

def start(deferred=False):
from motioneye import config, mjpgclient
Expand Down Expand Up @@ -99,7 +114,18 @@ def start(deferred=False):
motion_log_path = os.path.join(settings.LOG_PATH, 'motion.log')
motion_pid_path = os.path.join(settings.RUN_PATH, 'motion.pid')

args = [program, '-n', '-c', motion_config_path, '-d']
args = []

libcamerify = find_libcamerify()
if libcamerify:
args.append(libcamerify)
logging.debug('Using libcam wrapper libcamerify')

args.append(program)
args.append('-n')
args.append('-c')
args.append(motion_config_path)
args.append('-d')
Comment thread
strips marked this conversation as resolved.
Outdated

if settings.LOG_LEVEL <= logging.DEBUG:
args.append('9')
Expand Down
3 changes: 3 additions & 0 deletions motioneye/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
# the TCP port to listen on
PORT = 8765

# Path to libcamerify if libcamera compatability layer/wrapper should be used (default no)
LIBCAMERIFY = None

# path to the motion binary to use (automatically detected by default)
MOTION_BINARY = None

Expand Down