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.1.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.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file smartvideo-0.1.1.tar.gz.

File metadata

  • Download URL: smartvideo-0.1.1.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for smartvideo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bdd45569bfd3cbe9fc4ca745f9165602161d5e963f9c683d9f4c4faa7a07f0a8
MD5 dbde950fe0665bc62ba0d13ace2ccef0
BLAKE2b-256 65f1d96f117bc27d698be00ad0fbb4fa153327141962dc021785a4ab607b4d9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for smartvideo-0.1.1.tar.gz:

Publisher: publish.yml on TamerOnLine/smartvideo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smartvideo-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: smartvideo-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for smartvideo-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca2b8a4183a60ed868f5118eca02afcec8cf8fbddedf25259121e19bdb970c25
MD5 bb7fac16e8d07534386b8fa7950e1b86
BLAKE2b-256 512e49695150571537cf2d7203e21a56bba37cd994718ebb1e04adccfc27b929

See more details on using hashes here.

Provenance

The following attestation bundles were made for smartvideo-0.1.1-py3-none-any.whl:

Publisher: publish.yml on TamerOnLine/smartvideo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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