Skip to content

Latest commit

 

History

History
175 lines (120 loc) · 4.15 KB

File metadata and controls

175 lines (120 loc) · 4.15 KB

Audio/Video Reverser Web Application

This project is a web application that allows users to upload audio or video files and reverses the audio track for playback. It supports a wide range of file formats that FFmpeg can handle, includes secure file handling, and can be deployed using Flask's built-in server.

Features

  • Multiple File Formats: Supports any audio or video file format that FFmpeg can process.
  • Synchronous Processing: Handles file reversal tasks synchronously.
  • User Feedback: Provides immediate feedback on task progress after file upload.
  • Logging: Uses Python’s logging module for error tracking and debugging.
  • Security: Can be configured with a reverse proxy and SSL/TLS certificates for HTTPS.

Technology Stack

  • Backend: Python, Flask, FFmpeg (via pydub)
  • Web Server: Flask's built-in development server
  • Storage: Local file storage for uploads and reversed files
  • Session Management: Flask's built-in session management
  • Frontend: HTML, CSS, JavaScript with IndexedDB for local storage

Prerequisites

  1. Python 3.x
    Ensure Python is installed:

    python --version
  2. pip (Python package manager)
    Ensure pip is installed:

    pip --version
  3. FFmpeg (To process audio/video)

    • Linux (Debian/Ubuntu):

      sudo apt-get update
      sudo apt-get install ffmpeg
    • macOS (Homebrew):

      brew install ffmpeg
    • Windows: Download from the FFmpeg official site and add to PATH.

Installation Steps

1. Clone the Repository

  • Windows:

    • Open Command Prompt or PowerShell.

    • Run the following commands:

      git clone https://your-repo-url/audio-reverse-app.git
      cd audio-reverse-app
  • macOS/Linux:

    • Open Terminal.

    • Run the following commands:

      git clone https://your-repo-url/audio-reverse-app.git
      cd audio-reverse-app

2. Create a Python Virtual Environment (Recommended)

  • Windows:

    • In Command Prompt or PowerShell, run:

      python -m venv venv
      .\venv\Scripts\activate
  • macOS/Linux:

    • In Terminal, run:

      python3 -m venv venv
      source venv/bin/activate

3. Install Dependencies

  • All Platforms:
    • With the virtual environment activated, run:

      pip install -r requirements.txt
    • If requirements.txt is not available, manually install:

      pip install flask gunicorn ffmpeg-python werkzeug

4. Configure Environment Variables (if needed)

  • Windows:

    • In PowerShell, set the environment variable:

      $env:FLASK_APP = "app.py"
    • Optional: Set the environment to production:

      $env:FLASK_ENV = "production"
  • macOS/Linux:

    • In Terminal, set the environment variable:

      export FLASK_APP=app.py
    • Optional: Set the environment to production:

      export FLASK_ENV=production

5. Run the Application

  • All Platforms:
    • With the virtual environment activated, start the Flask server:

      flask run --host=0.0.0.0 --port=8000

6. Access the Application

  • Open a web browser and navigate to http://127.0.0.1:8000 to access the application.

Usage

  1. Navigate to http://127.0.0.1:8000.
  2. Upload an audio or video file.
  3. The UI will display the upload and processing status.
  4. Once processing is complete, listen to or download the reversed file.

Logs & Monitoring

Logs are stored in logs/app.log. For advanced monitoring, consider integrating with external tools like Sentry or the ELK stack.

Troubleshooting

  • FFmpeg not found: Ensure FFmpeg is installed and added to your system's PATH.
  • Permissions: Ensure the application has the correct file permissions.
  • HTTPS issues: Validate your SSL certificates if using a reverse proxy.

Contributing

  1. Fork the repository.
  2. Create a new branch: git checkout -b new-feature.
  3. Make your changes, commit, and push.
  4. Open a pull request.

License

This project is licensed under the MIT License.