Update app.py
Browse files
app.py
CHANGED
|
@@ -100,9 +100,13 @@ def generate_video():
|
|
| 100 |
# Save received video file
|
| 101 |
with open(f"/app/data/video/clip{id}.mp4", "wb") as f:
|
| 102 |
f.write(response.content)
|
| 103 |
-
return f"/app/data/video/clip{id}.mp4"
|
| 104 |
else:
|
| 105 |
raise Exception(f"Error from Space B: {response.text}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
except Exception as e:
|
| 107 |
traceback.print_exc()
|
| 108 |
return jsonify({"error": str(e)}), 500
|
|
|
|
| 100 |
# Save received video file
|
| 101 |
with open(f"/app/data/video/clip{id}.mp4", "wb") as f:
|
| 102 |
f.write(response.content)
|
|
|
|
| 103 |
else:
|
| 104 |
raise Exception(f"Error from Space B: {response.text}")
|
| 105 |
+
|
| 106 |
+
video_path = video_com(lines)
|
| 107 |
+
for img in image_files:
|
| 108 |
+
os.remove(img)
|
| 109 |
+
return send_file(video_path, mimetype='video/mp4')
|
| 110 |
except Exception as e:
|
| 111 |
traceback.print_exc()
|
| 112 |
return jsonify({"error": str(e)}), 500
|