want_channels = sys.argv[1:] for program in programs: channel = program.find("GuideNumber").text name = program.find("GuideName").text if len(want_channels) > 0: if channel not in want_channels: #print("skipping %s - %s" % (channel,name)) continue print("scanning %s - %s" % (channel, name)) current_target = libhdhr.device_get_tuner_target(device) if current_target != target: libhdhr.device_set_tuner_target(device, target) vchannel_result = libhdhr.device_set_tuner_vchannel(device, str(channel)) vstatus = libhdhr.device_get_tuner_vstatus(device) ffprobe_prober = ffprobe.ffprobe() ffmpeg_screenshotter = ffmpeg.ffmpeg() ffmpeg_screenshotter.output = [ '/www/hdhr.adam.gs/scanner/%s/%s-%s.png' % ( dir_timestamp, vstatus[2].vchannel.replace("/", "_"), vstatus[2].name ) ] ffmpeg_screenshotter.debug = False ffmpeg_screenshotter.start() need_data = True last = time.time() started = time.time() meta = {} while need_data is True:
screenshotter.output = [ '/www/hdhr.adam.gs/screenshot/%s-%s-%s.png' % ( time.strftime("%Y-%m-%d_%H:%M:%S_%Z"), vstatus[2].vchannel, vstatus[2].name ) ] screenshotter.start() print "\n%s - %s:%d : making screenshot" % ( time.strftime("%Y-%m-%d %H:%M:%S %Z"), data[1][0], data[1][1], ) elif command == "PROBE": prober = ffprobe.ffprobe() print "\n%s - %s:%d : probing" % ( time.strftime("%Y-%m-%d %H:%M:%S %Z"), data[1][0], data[1][1], ) elif command == "SET_CHANNEL": prober = ffprobe.ffprobe() print "\n%s - %s:%d : setting vchannel to %d" % ( time.strftime("%Y-%m-%d %H:%M:%S %Z"), data[1][0], data[1][1], int(args[0]) ) vchannel_result = libhdhr.device_set_tuner_vchannel(device, args[0]) if vchannel_result == 0:
want_channels = sys.argv[1:] for program in programs: channel = program.find("GuideNumber").text name = program.find("GuideName").text if len(want_channels) > 0: if channel not in want_channels: #print("skipping %s - %s" % (channel,name)) continue print("scanning %s - %s" % (channel, name)) current_target = libhdhr.device_get_tuner_target(device) if current_target != target: libhdhr.device_set_tuner_target(device, target) vchannel_result = libhdhr.device_set_tuner_vchannel(device, str(channel)) vstatus = libhdhr.device_get_tuner_vstatus(device) ffprobe_prober = ffprobe.ffprobe() ffmpeg_screenshotter = ffmpeg.ffmpeg() ffmpeg_screenshotter.output = [ '/www/hdhr.adam.gs/scanner/%s/%s-%s.png' % (dir_timestamp, vstatus[2].vchannel.replace("/", "_"), vstatus[2].name) ] ffmpeg_screenshotter.debug = False ffmpeg_screenshotter.start() need_data = True last = time.time() started = time.time() meta = {} while need_data is True: try: data = listener.recvfrom(2048) except:
def probe_frames(self, input_path): print("Generating frame list...") data = ffprobe.ffprobe("-show_frames", input_path) print("Locating correct keyframes...") keyframes = self.convert_ffprobe_keyframes(data['frames']) return keyframes