Skip to main content

๐ŸŽฌ SmartVideo โ€” FastAPI + Streamlit Video Toolkit

PyPI version License: MIT Python CI Publish

SmartVideo โ€” A modern, cross-platform video player and clip extractor built with FastAPI, Streamlit, and FFmpeg.
Upload, preview, trim, and stream videos โ€” locally or via REST API.


๐Ÿš€ Features

  • โš™๏ธ Auto FFmpeg/FFprobe detection & download (Windows, macOS, Linux)
  • ๐ŸŒ FastAPI backend with REST endpoints:
    • /upload โ€” upload and probe duration
    • /extract โ€” extract a clip (start + duration)
    • /outputs/{file} โ€” serve generated clips
  • ๐Ÿ–ฅ๏ธ Streamlit UI:
    • Drag-and-drop upload
    • HTML5 video preview player
    • Clip extraction via form controls
  • ๐Ÿ’ก CLI tools:
    • svapi โ†’ run backend server (FastAPI)
    • svui โ†’ run Streamlit UI
  • ๐Ÿ” Cross-platform binaries โ€” automatically downloaded if missing
  • ๐Ÿงฑ Modular architecture (sv/core, sv/ui, sv/api)
  • ๐Ÿงช Ready-to-use GitHub Actions for CI/CD and PyPI publishing

๐Ÿงฉ Project Structure

smartvideo/
โ”œโ”€โ”€ src/smartvideo/
โ”‚   โ”œโ”€โ”€ sv/
โ”‚   โ”‚   โ”œโ”€โ”€ api.py         # FastAPI backend
โ”‚   โ”‚   โ”œโ”€โ”€ cli.py         # CLI launchers
โ”‚   โ”‚   โ””โ”€โ”€ core/
โ”‚   โ”‚       โ”œโ”€โ”€ config.py  # Data paths
โ”‚   โ”‚       โ””โ”€โ”€ services/process.py  # FFmpeg logic
โ”‚   โ””โ”€โ”€ ui/
โ”‚       โ”œโ”€โ”€ app.py         # Streamlit frontend
โ”‚       โ””โ”€โ”€ components/html5_player.py
โ”œโ”€โ”€ data/uploads/          # Uploaded videos
โ”œโ”€โ”€ data/outputs/          # Generated clips
โ”œโ”€โ”€ tools/                 # Dev tools & publishing scripts
โ”œโ”€โ”€ tests/                 # Basic tests
โ”œโ”€โ”€ pyproject.toml         # Build metadata
โ”œโ”€โ”€ CHANGELOG.md
โ””โ”€โ”€ LICENSE

โšก Quick Start

1๏ธโƒฃ Install

pip install smartvideo

Or for local development:

uv pip install -e .[dev]

2๏ธโƒฃ Run the API (FastAPI)

svapi --port 8000

Then open http://127.0.0.1:8000/docs


3๏ธโƒฃ Run the UI (Streamlit)

svui --port 8501

Then open http://localhost:8501

You can adjust upload size:

svui --max-upload-mb 4096

๐Ÿ”ง FFmpeg Setup

SmartVideo automatically downloads FFmpeg if missing.
But you can install it manually:

๐ŸชŸ Windows

winget install Gyan.FFmpeg
# or
choco install ffmpeg

๐ŸŽ macOS

brew install ffmpeg

๐Ÿง Linux

sudo apt install -y ffmpeg

Verify:

ffmpeg -version
ffprobe -version

๐Ÿง  API Endpoints

Method Endpoint Description
GET /health Check API status
POST /upload Upload video and get duration
POST /extract Extract video clip
GET /uploads/{filename} Serve uploaded video
GET /outputs/{filename} Serve generated clip
GET /uploads/stream/{filename} Stream with HTTP Range support

๐Ÿงช Development

git clone https://github.com/TamerOnLine/smartvideo
cd smartvideo
uv sync --extra dev
uv run svapi
uv run svui

Run tests:

uv run pytest

๐Ÿงฐ GitHub Workflows

Workflow Purpose
ci.yml Runs tests, builds package, uploads artifacts
publish.yml Trusted publishing to PyPI when tagging v*.*.*

๐Ÿ—“๏ธ Changelog

See CHANGELOG.md for release history.
Example from v0.1.6:

  • Added automatic FFmpeg download for Linux & macOS
  • Unified resolver and improved permission handling
  • Improved logging and cleanup routines

๐Ÿ“œ License

Licensed under the MIT License ยฉ 2025 TamerOnLine


๐ŸŒŸ Roadmap

  • ๐Ÿง  AI-powered video summarization & speech-to-text
  • ๐ŸŽž๏ธ Automatic scene detection & keyframe extraction
  • โ˜๏ธ Remote storage + REST streaming integration
  • ๐Ÿงฉ Web dashboard for managing clips and metadata

Metadata

Release files for smartvideo 0.1.7

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

Source distribution (sdist)

Source distribution for smartvideo 0.1.7
File Size Uploaded Provenance
smartvideo-0.1.7.tar.gz 16.2 kB With provenance Details

Built distribution (wheel)

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

Total release size: 32.5 kB

Release files / smartvideo-0.1.7.tar.gz

Download URL smartvideo-0.1.7.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
22d627d4a297b8cdf03ca089ee11033e71557a8b3d74e02444f6513b8fd7f143
BLAKE2b-256 checksum
How to use checksums
bc3be7ec4f2b843712512389bb1a33d647199dfd6fdf336a33d96cc9ab75287c
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 Nov 1, 2025.

Transparency log

Release files / smartvideo-0.1.7-py3-none-any.whl

Download URL smartvideo-0.1.7-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36021a7f9d4dd83ca26bf3692a340a681a17466c35bf2c34f7d746ac4d06faa2
BLAKE2b-256 checksum
How to use checksums
d26daa11ddf64b3cb6f2ccbe17e895b22feb6e93e15f5a04d4fa818062fdb4fe
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 Nov 1, 2025.

Transparency log

Security for smartvideo 0.1.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.

Full provenance

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

Select from 2 files

Attestation for smartvideo-0.1.7.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 Nov 1, 2025.

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.

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