artificialguybr commited on
Commit
10ac59a
1 Parent(s): ad00a5d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -64,7 +64,9 @@ def process_video(radio, video, target_language):
64
  output_filename = f"{run_uuid}_resized_video.mp4"
65
  ffmpeg.input(video).output(output_filename, vf='scale=-1:720').run()
66
  video_path = output_filename
67
-
 
 
68
  if not os.path.exists(video_path):
69
  return f"Error: {video_path} does not exist."
70
 
@@ -134,6 +136,12 @@ def process_video(radio, video, target_language):
134
  except FileNotFoundError:
135
  print(f"File {file} not found for deletion.")
136
 
 
 
 
 
 
 
137
  return output_video_path
138
 
139
  # Display peak usages at the end
 
64
  output_filename = f"{run_uuid}_resized_video.mp4"
65
  ffmpeg.input(video).output(output_filename, vf='scale=-1:720').run()
66
  video_path = output_filename
67
+
68
+ #Time tracking
69
+ start_time = time.time()
70
  if not os.path.exists(video_path):
71
  return f"Error: {video_path} does not exist."
72
 
 
136
  except FileNotFoundError:
137
  print(f"File {file} not found for deletion.")
138
 
139
+ # Stop the timer
140
+ end_time = time.time()
141
+
142
+ # Calculate and print the time taken
143
+ time_taken = end_time - start_time
144
+ print(f"Time taken to process video: {time_taken:.2f} seconds")
145
  return output_video_path
146
 
147
  # Display peak usages at the end