Skip to the content.

Usage Guide

This guide explains how to use the Video Sub Agent for video processing, subtitle extraction, and metadata management.

Command Line Interface (CLI)

The CLI provides several commands for video processing and management:

Process a Single Video

python -m app.cli process /path/to/video.mp4

Options:

Batch Process Multiple Videos

python -m app.cli batch /path/to/video/directory

Options:

Recognize Movie Name

python -m app.cli recognize /path/to/video.mp4

This command uses AI to recognize the movie name from the video file and its content.

List Processed Videos

python -m app.cli list

Options:

Initialize Database

python -m app.cli init

Creates necessary database tables and directories.

Web API

The system provides a RESTful API for integration with other applications.

Start the API Server

python -m uvicorn app.main:app --host 0.0.0.0 --port 8000

API Endpoints

Full API documentation is available at http://localhost:8000/docs when the server is running.

Web Interface

A web interface is available for easy management of videos and subtitles.

Access the Interface

  1. Start the API server as described above
  2. Open http://localhost:8000 in your browser

Features

Working with Subtitles

Subtitle Features

The system extracts subtitles in multiple formats:

Multi-language Subtitle Support

The system now supports downloading subtitles in multiple languages:

Subtitle Location

Extracted subtitles are stored in:

output/subtitles/
  - movie_name_en.srt  (English subtitles)
  - movie_name_ko.srt  (Korean subtitles)
  - movie_name_zh.srt  (Chinese subtitles)
  - etc.

Subtitle Processing

Metadata Management

Available Metadata

Metadata Sources

  1. Video filename analysis
  2. AI-powered content recognition
  3. TMDB and OMDB APIs
  4. Manual user input

Updating Metadata

# Using CLI
python -m app.cli update <video_id> --title "New Title" --year 2024

# Using API
curl -X PATCH http://localhost:8000/api/videos/{video_id} \
  -H "Content-Type: application/json" \
  -d '{"title": "New Title", "year": 2024}'

Best Practices

  1. Organize Your Videos

    • Use consistent naming conventions
    • Keep videos in dedicated directories
    • Maintain original file names
  2. Resource Management

    • Monitor disk space for extracted subtitles
    • Use appropriate batch sizes for large collections
    • Clean up temporary files regularly
  3. Error Handling

    • Check logs for processing errors
    • Retry failed extractions with --force
    • Keep API keys and credentials up to date
  4. Performance Optimization

    • Adjust worker count based on CPU cores
    • Process videos during off-peak hours
    • Use SSD storage for database and temp files

Troubleshooting

Common Issues

  1. Subtitle Extraction Fails

    • Verify video file is not corrupted
    • Check if video has extractable subtitles
    • Try different extraction methods
  2. Movie Recognition Issues

    • Ensure video filename is descriptive
    • Check API key validity
    • Try manual metadata input
  3. Performance Problems

    • Reduce batch size
    • Check system resources
    • Clear temporary files

Getting Help

Back to Home