What are Segments?

Segments are intelligently divided portions of a video that break down longer content into meaningful, manageable parts. Unlike simple time-based cuts, Cloudglue uses advanced computer vision and AI analysis to identify natural boundaries in your video content. This makes it easier to navigate, analyze, and work with video content by automatically finding the most logical break points. Segments serve as the foundation for many Cloudglue features, enabling you to work with specific parts of videos rather than entire files. Whether you’re looking to create highlights, analyze specific scenes, or build interactive video experiences, segments provide the precise time boundaries you need.

Types of Segment Creation

Cloudglue offers two distinct approaches to creating video segments, each optimized for different types of content and use cases:

Shot-Based Segments

Shot-based segments use computer vision to detect visual changes and scene transitions in your video. This approach identifies when the camera angle changes, when scenes cut to different locations, or when significant visual elements enter or leave the frame. Best for:
  • Dynamic Content: Videos with camera movement, action sequences, or multiple scenes
  • Visual Analysis: Content where visual transitions are the primary organizing principle
  • Production Footage: Videos with clear shot boundaries and scene changes
Configuration Options:
  • Detector Types:
    • adaptive: Designed for dynamic footage with camera movement and action (default)
    • content: Optimized for controlled footage with clear visual transitions
  • Duration Limits: Set minimum (1 second) and maximum (1 hour) segment durations
  • Default Settings: 1 second minimum, 5 minutes maximum duration

Narrative-Based Segments

Narrative-based segments use AI analysis to identify logical story segments and chapters within your video content. This approach understands the flow of information, topic changes, and narrative structure to create segments that make sense from a content perspective. Best for:
  • Educational Content: Lectures, tutorials, and training videos
  • Documentaries: Long-form content with distinct topics or chapters
  • Presentations: Videos with clear topic transitions and logical flow
  • Storytelling: Content where narrative structure is more important than visual changes
Configuration Options:
  • Custom Prompts: Provide additional guidance to influence how the AI identifies logical boundaries
  • Content-Aware: Automatically adapts to different types of narrative content

Practical Applications

Content Management

  • Video Libraries: Automatically organize long-form content into manageable chapters
  • Content Discovery: Enable users to jump to specific topics or scenes
  • Archive Management: Break down lengthy recordings into searchable segments

Media Production

  • Editing Workflows: Identify natural cut points for video editing
  • Highlight Reels: Extract key moments from longer content
  • Content Repurposing: Create shorter clips from longer videos

Educational Platforms

  • Course Navigation: Break lectures into logical learning modules
  • Topic Indexing: Enable students to find specific subjects quickly
  • Progress Tracking: Allow learners to resume from specific segments

Analytics and Insights

  • Engagement Analysis: Track which segments receive the most attention
  • Content Performance: Understand which parts of videos are most valuable
  • User Behavior: Analyze how viewers navigate through segmented content

Getting Started

Basic Shot-Based Segments

curl --request POST \
  --url https://api.cloudglue.dev/v1/segments \
  --header 'Authorization: Bearer cg-YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "url": "https://example.com/video.mp4",
    "criteria": "shot"
  }'

Advanced Shot Configuration

curl --request POST \
  --url https://api.cloudglue.dev/v1/segments \
  --header 'Authorization: Bearer cg-YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "url": "https://example.com/video.mp4",
    "criteria": "shot",
    "shot_config": {
      "detector": "content",
      "min_duration_seconds": 2,
      "max_duration_seconds": 180
    }
  }'

Narrative-Based Segments with Custom Prompt

curl --request POST \
  --url https://api.cloudglue.dev/v1/segments \
  --header 'Authorization: Bearer cg-YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "url": "https://example.com/lecture.mp4",
    "criteria": "narrative",
    "narrative_config": {
      "prompt": "Focus on topic changes and key concept transitions in this educational content"
    }
  }'

Best Practices

Choosing the Right Criteria

  • Use Shot-Based for: Action videos, multi-scene content, visual-heavy material
  • Use Narrative-Based for: Educational content, presentations, story-driven videos
  • Consider Content Type: Match your segment creation approach to your content’s primary organizing principle

Next Steps

To learn more about implementing segments in your applications:
  1. Explore the API: Check out the Segments API documentation
  2. Try Both Approaches: Experiment with both shot-based and narrative-based segment creation
  3. Integrate with Other Features: Combine segments with transcription, extraction, or search capabilities
  4. Build Applications: Use segment data to create interactive video experiences
Segments provide the foundation for working with video content at a granular level, enabling you to build sophisticated applications that understand and interact with video content intelligently.