Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -85,9 +85,9 @@ def convert_video(video_file, quality, aspect_ratio, video_url):
|
|
85 |
return output_path
|
86 |
else:
|
87 |
# The file does not exist, so we need to convert it
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
|
92 |
ffmpeg_command = f"ffmpeg -i {input_path} -c:v libx264 -crf {quality} -vf scale=-1:720,setsar={aspect_ratio} -hls_time 6 -hls_playlist_type vod -f hls {output_path}"
|
93 |
|
|
|
85 |
return output_path
|
86 |
else:
|
87 |
# The file does not exist, so we need to convert it
|
88 |
+
if aspect_ratio is None:
|
89 |
+
video = VideoFileClip(input_path)
|
90 |
+
aspect_ratio = f"{video.size[0]}:{video.size[1]}"
|
91 |
|
92 |
ffmpeg_command = f"ffmpeg -i {input_path} -c:v libx264 -crf {quality} -vf scale=-1:720,setsar={aspect_ratio} -hls_time 6 -hls_playlist_type vod -f hls {output_path}"
|
93 |
|