Saqib commited on
Commit
2f622a9
1 Parent(s): 1ebc125

Update modules/app.py

Browse files
Files changed (1) hide show
  1. modules/app.py +5 -2
modules/app.py CHANGED
@@ -104,7 +104,7 @@ async def concatenate_videos(input_data: VideosInput):
104
 
105
  # Download videos to temporary files
106
  for video_url in input_data.video_urls:
107
- temp_video_paths.append(await download_file(str(video_url), ".mp4"))
108
 
109
  # Generate a unique filename
110
  output_filename = f"{uuid.uuid4()}.mp4"
@@ -112,7 +112,10 @@ async def concatenate_videos(input_data: VideosInput):
112
 
113
  # Concatenate video clips using ffmpeg
114
  inputs = [ffmpeg.input(path) for path in temp_video_paths]
115
- ffmpeg.concat(*inputs, v=1, a=1).output(output_path, vcodec='libx264', acodec='aac').run()
 
 
 
116
 
117
  # Clean up temporary files
118
  for path in temp_video_paths:
 
104
 
105
  # Download videos to temporary files
106
  for video_url in input_data.video_urls:
107
+ temp_video_paths.append(await download_file(video_url, ".mp4"))
108
 
109
  # Generate a unique filename
110
  output_filename = f"{uuid.uuid4()}.mp4"
 
112
 
113
  # Concatenate video clips using ffmpeg
114
  inputs = [ffmpeg.input(path) for path in temp_video_paths]
115
+ concat_input = ffmpeg.concat(*inputs, v=1, a=1).node
116
+ video = concat_input[0]
117
+ audio = concat_input[1]
118
+ ffmpeg.output(video, audio, output_path, vcodec='libx264', acodec='aac').run()
119
 
120
  # Clean up temporary files
121
  for path in temp_video_paths: