added some print statements for users and debugging

This commit is contained in:
K4YT3X 2018-10-22 15:35:46 -04:00
parent 3aba59f8ea
commit f263fa09f3

View File

@ -207,6 +207,7 @@ def video2x():
# Extract frames from video # Extract frames from video
fm.extract_frames(args.video, FRAMES) fm.extract_frames(args.video, FRAMES)
Avalon.info('Reading video information')
info = get_video_info() info = get_video_info()
# Analyze original video with ffprobe and retrieve framerate # Analyze original video with ffprobe and retrieve framerate
# width, height = info['streams'][0]['width'], info['streams'][0]['height'] # width, height = info['streams'][0]['width'], info['streams'][0]['height']
@ -218,6 +219,10 @@ def video2x():
video_stream_index = stream['index'] video_stream_index = stream['index']
break break
# Exit if no video stream found
if video_stream_index is None:
Avalon.error('Aborting: No video stream found')
# Get average frame rate of video stream # Get average frame rate of video stream
framerate = float(Fraction(info['streams'][video_stream_index]['avg_frame_rate'])) framerate = float(Fraction(info['streams'][video_stream_index]['avg_frame_rate']))
Avalon.info('Framerate: {}'.format(framerate)) Avalon.info('Framerate: {}'.format(framerate))
@ -225,11 +230,12 @@ def video2x():
# Upscale images one by one using waifu2x # Upscale images one by one using waifu2x
Avalon.info('Starting to upscale extracted images') Avalon.info('Starting to upscale extracted images')
upscale_frames(w2) upscale_frames(w2)
Avalon.info('Upscaling complete') Avalon.info('Upscaling completed')
# Frames to Video # Frames to Video
Avalon.info('Converting extracted frames into video') Avalon.info('Converting extracted frames into video')
fm.convert_video(framerate, '{}x{}'.format(args.width, args.height), UPSCALED) fm.convert_video(framerate, '{}x{}'.format(args.width, args.height), UPSCALED)
Avalon.info('Conversion completed')
# Extract and press audio in # Extract and press audio in
Avalon.info('Stripping audio track from original video') Avalon.info('Stripping audio track from original video')