Skip to main content

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

Project description

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

PyPI version License: MIT Python CI Publish

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

smartvideo-0.1.7.tar.gz (16.2 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.7-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

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

Hashes for smartvideo-0.1.7.tar.gz
Algorithm Hash digest
SHA256 22d627d4a297b8cdf03ca089ee11033e71557a8b3d74e02444f6513b8fd7f143
MD5 c6835c74632bc24f7484a5d2dbc90fda
BLAKE2b-256 bc3be7ec4f2b843712512389bb1a33d647199dfd6fdf336a33d96cc9ab75287c

See more details on using hashes here.

Provenance

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

Hashes for smartvideo-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 36021a7f9d4dd83ca26bf3692a340a681a17466c35bf2c34f7d746ac4d06faa2
MD5 e2f2d862658e2c220e02511e27a432fd
BLAKE2b-256 d26daa11ddf64b3cb6f2ccbe17e895b22feb6e93e15f5a04d4fa818062fdb4fe

See more details on using hashes here.

Provenance

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