Skip to main content

aivid

AI video toolkit - detect, analyze, and work with AI-generated videos

PyPI version Python versions License: MIT CI

Features

  • AI Detection: Detect AI-generated videos through C2PA metadata and heuristic analysis
  • C2PA Signing: Add C2PA manifests to media files (requires c2patool)
  • Metadata Extraction: Extract comprehensive metadata from video files
  • Multi-tool Support: Leverages ffprobe, mediainfo, exiftool, and c2patool for thorough analysis
  • MP4 Box Analysis: Binary parsing of MP4/MOV container structure
  • Software Detection: Identify editing software (FFmpeg, Adobe, DaVinci, OBS, etc.)
  • Multiple Output Modes: Default summary, full details, C2PA focus, or quiet mode
  • JSON Export: Export reports for automation and integration
  • Batch Processing: Analyze multiple files with single command

Supported AI Generators

Generator Detection Method Confidence
OpenAI Sora C2PA manifest + 96kHz audio signature High
OpenAI DALL-E C2PA manifest High
Google Gemini/Veo Encoder tag + C2PA manifest High
Adobe Firefly C2PA manifest High
Midjourney C2PA manifest High
Stability AI C2PA manifest High
Runway C2PA manifest Medium
Pika Labs C2PA manifest Medium
Kling AI C2PA manifest Medium
Luma AI Handler name + C2PA manifest Medium

Requirements

System Dependencies

aivid requires these command-line tools to be installed:

  • ffprobe (required) - Part of FFmpeg
  • mediainfo (optional, recommended)
  • exiftool (optional, recommended)
  • c2patool (optional) - For accurate C2PA manifest parsing and signing

macOS

brew install ffmpeg mediainfo exiftool

Ubuntu/Debian

sudo apt-get install ffmpeg mediainfo exiftool

Windows

# Using Chocolatey
choco install ffmpeg mediainfo exiftool

# Or using Scoop
scoop install ffmpeg mediainfo exiftool

Install c2patool (optional)

c2patool provides more accurate C2PA manifest parsing and signing capabilities.

# Using Cargo (Rust package manager)
cargo install c2patool

# Or download prebuilt binaries from:
# https://github.com/contentauth/c2pa-rs/releases

Python Installation

pip install aivid

Or with uv:

uv pip install aivid

Quick Start

Command Line

# Basic analysis
aivid video.mp4

# AI detection focus (C2PA mode)
aivid --c2pa video.mp4

# Full metadata details
aivid --full video.mp4

# Quick summary for multiple files
aivid -q *.mp4

# Export to JSON
aivid -o report.json video.mp4

# Sign a file with C2PA manifest (requires c2patool)
aivid --sign manifest.json -o signed_video.mp4 video.mp4

Python API

from aivid import analyze_file, check_c2patool_available, sign_with_c2pa, VideoMetadata

# Analyze a video file
metadata = analyze_file("video.mp4")

# Check if AI-generated
if metadata.is_ai_generated:
    print(f"AI Generator: {metadata.ai_generator}")

# Access metadata (pydantic models)
print(f"Duration: {metadata.duration}s")
print(f"Resolution: {metadata.resolution}")
print(f"Video codec: {metadata.technical.video.codec}")
print(f"Audio sample rate: {metadata.technical.audio.sample_rate}")

# C2PA information
if metadata.has_c2pa:
    print(f"C2PA Issuer: {metadata.provenance.c2pa.issuer}")
    print(f"C2PA Generator: {metadata.provenance.c2pa.generator}")

# Export as JSON
print(metadata.model_dump_json(indent=2))

# Sign a file with C2PA manifest (requires c2patool)
if check_c2patool_available():
    sign_with_c2pa(
        input_path="video.mp4",
        manifest_path="manifest.json",
        output_path="signed_video.mp4",
    )

Output Modes

Default Mode

Basic metadata with file info, container details, encoding info, and C2PA summary.

aivid video.mp4

C2PA Mode (--c2pa)

Focused on AI content detection with indicators and confidence levels.

aivid --c2pa video.mp4

Output includes:

  • C2PA manifest detection
  • AI generation indicators (audio sample rate, encoder tags, etc.)
  • Detection summary with confidence levels

Note: When c2patool is installed, aivid uses it for more accurate C2PA parsing.

Full Mode (--full)

Complete metadata dump including mediainfo, exiftool, all streams, and raw data.

aivid --full video.mp4

Quiet Mode (-q)

One-line summary per file, ideal for batch processing.

aivid -q *.mp4

Sign Mode (--sign)

Add a C2PA manifest to a media file (requires c2patool).

# Create a manifest file
cat > manifest.json << 'EOF'
{
  "claim_generator": "aivid",
  "title": "My Video",
  "assertions": [
    {
      "label": "c2pa.actions",
      "data": {
        "actions": [{"action": "c2pa.edited"}]
      }
    }
  ]
}
EOF

# Sign the video
aivid --sign manifest.json -o signed_video.mp4 video.mp4

# Verify the signature
aivid --c2pa signed_video.mp4

Development

Setup

# Clone the repository
git clone https://github.com/SocialNetwork0/aivid.git
cd aivid

# Create virtual environment and install dependencies
uv venv
uv pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

Local CLI Testing

# Activate virtual environment
source .venv/bin/activate  # macOS / Linux

# Install in editable mode (code changes reflect immediately)
uv pip install -e ".[dev]"

# Test CLI
aivid --help
aivid video.mp4

Running Tests

uv run pytest

Code Quality

# Linting
uv run ruff check .

# Formatting
uv run ruff format .

# Type checking
uv run mypy src

Supported File Formats

Native MP4/MOV parsing: .mp4, .m4v, .m4a, .mov, .3gp, .3g2

Other formats: Any format supported by ffprobe

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

MIT License - see LICENSE for details.

Acknowledgments

  • C2PA - Coalition for Content Provenance and Authenticity
  • c2patool - C2PA command line tool
  • FFmpeg - Multimedia framework
  • MediaInfo - Media file analysis
  • ExifTool - Metadata extraction

Metadata

Release files for aivid 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aivid 0.3.0
File Size Uploaded Provenance Actions
aivid-0.3.0.tar.gz 57.3 MB With provenance Details for aivid-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aivid 0.3.0
File Interpreter ABI Platform Actions
aivid-0.3.0-py3-none-any.whl Python 3 none any Details for aivid-0.3.0-py3-none-any.whl

Total release size: 57.4 MB

Release files / aivid-0.3.0.tar.gz

Download URL aivid-0.3.0.tar.gz
Size 57.3 MB
Tags Source
SHA-256 checksum
How to use checksums
431589641a663a8236baa0eec572e10dfe0de3b260b1911098fd7a1b829c5eaf
BLAKE2b-256 checksum
How to use checksums
522d7708ce5c28d7a642ad7cf4b4ce20d3b70a41a46db050ef3004eb48c4412d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 15, 2026.

Transparency log

Release files / aivid-0.3.0-py3-none-any.whl

Download URL aivid-0.3.0-py3-none-any.whl
Size 72.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8b3c66d591c31fe2e4785dd62c256e0e1673a9a1dcc9db1d1d1cc5b9ac75cbe
BLAKE2b-256 checksum
How to use checksums
621fc94b7cd1fe037ac4ab6c20626f1a0bf13f663354ecef46c9c5e9ca9e0624
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 15, 2026.

Transparency log

Security for aivid 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aivid-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page