Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -77,12 +77,6 @@ def convert_video(video, target_format, conversion_type, time_in_seconds=None):
|
|
77 |
image_output_file = f"flowly_ai_video_to_image_{sanitized_base_name}_{time_in_seconds}.png"
|
78 |
ffmpeg.input(video_path, ss=time_in_seconds).output(image_output_file, vframes=1).overwrite_output().run() # Add .overwrite_output()
|
79 |
|
80 |
-
# Convert the image to the desired format using Pillow
|
81 |
-
img = Image.open(image_output_file)
|
82 |
-
if target_format.lower() in image_formats:
|
83 |
-
image_output_file = f"flowly_ai_video_to_image_{sanitized_base_name}_{time_in_seconds}.{target_format.lower()}"
|
84 |
-
img.save(image_output_file, target_format.upper()) # Save with the desired format
|
85 |
-
|
86 |
return image_output_file
|
87 |
|
88 |
except Exception as e:
|
|
|
77 |
image_output_file = f"flowly_ai_video_to_image_{sanitized_base_name}_{time_in_seconds}.png"
|
78 |
ffmpeg.input(video_path, ss=time_in_seconds).output(image_output_file, vframes=1).overwrite_output().run() # Add .overwrite_output()
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
return image_output_file
|
81 |
|
82 |
except Exception as e:
|