Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def get_file_size(file_path):
|
|
16 |
return f"{size_bytes:.2f} {unit}"
|
17 |
size_bytes /= 1024
|
18 |
|
19 |
-
|
20 |
def compress_video(video_file):
|
21 |
"""Compresses the uploaded video using FFmpeg and returns the output video path and file sizes."""
|
22 |
if video_file is None:
|
@@ -37,8 +37,8 @@ def compress_video(video_file):
|
|
37 |
# Execute ffmpeg command
|
38 |
command = [
|
39 |
"ffmpeg",
|
40 |
-
|
41 |
-
|
42 |
"-i", input_path,
|
43 |
"-vcodec", "libx264",
|
44 |
"-crf", "28",
|
|
|
16 |
return f"{size_bytes:.2f} {unit}"
|
17 |
size_bytes /= 1024
|
18 |
|
19 |
+
@spaces.GPU(duration=120)
|
20 |
def compress_video(video_file):
|
21 |
"""Compresses the uploaded video using FFmpeg and returns the output video path and file sizes."""
|
22 |
if video_file is None:
|
|
|
37 |
# Execute ffmpeg command
|
38 |
command = [
|
39 |
"ffmpeg",
|
40 |
+
"-hwaccel",
|
41 |
+
"cuda",
|
42 |
"-i", input_path,
|
43 |
"-vcodec", "libx264",
|
44 |
"-crf", "28",
|