Skip to main content
Glama
overlays_showcase.pyβ€’12 kB
#!/usr/bin/env python3 """ Overlays Showcase Demonstrates all 6 overlay components with various styles and configurations. Shows: TitleScene, TextOverlay, EndScreen, LowerThird, SubscribeButton Usage: python examples/overlays_showcase.py """ import sys from pathlib import Path # Add parent directory to path for development sys.path.insert(0, str(Path(__file__).parent.parent / "src")) from chuk_motion.utils.project_manager import ProjectManager import shutil def generate_overlays_showcase(): """Generate comprehensive showcase of all overlay components.""" project_name = "overlays_showcase" project_manager = ProjectManager() # Clean up existing project project_path_obj = project_manager.workspace_dir / project_name if project_path_obj.exists(): print(f"πŸ”„ Removing existing project: {project_path_obj}") shutil.rmtree(project_path_obj) print(f"\n{'='*70}") print(f"OVERLAYS SHOWCASE") print(f"All 6 Overlay Components") print(f"{'='*70}\n") # Create base project project_info = project_manager.create_project(project_name) project_path = Path(project_info["path"]) print(f"βœ… Created base project at: {project_path}") theme = "tech" scenes = [] start_frame = 0 scene_duration = 120 # 4 seconds per overlay at 30fps title_duration = 60 # 2 seconds for title slides # Helper to add scene and increment start_frame def add_scene(scene_dict, duration=scene_duration): nonlocal start_frame scene_dict["startFrame"] = start_frame scene_dict["durationInFrames"] = duration scenes.append(scene_dict) start_frame += duration def add_overlay_with_title(number, name, description, overlay_scene_dict): """Add a title slide followed by the overlay demo.""" add_scene({ "type": "TitleScene", "config": { "text": f"{number}. {name}", "subtitle": description, "variant": "minimal", "animation": "fade" } }, duration=title_duration) add_scene(overlay_scene_dict) # ======================================== # INTRODUCTION # ======================================== print("\n🎬 Creating Introduction") add_scene({ "type": "TitleScene", "config": { "text": "Overlays Showcase", "subtitle": "6 Professional Overlay Components", "variant": "bold", "animation": "fade_zoom" } }, duration=90) # ======================================== # 1. TITLE SCENE - Bold Variant # ======================================== print("\n🎬 1. TitleScene - Bold") add_overlay_with_title( 1, "TitleScene", "Bold variant for strong impact", { "type": "TitleScene", "config": { "text": "Big Announcement", "subtitle": "Something amazing is coming", "variant": "bold", "animation": "fade_zoom" } } ) # ======================================== # 2. TITLE SCENE - Glass Variant # ======================================== print("\n🎬 2. TitleScene - Glass") add_overlay_with_title( 2, "TitleScene", "Glass variant for modern look", { "type": "TitleScene", "config": { "text": "Modern Design", "subtitle": "Glassmorphism aesthetics", "variant": "glass", "animation": "slide" } } ) # ======================================== # 3. TITLE SCENE - Minimal Variant # ======================================== print("\n🎬 3. TitleScene - Minimal") add_overlay_with_title( 3, "TitleScene", "Minimal variant for subtlety", { "type": "TitleScene", "config": { "text": "Clean & Simple", "subtitle": "Less is more", "variant": "minimal", "animation": "fade" } } ) # ======================================== # 4. TEXT OVERLAY # ======================================== print("\nπŸ’¬ 4. TextOverlay") add_overlay_with_title( 4, "TextOverlay", "Floating text over content", { "type": "TextOverlay", "config": { "text": "This is a text overlay that appears on top of your content", "position": "center", "font_size": 48, "background_opacity": 0.7 }, "content": { "type": "DemoBox", "config": { "label": "Background Content\n\nText overlays appear on top", "color": "primary" } } } ) # ======================================== # 5. LOWER THIRD - Bottom Left # ======================================== print("\nπŸ“ 5. LowerThird - Bottom Left") add_overlay_with_title( 5, "LowerThird", "Name tags and context - bottom left", { "type": "LowerThird", "config": { "name": "Sarah Johnson", "title": "Chief Technology Officer", "variant": "modern", "position": "bottom_left" }, "content": { "type": "DemoBox", "config": { "label": "Interview Footage\n\nπŸ‘€", "color": "accent" } } } ) # ======================================== # 6. LOWER THIRD - Bottom Right # ======================================== print("\nπŸ“ 6. LowerThird - Bottom Right") add_overlay_with_title( 6, "LowerThird", "Name tags - bottom right position", { "type": "LowerThird", "config": { "name": "Alex Chen", "title": "Senior Software Engineer", "variant": "glass", "position": "bottom_right" }, "content": { "type": "DemoBox", "config": { "label": "Demo Content\n\nπŸ’»", "color": "secondary" } } } ) # ======================================== # 7. SUBSCRIBE BUTTON # ======================================== print("\nπŸ”” 7. SubscribeButton") add_overlay_with_title( 7, "SubscribeButton", "Animated call-to-action button", { "type": "SubscribeButton", "config": { "text": "Subscribe", "position": "bottom_right", "show_bell": True, "animate": True }, "content": { "type": "DemoBox", "config": { "label": "Video Content\n\nDon't forget to subscribe!", "color": "primary" } } } ) # ======================================== # 8. END SCREEN # ======================================== print("\n🎬 8. EndScreen") add_overlay_with_title( 8, "EndScreen", "Professional video ending", { "type": "EndScreen", "config": { "title": "Thanks for Watching!", "subtitle": "Don't forget to like and subscribe", "show_social": True, "social_handles": { "twitter": "@yourhandle", "youtube": "YourChannel" } } } ) # ======================================== # COMBINED OVERLAYS SCENE # ======================================== print("\n🎬 Creating Combined Overlays Scene") add_scene({ "type": "LowerThird", "config": { "name": "Multiple Overlays", "title": "Combining different overlay types", "variant": "modern", "position": "bottom_left" }, "content": { "type": "SubscribeButton", "config": { "text": "Subscribe", "position": "bottom_right", "show_bell": True, "animate": True }, "content": { "type": "TextOverlay", "config": { "text": "Overlays can be combined!", "position": "top_center", "font_size": 36, "background_opacity": 0.8 }, "content": { "type": "DemoBox", "config": { "label": "Base Content\n\nWith multiple overlays", "color": "accent" } } } } }, duration=150) # ======================================== # FINAL TITLE # ======================================== print("\n🎬 Creating Final Title") add_scene({ "type": "EndScreen", "config": { "title": "Professional Overlays", "subtitle": "6 Components β€’ Infinite Combinations", "show_social": False } }) # ======================================== # Build the composition # ======================================== print("\n🎬 Building composition...") result = project_manager.build_composition_from_scenes(scenes, theme=theme) print("\n" + "="*70) print("βœ… OVERLAYS SHOWCASE GENERATED!") print("="*70) print(f"\nπŸ“ Project location: {project_path}") # Calculate stats total_frames = result['total_frames'] total_duration = total_frames / 30.0 print(f"\n⏱️ Total duration: {total_duration:.1f} seconds ({total_frames} frames @ 30fps)") print(f"\nπŸ“Š Showcase structure:") print(f" β€’ Introduction: 1 scene") print(f" β€’ Individual Overlays: 8 overlays Γ— 2 scenes = 16 scenes") print(f" β€’ Combined Overlays: 1 scene") print(f" β€’ Final End Screen: 1 scene") print(f" β€’ TOTAL: {len(scenes)} scenes") print(f"\n🎨 Overlay Components Showcased:") print(" βœ“ TitleScene (Bold, Glass, Minimal variants)") print(" βœ“ TextOverlay - Floating text positioning") print(" βœ“ LowerThird - Name tags (left & right)") print(" βœ“ SubscribeButton - Animated CTA") print(" βœ“ EndScreen - Video outro") print(f"\nπŸ“¦ Generated {len(result['component_types'])} component types:") for comp_type in sorted(result['component_types']): print(f" β€’ {comp_type}") print(f"\n✨ Generated {len(result['component_files'])} TSX files") print("\nπŸ“ Next steps:") print(f" cd {project_path}") print(" npm install") print(" npm start") print("\nπŸ’‘ This showcase demonstrates:") print(" βœ“ All 6 professional overlay components") print(" βœ“ Multiple variants and styles") print(" βœ“ Different positioning options") print(" βœ“ Overlay combinations and layering") print(" βœ“ Animation effects") print("\n" + "="*70) return project_path def main(): """Main entry point.""" print("\n🎬 Overlays Showcase Generator") print(" Professional demonstration of all overlay components\n") try: project_path = generate_overlays_showcase() print("✨ Generation complete!") return 0 except Exception as e: print(f"\n❌ Error: {e}") import traceback traceback.print_exc() return 1 if __name__ == "__main__": sys.exit(main())

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chrishayuk/chuk-mcp-remotion'

If you have feedback or need assistance with the MCP directory API, please join our Discord server