Skip to main content

๐ŸŽฌ Smart Video Player โ€” FastAPI backend + Streamlit UI + HTML5 player

Project description

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

Python FastAPI Streamlit License


๐Ÿง  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 ffmpeg and ffprobe binaries (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

smartvideo-0.1.3.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smartvideo-0.1.3-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

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

Hashes for smartvideo-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f32a34a7e5260c17a275d22f389b9d31d6bc55814af121ff9fbeee78d99cd2f0
MD5 506515b559ef98e096b92d5949c132d6
BLAKE2b-256 f20c44eaa2e8677e9172884bfa6135c7b4c428403357fccb1c10200fe68dd2a7

See more details on using hashes here.

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

Hashes for smartvideo-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a101d58d15f0968d865d67fdbf6037d4249360605a992d5365ace9702ff22830
MD5 e18696fe8a7cc9f9286085173608985f
BLAKE2b-256 6edf4daa53ad8706f71c7406917795dc24f8050049efb5f51b237ef6dbc628a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page