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.0.tar.gz (11.5 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.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: smartvideo-0.1.0.tar.gz
  • Upload date:
  • Size: 11.5 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.0.tar.gz
Algorithm Hash digest
SHA256 aab1023b2a495e8739cbe8b3a391dce98260bbb3591586428b39dedd5d881660
MD5 6c02baf9036d449bdd54f20f6bb35c1b
BLAKE2b-256 84d9fbea84640e90d3a5b2fa83c8c7be43eb3f1cfdfee2b3f990dccd423d840a

See more details on using hashes here.

Provenance

The following attestation bundles were made for smartvideo-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: smartvideo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd4b05a2e61a8ae970dadc5aeb0f3b6b9003a6d5f56fcf1036aaae6a2af70c6f
MD5 fac0a7e13e0325feaef2ad63ce9d6c3d
BLAKE2b-256 c2200510b9269a5e56b5b14e3f5498941d4ece4c7d5177c39aba3bba39448113

See more details on using hashes here.

Provenance

The following attestation bundles were made for smartvideo-0.1.0-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