test-rtechs commited on
Commit
b4307d4
·
verified ·
1 Parent(s): 27189b9

Update app_rvc.py

Browse files
Files changed (1) hide show
  1. app_rvc.py +6 -1
app_rvc.py CHANGED
@@ -309,8 +309,13 @@ def download_and_adjust_youtube_video(url, speed_factor, start_time=None, end_ti
309
  # Generate output filename
310
  output_filename = f"downloaded/{os.path.splitext(os.path.basename(filename))[0]}_speed{speed_factor}.mp4"
311
 
 
 
 
 
 
312
  # Write the adjusted video
313
- adjusted_video.write_videofile(output_filename)
314
 
315
  # Close the video objects
316
  video.close()
 
309
  # Generate output filename
310
  output_filename = f"downloaded/{os.path.splitext(os.path.basename(filename))[0]}_speed{speed_factor}.mp4"
311
 
312
+ # Set a default fps if it's not available
313
+ fps = video.fps
314
+ if fps is None:
315
+ fps = 30 # Default to 30 fps if not available
316
+
317
  # Write the adjusted video
318
+ adjusted_video.write_videofile(output_filename, fps=fps)
319
 
320
  # Close the video objects
321
  video.close()