Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Miquel Farre
commited on
Commit
·
724065d
1
Parent(s):
0cd7910
swap file paths for urls
Browse files
app.py
CHANGED
|
@@ -313,12 +313,11 @@ def process_video(video_id: str):
|
|
| 313 |
try:
|
| 314 |
#logger.info(f"Processing video with ID: {video_id}")
|
| 315 |
metadata = load_metadata(video_id)
|
| 316 |
-
|
| 317 |
-
# video_path = os.path.join(video_folder, f"{video_id}.mp4")
|
| 318 |
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
|
| 323 |
# Character List Table
|
| 324 |
character_table = """
|
|
@@ -360,7 +359,7 @@ def process_video(video_id: str):
|
|
| 360 |
filmstrip_html = create_filmstrip(metadata['scenes'], video_duration)
|
| 361 |
|
| 362 |
logger.info("Video processing completed successfully")
|
| 363 |
-
return
|
| 364 |
except Exception as e:
|
| 365 |
logger.exception(f"Error processing video: {str(e)}")
|
| 366 |
return None, "", f"Error processing video: {str(e)}"
|
|
|
|
| 313 |
try:
|
| 314 |
#logger.info(f"Processing video with ID: {video_id}")
|
| 315 |
metadata = load_metadata(video_id)
|
| 316 |
+
video_path = os.path.join(video_folder, f"{video_id}.mp4")
|
|
|
|
| 317 |
|
| 318 |
+
if not os.path.exists(video_path):
|
| 319 |
+
logger.error(f"Video file not found: {video_path}")
|
| 320 |
+
return None, "", f"Error: Video file not found for ID {video_id}"
|
| 321 |
|
| 322 |
# Character List Table
|
| 323 |
character_table = """
|
|
|
|
| 359 |
filmstrip_html = create_filmstrip(metadata['scenes'], video_duration)
|
| 360 |
|
| 361 |
logger.info("Video processing completed successfully")
|
| 362 |
+
return video_path, filmstrip_html, additional_data + scenes_output + storylines_output + qa_output + trimming_suggestions_output
|
| 363 |
except Exception as e:
|
| 364 |
logger.exception(f"Error processing video: {str(e)}")
|
| 365 |
return None, "", f"Error processing video: {str(e)}"
|