Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -238,6 +238,8 @@ def get_video_duration(video_path):
|
|
| 238 |
video = VideoFileClip(video_path)
|
| 239 |
return video.duration
|
| 240 |
|
|
|
|
|
|
|
| 241 |
def get_audio(video_path, caption):
|
| 242 |
# 允许caption为空
|
| 243 |
if caption is None:
|
|
@@ -306,9 +308,6 @@ def get_audio(video_path, caption):
|
|
| 306 |
audio_path = tmp_audio.name
|
| 307 |
return audio_path
|
| 308 |
|
| 309 |
-
get_audio("./examples/3_mute.mp4", "Axe striking")
|
| 310 |
-
# 合成新视频:用ffmpeg将音频与原视频合成
|
| 311 |
-
|
| 312 |
def synthesize_video_with_audio(video_file, caption):
|
| 313 |
# 允许caption为空
|
| 314 |
if caption is None:
|
|
|
|
| 238 |
video = VideoFileClip(video_path)
|
| 239 |
return video.duration
|
| 240 |
|
| 241 |
+
@spaces.GPU(duration=120)
|
| 242 |
+
@torch.inference_mode()
|
| 243 |
def get_audio(video_path, caption):
|
| 244 |
# 允许caption为空
|
| 245 |
if caption is None:
|
|
|
|
| 308 |
audio_path = tmp_audio.name
|
| 309 |
return audio_path
|
| 310 |
|
|
|
|
|
|
|
|
|
|
| 311 |
def synthesize_video_with_audio(video_file, caption):
|
| 312 |
# 允许caption为空
|
| 313 |
if caption is None:
|