Skip over thumbnails that already exist
This commit is contained in:
@@ -100,11 +100,17 @@ def worker(queue):
|
|||||||
# If no work unit then quit
|
# If no work unit then quit
|
||||||
if not work_unit:
|
if not work_unit:
|
||||||
break
|
break
|
||||||
|
# Handle exception when no more items in queue
|
||||||
except:
|
except:
|
||||||
break
|
break
|
||||||
|
|
||||||
input_file, output_file, interval, size, columns = work_unit
|
input_file, output_file, interval, size, columns = work_unit
|
||||||
|
|
||||||
|
# Skip over any thumbnails that exist already
|
||||||
|
if os.path.exists(output_file):
|
||||||
|
print("[{}] Already exists, skipping".format(output_file))
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
video_file_clip = VideoFileClip(input_file)
|
video_file_clip = VideoFileClip(input_file)
|
||||||
output_prefix = get_output_prefix()
|
output_prefix = get_output_prefix()
|
||||||
@@ -114,7 +120,7 @@ def worker(queue):
|
|||||||
generate_sprite_from_frames(output_prefix, columns,
|
generate_sprite_from_frames(output_prefix, columns,
|
||||||
size, output_file)
|
size, output_file)
|
||||||
except:
|
except:
|
||||||
print("Error occurred with file: {}".format(file_name))
|
print("[{}] Error occurred with file".format(file_name))
|
||||||
|
|
||||||
|
|
||||||
def generate_frames(file_name, video_file_clip, interval, output_prefix, size):
|
def generate_frames(file_name, video_file_clip, interval, output_prefix, size):
|
||||||
|
|||||||
Reference in New Issue
Block a user