eienmojiki commited on
Commit
eb3b7f8
·
verified ·
1 Parent(s): 0c6db82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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
- #@spaces.GPU()
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
- #"-hwaccel",
41
- #"cuda",
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",