fffiloni commited on
Commit
e908561
·
1 Parent(s): 11cb0d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -58,25 +58,23 @@ def resize_video(input_file, new_width):
58
 
59
  # Resize the video clip
60
  resized_clip = clip.resize(width=new_width_adjusted, height=new_height_adjusted)
61
-
62
- temp_output_path = 'temp_output/'
63
- os.makedirs(temp_output_path, exist_ok=True)
64
 
65
  # Check if the file already exists
66
- if os.path.exists('temp_output/video_resized.mp4'):
67
  # Delete the existing file
68
- os.remove('temp_output/video_resized.mp4')
69
 
70
  # Write the resized video to a file
71
- resized_clip.write_videofile('temp_output/video_resized.mp4', codec="libx264")
72
 
73
  # Close the video clip
74
  clip.close()
75
 
76
 
77
- final_video_resized = os.path.join(temp_output_path, 'video_resized.mp4')
78
-
79
- return final_video_resized
 
80
 
81
  def run_inference(prompt, video_path, condition, video_length):
82
 
 
58
 
59
  # Resize the video clip
60
  resized_clip = clip.resize(width=new_width_adjusted, height=new_height_adjusted)
 
 
 
61
 
62
  # Check if the file already exists
63
+ if os.path.exists('video_resized.mp4'):
64
  # Delete the existing file
65
+ os.remove('video_resized.mp4')
66
 
67
  # Write the resized video to a file
68
+ resized_clip.write_videofile('video_resized.mp4', codec="libx264")
69
 
70
  # Close the video clip
71
  clip.close()
72
 
73
 
74
+ #final_video_resized = os.path.join(temp_output_path, 'video_resized.mp4')
75
+ test_w, test_h, fps = get_video_dimension('video_resized.mp4')
76
+ print(f"resized clip dims : {test_w}, {test_h}, {fps}")
77
+ return 'video_resized.mp4'
78
 
79
  def run_inference(prompt, video_path, condition, video_length):
80