本文整理汇总了Python中video.Video.generate_thumbnail方法的典型用法代码示例。如果您正苦于以下问题:Python Video.generate_thumbnail方法的具体用法?Python Video.generate_thumbnail怎么用?Python Video.generate_thumbnail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类video.Video
的用法示例。
在下文中一共展示了Video.generate_thumbnail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _set_monitoring
# 需要导入模块: from video import Video [as 别名]
# 或者: from video.Video import generate_thumbnail [as 别名]
def _set_monitoring(value):
global is_monitoring
if value == video.ON_STRING:
is_monitoring = True
else:
is_monitoring = False
if video.recording:
Video.generate_thumbnail(video.stop_recording(), hres=args.horizontal_resolution,
vres=args.vertical_resolution)
示例2: set_logger
# 需要导入模块: from video import Video [as 别名]
# 或者: from video.Video import generate_thumbnail [as 别名]
# logging setup
logger = set_logger(level=args.log_level)
video = Video(
rotation=args.rotation,
horizontal_resolution=args.horizontal_resolution,
vertical_resolution=args.vertical_resolution
)
video.start()
pir = PIR(args.pin)
pir.start()
mqtt = MqttClient(args.endpoint, args.log_level, args.port)
mqtt.set_tls(args.ca_file, args.client_cert_file, args.client_key_file)
mqtt.add_callback(args.topic + args.subtopic, receive_command)
mqtt.add_subscription(args.topic + args.subtopic, qos=args.qos)
mqtt.loop_start()
# loop
while True:
is_moving = pir.detects_movement()
if is_monitoring:
if not is_moving:
if video.recording:
Video.generate_thumbnail(video.stop_recording(), hres=args.horizontal_resolution,
vres=args.vertical_resolution)
elif is_moving:
video.start_recording()
sleep(args.wait)