File size: 1,542 Bytes
93e8e20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import json
import logging
from pathlib import Path
from video_assembler import assemble_video

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

# Load the JSON
json_path = "output/ai_tools_20260322_095831.json"
with open(json_path, "r") as f:
    video_json = json.load(f)

# Mock audio results (first 3 scenes only for speed)
audio_results = [
    {"scene_number": 1, "path": "assets/audio/scene_01.mp3", "duration": 4.6},
    {"scene_number": 2, "path": "assets/audio/scene_02.mp3", "duration": 3.1},
    {"scene_number": 3, "path": "assets/audio/scene_03.mp3", "duration": 3.5},
]

# Mock media results (first 3 scenes)
# I'll find existing clips in assets/clips
clips_dir = Path("assets/clips")
media_results = []
for i in range(1, 4):
    found = list(clips_dir.glob(f"scene_{i:02d}_*.mp4"))
    if found:
        media_results.append({
            "scene_number": i,
            "path": str(found[0]),
            "type": "video",
            "approved": True
        })

# Trim JSON to 3 scenes
video_json["scenes"] = video_json["scenes"][:3]

logger.info("Starting standalone assembly test...")
try:
    output_path = assemble_video(
        video_json=video_json,
        audio_results=audio_results,
        media_results=media_results,
        editing_style="social_media",
        output_filename="assembly_verify_test.mp4"
    )
    print(f"\nSUCCESS: Video assembled at {output_path}")
except Exception as e:
    import traceback
    print(f"\nFAILURE: Assembly failed!")
    traceback.print_exc()