Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -44,17 +44,18 @@ def convert_video(video_file: File, quality, aspect_ratio, video_url):
|
|
44 |
if video_file is None:
|
45 |
video_file = Path(video_url)
|
46 |
|
47 |
-
output_path = f"{temp_dir}/{video_file.name}"
|
48 |
-
|
49 |
# Get the file extension
|
50 |
file_extension = video_file.name.split(".")[-1]
|
51 |
|
52 |
# Remove the file extension
|
53 |
-
output_path =
|
54 |
|
55 |
# Add the .m3u8 file extension
|
56 |
output_path += ".m3u8"
|
57 |
|
|
|
|
|
|
|
58 |
ffmpeg_command = f"ffmpeg -i {video_file} -c:v libx264 -crf {quality} -f hls -aspect {aspect_ratio} {output_path}"
|
59 |
|
60 |
try:
|
|
|
44 |
if video_file is None:
|
45 |
video_file = Path(video_url)
|
46 |
|
|
|
|
|
47 |
# Get the file extension
|
48 |
file_extension = video_file.name.split(".")[-1]
|
49 |
|
50 |
# Remove the file extension
|
51 |
+
output_path = video_file.name[:-len(file_extension)]
|
52 |
|
53 |
# Add the .m3u8 file extension
|
54 |
output_path += ".m3u8"
|
55 |
|
56 |
+
# Set the output path to the temp directory
|
57 |
+
output_path = f"{temp_dir}/{output_path}"
|
58 |
+
|
59 |
ffmpeg_command = f"ffmpeg -i {video_file} -c:v libx264 -crf {quality} -f hls -aspect {aspect_ratio} {output_path}"
|
60 |
|
61 |
try:
|