{% extends "layout.html" %} {% set active_page = "camera" %} {% set help_page = ["https://kizniche.github.io/Mycodo/Camera/", _('Cameras')] %} {% block title %} - {{_('Camera')}}{% endblock %} {% block head %} {% endblock %} {% block body %}
{% include 'flash_messages.html' %}
{{form_camera.csrf_token}}
{{form_camera.name(class_='form-control', value='Camera Name')}}
{{form_camera.camera_add(class_='btn btn-primary btn-block')}}
{% for each_camera in camera %}
{{form_camera.csrf_token}} {{form_camera.camera_id(value=each_camera.unique_id)}}
{{form_camera.capture_still(class_='form-control btn btn-primary')}}
{% if camera_info[each_camera.library]['capable_stream'] and not each_camera.timelapse_started %}
{% if each_camera.stream_started -%} {{form_camera.stop_stream(class_='form-control btn btn-primary')}} {% else %} {{form_camera.start_stream(class_='form-control btn btn-primary')}} {%- endif %}
{%- endif %} {% if not each_camera.stream_started -%} {% if not each_camera.timelapse_started %} {% else %} {% if each_camera.timelapse_paused %}
{{form_camera.resume_timelapse(class_='form-control btn btn-primary')}}
{% else %}
{{form_camera.pause_timelapse(class_='form-control btn btn-primary')}}
{{form_camera.stop_timelapse(class_='form-control btn btn-primary')}}
{% endif %} {% endif %} {%- endif %}
Time-lapse parameters:
{{form_camera.timelapse_interval.label(class_='control-label')}}
{{form_camera.timelapse_interval(class_='form-control', **{'title':_('The interval that photos will be acquired')})}}
{{form_camera.timelapse_runtime_sec.label(class_='control-label')}}
{{form_camera.timelapse_runtime_sec(class_='form-control', **{'title':_('How long to run before stopping. Set 0 to run forever.')})}}
{{form_camera.start_timelapse(class_='form-control btn btn-primary')}}
{{form_camera.camera_mod(class_='btn btn-primary btn-block')}}
{{form_camera.camera_del(class_='btn btn-primary btn-block', **{'onclick':'return confirm("Are you sure you want to delete this?")'})}}
{% if each_camera.library == 'picamera' %} {% if not pi_camera_enabled %}
{{_("Raspberry Pi Camera support doesn't appear to be enabled. Please enable it using the Raspberry Pi configuration or with the command 'sudo raspi-config'")}}
{% endif %} {% elif each_camera.library == 'fswebcam' %}
{{_("Different options are available depending on the camera being used.")}} Execute 'fswebcam --device /dev/video0 --list-controls' to see available options to use in 'Custom Options'.
{% elif each_camera.library == 'libcamera' %}
{{_("Different options are available depending on the camera being used.")}} Execute 'libcamera-hello' to see information about your camera.
{% elif each_camera.library == 'raspistill' %}
{{_("Different options are available depending on the camera being used.")}} Execute 'raspistill --help' to see information about your camera.
{% elif each_camera.library == 'opencv' %}
{{_("Different options are available depending on the camera being used.")}}
{% endif %}
{{form_camera.name.label(class_='control-label')}}
{{form_camera.name(class_='form-control', value=each_camera.name, **{'title':_('Name for this Camera')})}}
{{form_camera.cmd_pre_camera.label(class_='control-label')}}
{{form_camera.cmd_pre_camera(class_='form-control', value=each_camera.cmd_pre_camera, **{'title':_('Linux shell command to execute prior to acquiring a still image.')})}}
{{form_camera.cmd_post_camera.label(class_='control-label')}}
{{form_camera.cmd_post_camera(class_='form-control', value=each_camera.cmd_post_camera, **{'title':_('Linux shell command to execute after acquiring a still image.')})}}
{{form_camera.output_id.label(class_='control-label')}}
{{form_camera.output_duration.label(class_='control-label')}}
{{form_camera.output_duration(class_='form-control', value=each_camera.output_duration, **{'title':_('The duration to keep the output on prior to acquiring a still image. For example, useful for fluorescent lights that take a few seconds to turn on.')})}}
{{form_camera.path_still.label(class_='control-label')}}
{{form_camera.path_still(class_='form-control', value=each_camera.path_still, **{'title':_('Path to save still image files. Leave blank to use default location.')})}}
{{form_camera.path_timelapse.label(class_='control-label')}}
{{form_camera.path_timelapse(class_='form-control', value=each_camera.path_timelapse, **{'title':_('Path to save timelapse image files. Leave blank to use default location.')})}}
{% if camera_info[each_camera.library]['capable_stream'] %}
{{form_camera.path_video.label(class_='control-label')}}
{{form_camera.path_video(class_='form-control', value=each_camera.path_video, **{'title':_('Path to save video files. Leave blank to use default location.')})}}
{% endif %}
{{form_camera.hflip.label(class_='control-label')}}
{{form_camera.vflip.label(class_='control-label')}}
{{form_camera.hide_still.label(class_='control-label')}}
{{form_camera.hide_timelapse.label(class_='control-label')}}
{% set template_file = 'pages/camera_options/'+each_camera.library+'.html' %} {% if template_exists(template_file) %} {% include template_file %} {% else %}
Error: Template {{template_file}} doesn't exist.
{% endif %}
{%- if camera_info[each_camera.library]['capable_stream'] and each_camera.stream_started -%}
{{_('Video Stream')}}:
{%- endif -%} {% if each_camera.timelapse_started and not each_camera.hide_timelapse %}
{{_('Timelapse Parameters')}}:
Time-lapse: {% if each_camera.timelapse_paused %}Paused{% else %}Running{% endif %}
Start time: {{epoch_to_time_string(each_camera.timelapse_start_time)}}
End time: {{epoch_to_time_string(each_camera.timelapse_end_time)}}
Interval: {{each_camera.timelapse_interval}} seconds
Next capture: {{epoch_to_time_string(each_camera.timelapse_next_capture)}}
Next capture number: {{each_camera.timelapse_capture_number}}
{% endif %} {% if latest_img_tl[each_camera.unique_id] and not each_camera.hide_timelapse %}
Time-lapse Video Generation Options:
{{form_camera.timelapse_image_set.label(class_='control-label')}}
{{form_camera.timelapse_codec.label(class_='control-label')}}
{{form_camera.timelapse_fps.label(class_='control-label')}}
{{form_camera.timelapse_fps(class_='form-control', value=24)}}
{{form_camera.timelapse_generate(class_='form-control btn btn-primary')}}
{{_('Last Timelapse')}}: {{latest_img_tl_ts[each_camera.unique_id]}} ({{latest_img_tl_size[each_camera.unique_id]}})
{% endif %} {% if latest_img_still[each_camera.unique_id] and not each_camera.hide_still %}
{{_('Last Still')}}: {{latest_img_still_ts[each_camera.unique_id]}} ({{latest_img_still_size[each_camera.unique_id]}})
{% endif %}
{% endfor %}
{% endblock %}