Update app.py
Browse files
app.py
CHANGED
|
@@ -8,11 +8,11 @@ import ffmpeg
|
|
| 8 |
def finalise_video(start_video):
|
| 9 |
try:
|
| 10 |
with tempfile.NamedTemporaryFile(suffix=".mp4", delete=False) as video_tmpfile:
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
|
| 17 |
with tempfile.NamedTemporaryFile(suffix=".mp4", delete=False) as audio_tmpfile:
|
| 18 |
video_with_audio_path = audio_tmpfile.name
|
|
|
|
| 8 |
def finalise_video(start_video):
|
| 9 |
try:
|
| 10 |
with tempfile.NamedTemporaryFile(suffix=".mp4", delete=False) as video_tmpfile:
|
| 11 |
+
if isinstance(start_video, str):
|
| 12 |
+
shutil.copy(start_video, video_tmpfile.name)
|
| 13 |
+
else:
|
| 14 |
+
start_video.save(video_tmpfile.name, format="MP4")
|
| 15 |
+
video_path = video_tmpfile.name
|
| 16 |
|
| 17 |
with tempfile.NamedTemporaryFile(suffix=".mp4", delete=False) as audio_tmpfile:
|
| 18 |
video_with_audio_path = audio_tmpfile.name
|