๐ฌ Smart Video Player โ FastAPI backend + Streamlit UI + HTML5 player
Project description
๐ฌ 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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smartvideo-0.1.7.tar.gz.
File metadata
- Download URL: smartvideo-0.1.7.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22d627d4a297b8cdf03ca089ee11033e71557a8b3d74e02444f6513b8fd7f143
|
|
| MD5 |
c6835c74632bc24f7484a5d2dbc90fda
|
|
| BLAKE2b-256 |
bc3be7ec4f2b843712512389bb1a33d647199dfd6fdf336a33d96cc9ab75287c
|
Provenance
The following attestation bundles were made for smartvideo-0.1.7.tar.gz:
Publisher:
publish.yml on TamerOnLine/smartvideo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
smartvideo-0.1.7.tar.gz -
Subject digest:
22d627d4a297b8cdf03ca089ee11033e71557a8b3d74e02444f6513b8fd7f143 - Sigstore transparency entry: 660058805
- Sigstore integration time:
-
Permalink:
TamerOnLine/smartvideo@f2b40223a1e3ea6f59a27fc902412a474fb84310 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/TamerOnLine
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f2b40223a1e3ea6f59a27fc902412a474fb84310 -
Trigger Event:
push
-
Statement type:
File details
Details for the file smartvideo-0.1.7-py3-none-any.whl.
File metadata
- Download URL: smartvideo-0.1.7-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36021a7f9d4dd83ca26bf3692a340a681a17466c35bf2c34f7d746ac4d06faa2
|
|
| MD5 |
e2f2d862658e2c220e02511e27a432fd
|
|
| BLAKE2b-256 |
d26daa11ddf64b3cb6f2ccbe17e895b22feb6e93e15f5a04d4fa818062fdb4fe
|
Provenance
The following attestation bundles were made for smartvideo-0.1.7-py3-none-any.whl:
Publisher:
publish.yml on TamerOnLine/smartvideo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
smartvideo-0.1.7-py3-none-any.whl -
Subject digest:
36021a7f9d4dd83ca26bf3692a340a681a17466c35bf2c34f7d746ac4d06faa2 - Sigstore transparency entry: 660058810
- Sigstore integration time:
-
Permalink:
TamerOnLine/smartvideo@f2b40223a1e3ea6f59a27fc902412a474fb84310 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/TamerOnLine
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f2b40223a1e3ea6f59a27fc902412a474fb84310 -
Trigger Event:
push
-
Statement type: