Skip to main content

Video Processing

The process-video command handles local video files, extracting frames and preparing them for analysis. It includes intelligent file size management and compression features.

Prerequisites

  • FFmpeg installed on your system (required for video processing)
  • Sufficient disk space for temporary files
  • Supported video format (mp4, avi, mov, etc.)

Usage

transfer-learning process-video <video_path> [options]

File Size Management

The tool automatically handles large video files:
  1. Size Check: Verifies if the video size exceeds configured limits
  2. Compression: If needed, compresses the video while preserving quality
    • Uses FFmpeg with H.264 codec
    • Intelligent bitrate calculation
    • Progress tracking during compression
    • Quality preservation algorithms
  3. Temporary Files: Manages compressed versions in system temp directory
  4. Cleanup: Automatically removes temporary files after processing

Options

OptionDescriptionDefault
--output-dirDirectory to save processed files./output
--batch-sizeNumber of frames to process at once30
--max-sizeMaximum video size in MB500
--frame-intervalFrames to skip between extractions30

Examples

Basic usage:
transfer-learning process-video path/to/video.mp4
With custom options:
transfer-learning process-video path/to/video.mp4 \
  --output-dir ./my_output \
  --batch-size 50 \
  --max-size 1000 \
  --frame-interval 60

Output Format

The command creates the following directory structure:
output/
├── frames/          # Extracted video frames
├── metadata.json    # Video metadata including compression info
└── processing_log.txt   # Detailed processing log

Metadata Format

{
  "video_info": {
    "original_size": "1200MB",
    "compressed_size": "480MB",
    "compression_ratio": 2.5,
    "codec_used": "libx264",
    "duration": "10:30",
    "resolution": "1920x1080",
    "fps": 30
  },
  "processing": {
    "frames_extracted": 150,
    "frame_interval": 30,
    "compression_applied": true,
    "processing_time": "5:30"
  }
}

Error Handling

The command includes robust error handling:
  • Validates video format before processing
  • Checks FFmpeg availability
  • Monitors compression progress
  • Provides detailed error messages
  • Implements fallback options for compression

Best Practices

  1. Ensure sufficient disk space (2-3x video size)
  2. Use recommended video formats (MP4 with H.264)
  3. Monitor the processing log for details
  4. Keep FFmpeg updated for best performance

Next Steps

After processing a video, you can:
  1. Generate a guide from the processed data
  2. Transcribe the audio from the video
  3. Analyze the content in more detail