Skip to content

[WIP]: Add comprehensive video upload support to video analysis tools#16

Open
malay44 wants to merge 3 commits into
RLabs-Inc:mainfrom
malay44:claude/add-video-upload-support-TVGLG
Open

[WIP]: Add comprehensive video upload support to video analysis tools#16
malay44 wants to merge 3 commits into
RLabs-Inc:mainfrom
malay44:claude/add-video-upload-support-TVGLG

Conversation

@malay44
Copy link
Copy Markdown

@malay44 malay44 commented Jan 28, 2026

Summary

This supports multiple video input methods beyond YouTube URLs, including local video file uploads and inline base64-encoded video data. This brings full parity with Gemini API's official video input capabilities.

Key Changes

  • Multiple Video Input Methods

    • YouTube URLs: Direct analysis of YouTube videos (existing functionality)
    • Local video files: Upload and analyse video files from disk with automatic file size handling
    • Inline video data: Process base64-encoded video content
    • All input types support consistent clipping (startTime/endTime) and media resolution control
  • Smart File Handling

    • Files <20MB: Uploaded as inline data for faster processing
    • Files ≥20MB: Automatically uploaded via Gemini Files API
    • Automatic MIME type detection from file extensions
  • Expanded Format Support

    • Added support for 11 video formats: MP4, MOV, AVI, MKV, WebM, FLV, WMV, M4V, MPG, MPEG, 3GP
    • Proper MIME type mapping for each format
  • Media Resolution Control

    • New mediaResolution parameter (low/medium/high) for all video input types
    • Allows users to balance processing speed vs. detail level

Created new video-upload.ts tool file to support local video file analysis and inline video data processing, keeping existing YouTube tools completely unchanged.

New tools added:
- gemini-analyze-video: Analyze local video files or inline video data
  - Supports videoPath parameter for local file paths
  - Supports videoData parameter for base64-encoded video content
  - Automatic file size handling (inline for <20MB, Files API for ≥20MB)
  - Video clipping support (startTime/endTime)
  - Media resolution control (low/medium/high)
  - Supported formats: MP4, MOV, AVI, MKV, WebM, FLV, WMV, M4V, MPG, MPEG, 3GP

- gemini-summarize-video: Quick summarization for local video files
  - Multiple summary styles: brief, detailed, bullet-points, chapters
  - Same input flexibility as analyze-video

Implementation details:
- Created src/tools/video-upload.ts as completely separate tool
- Registered new tools in server.ts without modifying existing code
- Follows same patterns as document.ts and image-analyze.ts
- YouTube analysis tools remain completely unchanged
- Minimal impact on existing codebase

Documentation:
- Updated CLAUDE.md to version 0.8.2
- Added Video Upload as tool RLabs-Inc#12 (renumbered remaining tools)
- Added comprehensive feature description
- Updated Key Changes section

https://claude.ai/code/session_01HEDNZqmLjK3QigJ8M4q6f3
@malay44 malay44 force-pushed the claude/add-video-upload-support-TVGLG branch from 86ed2e2 to 9df502f Compare January 28, 2026 18:08
@malay44 malay44 marked this pull request as ready for review January 28, 2026 18:29
@malay44 malay44 changed the title Add comprehensive video upload support to video analysis tools [WIP]: Add comprehensive video upload support to video analysis tools Jan 28, 2026
@malay44 malay44 marked this pull request as draft January 28, 2026 18:30
…ey validation

- Updated connection test to utilize models.get() instead of generateContent(), ensuring it does not consume generation quota.
- Removed user model preference fallback, simplifying the connection process.
- Improved logging to reflect the new connection method.

This change enhances the efficiency of the API key validation process.
@malay44 malay44 force-pushed the claude/add-video-upload-support-TVGLG branch from 92ac2b1 to a1c8e36 Compare January 29, 2026 15:05
@malay44 malay44 marked this pull request as ready for review January 29, 2026 15:21
@malay44
Copy link
Copy Markdown
Author

malay44 commented Feb 5, 2026

@acreeger can you review the changes?

@acreeger
Copy link
Copy Markdown
Contributor

acreeger commented Feb 5, 2026

@malay44 Can you take out the commit regarding the connection logic? Not saying it's incorrect, but it's a different issue - if the author of that commit wants to make a PR so @RodrigoLuglio can chime in, they should do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants