def __init__(self, media):
     self.writer = None
     self.media = media
     self.config = Configuration()
     self.file_name = None
     self.index = 0
     self.compress = 0
 def __init__(self, media):
     self.writer = None
     self.media = media
     self.config = Configuration()
     self.file_name = None
     self.process = None
     # create a semaphore to protect when closing ffmpeg
     self.sem = Semaphore(1)
Exemple #3
0
    def __init__(self, config):
        # Go into configuration/template_media for more information
        self.config = Configuration()
        self.own_config = config
        super(ImageGenerator, self).__init__()
        self.media_name = config.name
        self.run = True
        self._is_opened = True

        self._create_params()

        self.deserialize(self.config.read_media(self.get_name()))
Exemple #4
0
    def __init__(self, config):
        # Go into configuration/template_media for more information
        self.config = Configuration()
        self.own_config = config
        super(Webcam, self).__init__()
        self.media_name = config.name
        self.run = True
        self.video = None
        video = cv2.VideoCapture(config.no)
        if video.isOpened():
            self._is_opened = True
            video.release()

        self._create_params()

        self.deserialize(self.config.read_media(self.get_name()))
Exemple #5
0
    def __init__(self, config):
        # Go into configuration/template_media for more information
        super(Firewire, self).__init__()
        self.config = Configuration()
        self.camera = None
        self.is_streaming = False
        self.loop_try_open_camera = False
        self.call_stop = False
        self.sem_closed = threading.Semaphore()

        self.cam_guid = config.guid
        self.cam_no = config.no
        # the id is guid or no, writing into open_camera
        self.id = ""
        self.key_auto_param = "-auto"
        self.reference_param = {"power": self._power,
                                "transmission": self._transmission}

        fps = 15
        self.sleep_time = 1 / 15.0
        self.media_name = config.name
        self.last_timestamp = -1
        self.actual_timestamp = -1
        self.count_not_receive = 0
        self.max_not_receive = fps * 2
        self.buffer_last_timestamp = False
        self.own_config = config
        self.is_rgb = config.is_rgb
        self.is_mono = config.is_mono
        self.is_format_7 = config.is_format7
        self.is_yuv = config.is_yuv
        self.actual_image = None
        self.shape = (800, 600)
        self.count_no_image = 0
        self.max_no_image = 120

        self.lst_param_shutter = []
        self.lst_param_whitebalance = []

        if not self.try_open_camera(repeat_loop=3, sleep_time=1):
            return

        self._create_params()

        self.deserialize(self.config.read_media(self.get_name()))
        self.update_all_property()
Exemple #6
0
    def __init__(self, config):
        # Go into configuration/template_media for more information
        self.config = Configuration()
        self.own_config = config
        super(PygameCam, self).__init__()
        self.media_name = config.name
        self.run = True
        self.video = None
        self.thread_image = None
        pygame.init()
        pygame.camera.init()

        self._create_params()
        self.deserialize(self.config.read_media(self.get_name()))
        self.cam = None
        self._is_opened = True
        self.image = None
Exemple #7
0
    def __init__(self, config):
        # Go into configuration/template_media for more information
        super(IPC, self).__init__()
        self.config = Configuration()
        self.own_config = config
        self.media_name = config.name
        if config.device:
            self.device_name = config.device
        else:
            self.device_name = "/tmp/seagoatvision_media.ipc"
        self._is_opened = True
        self.run = True
        self.video = None

        self.context = zmq.Context()
        self.subscriber = None
        self.message = None

        self._create_params()
        self.deserialize(self.config.read_media(self.get_name()))
Exemple #8
0
#! /usr/bin/env python

#    Copyright (C) 2012-2014  Octets - octets.etsmtl.ca
#
#    This file is part of SeaGoatVision.
#
#    SeaGoatVision is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

from SeaGoatVision.server.core.configuration import Configuration
config = Configuration()

if config.get_is_show_public_filter():
    from public import *
if config.get_is_show_private_filter():
    from private import *