Video-converter / README.md
salman555's picture
Update README.md
d555a12 verified
metadata
license: other
license_name: salman-alfarisi-proprietary-license-v1.0
license_link: LICENSE

๐ŸŽฌ Free Video Converter (Gradio + FFmpeg)

A lightweight Gradio web app to convert video โ‡„ video and video/audio โ‡„ audio locally using FFmpeg. Upload a file, pick a target format, watch the progress pop-up, then download the resultโ€”fast and simple.


๐Ÿ“‘ Table of Contents

  1. Features
  2. Project Structure
  3. Prerequisites
  4. Installation
  5. Running Locally
  6. Usage
  7. Settings (CRF & Preset)
  8. Deploy to Hugging Face
  9. Troubleshooting
  10. Contributing
  11. License
  12. Author & Credits

โœจ Features

  • Many Formats, One Click

    • Video targets: mp4, avi, flv, mov, wmv, mkv, webm
    • Audio targets: mp3, wav, flac, ogg, m4a, aac, wma
  • Smart Targeting Input format is automatically hidden from the target list; defaults to mp4 (video) or mp3 (audio).

  • Language Switcher (๐Ÿ‡ฎ๐Ÿ‡ฉ / ๐Ÿ‡บ๐Ÿ‡ธ) Toggle Indonesian/English texts on the fly.

  • Progress Pop-up & UI Lock A โ€œConvertingโ€ฆ please wait.โ€ modal appears, and all controls are disabled until the job is done.

  • One-click Download A green Download result button appears once conversion finishes.

  • CPU-friendly Optimized defaults for 2 vCPU (e.g., Hugging Face Spaces), with Gradio queue limits pre-tuned.

  • Local / Offline Runs entirely on your machine/Space; no third-party upload.

Demo Screenshot


๐Ÿ“ Project Structure

videoconverter/
โ”œโ”€โ”€ videoconverter.py         # Gradio app (ID/EN, progress modal, downloader)
โ”œโ”€โ”€ requirements.txt          # Python deps (e.g., gradio)
โ”œโ”€โ”€ apt.txt                   # System deps for Spaces (ffmpeg)
โ”œโ”€โ”€ LICENSE                   # "All Rights Reserved"
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ .gitignore

Note: The app expects ffmpeg to be available on the system (also installs via apt.txt on Spaces).


โš™๏ธ Prerequisites

  • Python 3.10+
  • FFmpeg (includes ffmpeg and ffprobe)
  • git & a terminal

Install FFmpeg locally:

Ubuntu/Debian

sudo apt update && sudo apt install -y ffmpeg

macOS (Homebrew)

brew install ffmpeg

Windows (winget)

winget install Gyan.FFmpeg

๐Ÿ”ง Installation

  1. Clone this repository:
git clone https://github.com/salmanalfarisi11/video-converter.git
cd video-converter
  1. Create and activate a virtual environment:
python -m venv .venv
# Linux/macOS
source .venv/bin/activate
# Windows
.venv\Scripts\activate
  1. Install Python dependencies:
pip install -r requirements.txt

๐Ÿš€ Running Locally

Start the app:

python videoconverter.py

๐ŸŽฏ Usage

  1. Upload a video or audio file.
  2. Choose a target format (to video / to audio).
  3. (Optional) Set CRF and Ultra fast preset.
  4. Click Convert. A modal โ€œConvertingโ€ฆโ€ appears and the UI is locked.
  5. When done, click the Download result button to save your file.

โš™๏ธ Settings (CRF & Preset)

  • CRF H.264 (lower = better quality)

    • Applies to H.264 outputs (e.g., mp4, mov).
    • Typical range: 18โ€“28.
    • Lower CRF โ†’ higher quality & bigger file, conversion a bit slower.
    • Higher CRF โ†’ smaller file, conversion faster.
  • Ultra fast preset (ultrafast)

    • Uses -preset ultrafast for libx264 to speed up CPU encoding at the cost of larger files.
    • Uncheck it if you prefer better compression (smaller size) with slower conversion.

โ˜๏ธ Deploy to Hugging Face

  1. Create a New Space โ†’ Gradio โ†’ (Public or Private).

  2. Upload these files:

    • videoconverter.py

    • requirements.txt (e.g., gradio==5.32.1)

    • apt.txt with:

      ffmpeg
      
    • README.md, LICENSE, .gitignore (optional but recommended)

  3. In README.md, you can add HF metadata front-matter (optional):

---
title: Free Video Converter
emoji: ๐ŸŽฌ
colorFrom: indigo
colorTo: purple
sdk: gradio
sdk_version: 5.32.1
app_file: videoconverter.py
license: other   # proprietary
pinned: false
---

The Space will build and run automatically.


๐Ÿ› ๏ธ Troubleshooting

  • โ€œFFmpeg not foundโ€ Ensure ffmpeg is installed and on your PATH (ffmpeg -version). On Spaces, keep ffmpeg inside apt.txt.

  • Conversion is slow

    • Enable Ultra fast preset.
    • Use a higher CRF for H.264.
    • Prefer mp4/mp3 which are typically faster on CPU.
  • Out of storage (Spaces with small disks)

    • Delete large outputs frequently.
    • Reduce file sizes using higher CRF or lower bitrates.

๐Ÿค Contributing

Bug reports, suggestions, or PRs are welcome (even though the code is proprietary, you can propose changes via issues/patches if the repo is public).


๐Ÿ“„ License

All Rights Reserved โ€” see LICENSE. You may not copy, modify, redistribute, or use this software without explicit permission from the copyright holder.


๐Ÿ–‹๏ธ Author & Credits

Developed by Salman Alfarisi ยฉ 2025

Built with โค๏ธ using Gradio and FFmpeg. If this project helps you, please โญ the repo!