def start_capture(): global PID global name window = win32gui.GetForegroundWindow() title = get_title(window) if args.debug: print("Capture beginning, target window = {}".format(title)) name = namer.get_name() if not args.debug: # suppress all output from ffmpeg output = dict(stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) else: output = {} PID = subprocess.Popen('ffmpeg\\ffmpeg.exe -f gdigrab -i title="{title}" ' '-framerate 15 ' '{scale} ' '-c:v rawvideo -pix_fmt yuv420p ' '{name}.avi'.format(title=title, name=name, scale=get_scale_setting()), stdin=subprocess.PIPE, **output) print("\nCapturing has begun. Press {} again to stop!\n".format( hotkey_printable_name(config.record_hotkey)))
def draw(self, image_name, colorFn=None): """ Draws the intensity values given by pixel_mat using the coloration described in colorFn, then saves the new image as image_name """ image = Image.new("RGB", (self.w, self.h)) mtx = image.load() for x in range(self.w): for y in range(self.h): mtx[x, y] = tuple([atan_color(b.get_point(x, y)) for b in self.buddhas]) file_name = namer.get_name(image_name) image.save(file_name, "PNG")
def start_capture(): global PID global name window = win32gui.GetForegroundWindow() title = get_title(window) name = namer.get_name() PID = subprocess.Popen('ffmpeg\\ffmpeg.exe -f gdigrab -i title="{}" ' '-framerate 15 -vf "scale=\'iw/2\':-1" ' '-c:v rawvideo -pix_fmt yuv420p ' '{}.avi'.format(title, name), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, stdin=subprocess.PIPE) print("\nCapturing has begun. Press Alt+F9 again to stop!\n")