๐ฌ SmartVideo โ FastAPI + Streamlit Video Toolkit
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)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| smartvideo-0.1.7.tar.gz | 16.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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 logSecurity 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.
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 logA 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.