๐ฌ Smart Video Player โ FastAPI backend + Streamlit UI + HTML5 player
Project description
๐ฌ SmartVideo โ FastAPI + Streamlit Video Toolkit
๐ง Overview
SmartVideo is a portable, all-in-one video processing toolkit built with FastAPI and Streamlit.
It provides both a web API and an interactive UI for uploading, previewing, trimming, and analyzing videos โ
all powered by an embedded FFmpeg engine included with the package.
โ Key features
- ๐ฅ Upload and preview videos instantly
- โ๏ธ Extract video clips using precise start/duration
- ๐ผ๏ธ Generate thumbnails every N seconds
- ๐ Extract audio (MP3/WAV)
- โ๏ธ FastAPI backend + Streamlit frontend
- ๐พ Built-in portable
ffmpegandffprobebinaries (no system install needed)
๐ Quick Start
1๏ธโฃ Installation
pip install smartvideo
(Or locally if you're developing)
uv pip install -e .
2๏ธโฃ Run the FastAPI backend
uv run svapi
By default it starts at:
โก๏ธ http://127.0.0.1:8000
3๏ธโฃ Run the Streamlit UI
uv run svui
Then open:
โก๏ธ http://localhost:8501
๐งฉ Project Structure
smartvideo/
โโโ bin/
โ โโโ ffmpeg.exe
โ โโโ ffprobe.exe
โโโ sv/
โ โโโ api.py โ FastAPI backend
โ โโโ cli.py โ CLI entry points
โ โโโ core/
โ โโโ config.py
โ โโโ services/
โ โโโ process.py
โโโ ui/
โโโ app.py โ Streamlit interface
โโโ components/
โโโ html5_player.py
โ๏ธ Environment Configuration
SmartVideo automatically bundles ffmpeg and ffprobe,
but you can override them via environment variables:
set SMARTVIDEO_FFMPEG=C:\Tools\ffmpeg.exe
set SMARTVIDEO_FFPROBE=C:\Tools\ffprobe.exe
or in Linux/macOS:
export SMARTVIDEO_FFMPEG=/usr/local/bin/ffmpeg
export SMARTVIDEO_FFPROBE=/usr/local/bin/ffprobe
๐งช API Endpoints (summary)
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/upload |
POST | Upload video |
/extract |
POST | Extract a video clip |
/thumbnails |
POST | Generate thumbnails every N seconds |
/audio |
POST | Extract audio (mp3/wav) |
/uploads/{filename} |
GET | Stream uploaded file |
/outputs/{filename} |
GET | Stream processed file |
๐ก Developer Notes
๐งฉ Local Development
# 1๏ธโฃ Sync dependencies
uv sync
# 2๏ธโฃ Run the FastAPI backend
uv run svapi
# 3๏ธโฃ Run the Streamlit UI
uv run svui
โจ After launch:
UI โ http://localhost:8501
API โ http://127.0.0.1:8000
Testing
uv run pytest -v
๐ฆ Packaging & Publishing
Build a wheel:
uv build
Publish to PyPI:
uv publish
๐งฐ Tech Stack
| Layer | Technology |
|---|---|
| Backend | ๐ FastAPI, Uvicorn |
| Frontend | ๐จ Streamlit |
| Media Processing | ๐๏ธ FFmpeg, MoviePy, OpenCV |
| Packaging | ๐งฑ Setuptools + uv |
| Testing | ๐งช Pytest, Httpx |
| Linting | โจ Ruff |
๐งโ๐ป Author
Tamer Hamad Faour
๐ซ GitHub โข PyPI
๐ License
Released under the MIT License โ free for personal and commercial use.
See LICENSE for details.
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.3.tar.gz.
File metadata
- Download URL: smartvideo-0.1.3.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f32a34a7e5260c17a275d22f389b9d31d6bc55814af121ff9fbeee78d99cd2f0
|
|
| MD5 |
506515b559ef98e096b92d5949c132d6
|
|
| BLAKE2b-256 |
f20c44eaa2e8677e9172884bfa6135c7b4c428403357fccb1c10200fe68dd2a7
|
File details
Details for the file smartvideo-0.1.3-py3-none-any.whl.
File metadata
- Download URL: smartvideo-0.1.3-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a101d58d15f0968d865d67fdbf6037d4249360605a992d5365ace9702ff22830
|
|
| MD5 |
e18696fe8a7cc9f9286085173608985f
|
|
| BLAKE2b-256 |
6edf4daa53ad8706f71c7406917795dc24f8050049efb5f51b237ef6dbc628a3
|