예제 #1
0
def record_epiphan_dvi2pcieduo_sdi_bgra_vp9():
    port = gg.Device.DVI2PCIeDuo_SDI
    colour_space = gg.ColourSpace.BGRA
    frame = gg.VideoFrame(colour_space, True)
    codec = gg.Codec.VP9
    __record_epiphan_dvi2pcieduo(port,
                                 colour_space,
                                 frame,
                                 num_frames,
                                 codec)
예제 #2
0
def record_epiphan_dvi2pcieduo_dvi_bgra_hevc():
    port = gg.Device.DVI2PCIeDuo_DVI
    colour_space = gg.ColourSpace.BGRA
    frame = gg.VideoFrame(colour_space, True)
    codec = gg.Codec.HEVC
    __record_epiphan_dvi2pcieduo(port,
                                 colour_space,
                                 frame,
                                 num_frames,
                                 codec)
예제 #3
0
def record_epiphan_dvi2pcieduo_dvi_i420_vp9():
    port = gg.Device.DVI2PCIeDuo_DVI
    colour_space = gg.ColourSpace.I420
    frame = gg.VideoFrame(colour_space, True)
    codec = gg.Codec.VP9
    __record_epiphan_dvi2pcieduo(port,
                                 colour_space,
                                 frame,
                                 num_frames,
                                 codec)
예제 #4
0
def record_epiphan_dvi2pcieduo_sdi_i420_hevc():
    port = gg.Device.DVI2PCIeDuo_SDI
    colour_space = gg.ColourSpace.I420
    frame = gg.VideoFrame(colour_space, True)
    codec = gg.Codec.HEVC
    __record_epiphan_dvi2pcieduo(port,
                                 colour_space,
                                 frame,
                                 num_frames,
                                 codec)
예제 #5
0
    def resume_recording(self):
        """Resume a `start()`ed and paused recorder.

        This will create and open a new video `file`.

        @see pause_recording()
        """
        # TODO - this line is quick hack because of GiftGrab#37
        if not self.is_running:
            return

        if self.is_recording:
            return

        if self.device:
            # TODO - rows and cols setting because of GiftGrab#40
            if self.sub_frame:
                self.device.set_sub_frame(self.sub_frame[0], self.sub_frame[1],
                                          self.sub_frame[2], self.sub_frame[3])
                cols = self.sub_frame[2]
                rows = self.sub_frame[3]
            else:
                self.device.get_full_frame()
                cols = MAX_X
                rows = MAX_Y

            tmp_frame = pygiftgrab.VideoFrame(self.colour_space, False)
            got_frame = self.device.get_frame(tmp_frame)
            if got_frame:
                cols = tmp_frame.cols()
                rows = tmp_frame.rows()
            self.black_frame = pygiftgrab.VideoFrame(self.colour_space, cols,
                                                     rows)
        else:
            return

        if self.__create_video_writer():
            if self.__init_video_writer():
                if self.__start_acquisition():
                    self.started_at = time()
                    self.is_recording = True