mirror of
https://github.com/k4yt3x/video2x.git
synced 2024-12-29 16:09:10 +00:00
added some print statements for users and debugging
This commit is contained in:
parent
3aba59f8ea
commit
f263fa09f3
@ -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')
|
||||||
|
Loading…
Reference in New Issue
Block a user