Bug fix - worker was only taking one item and terminating after
This commit is contained in:
21
generator
21
generator
@@ -93,18 +93,19 @@ def generate_video_thumbnails(args):
|
|||||||
|
|
||||||
|
|
||||||
def worker(queue):
|
def worker(queue):
|
||||||
work_unit = queue.get()
|
while True:
|
||||||
|
work_unit = queue.get()
|
||||||
|
|
||||||
# If no work unit then quit
|
# If no work unit then quit
|
||||||
if not work_unit:
|
if not work_unit:
|
||||||
return
|
return
|
||||||
|
|
||||||
input_file, output_file, interval, size, columns = work_unit
|
input_file, output_file, interval, size, columns = work_unit
|
||||||
video_file_clip = VideoFileClip(input_file)
|
video_file_clip = VideoFileClip(input_file)
|
||||||
output_prefix = get_output_prefix()
|
output_prefix = get_output_prefix()
|
||||||
file_name = os.path.basename(input_file)
|
file_name = os.path.basename(input_file)
|
||||||
generate_frames(file_name, video_file_clip, interval, output_prefix, size)
|
generate_frames(file_name, video_file_clip, interval, output_prefix, size)
|
||||||
generate_sprite_from_frames(output_prefix, columns, size, output_file)
|
generate_sprite_from_frames(output_prefix, columns, size, output_file)
|
||||||
|
|
||||||
|
|
||||||
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