Spanicin commited on
Commit
f3d0484
·
verified ·
1 Parent(s): 77b124c

Update src/utils/videoio.py

Browse files
Files changed (1) hide show
  1. src/utils/videoio.py +4 -4
src/utils/videoio.py CHANGED
@@ -33,10 +33,10 @@ def save_video_with_watermark(video, audio, save_path, watermark=False):
33
  # Combine audio and video
34
  final_clip = video_clip.set_audio(audio_clip)
35
 
36
- #temp_file = tempfile.NamedTemporaryFile(suffix='.mp4', delete=False)
37
- #temp_file.close() # Close the file so it can be opened by MoviePy
38
- temp_file_path = str(uuid.uuid4())+'.avi'
39
- final_clip.write_videofile(temp_file_path,temp_audiofile_path='/tmp')
40
 
41
  with open(temp_file_path, 'rb') as f:
42
  video_content = f.read()
 
33
  # Combine audio and video
34
  final_clip = video_clip.set_audio(audio_clip)
35
 
36
+ temp_file = tempfile.NamedTemporaryFile(suffix='.avi', delete=False)
37
+ temp_file.close() # Close the file so it can be opened by MoviePy
38
+ temp_file_path = temp_file.name
39
+ final_clip.write_videofile(temp_file_path)
40
 
41
  with open(temp_file_path, 'rb') as f:
42
  video_content = f.read()