This project implements a real-time, streaming lip-syncing system using a Wav2Lip model.
- The Client establishes a WebSocket connection with the Gateway and streams audio chunks.
- The Gateway pushes these tasks as jobs into a Redis List (worker_queue).
- The Worker continuously pulls jobs from the queue.
- After processing the audio with the AI model, the Worker publishes the resulting video frame to a Redis Pub/Sub channel unique to the client.
- The Gateway, which is subscribed to this channel, receives the frame instantly.
- Finally, the Gateway streams the video frame back to the Client over the WebSocket, completing the real-time loop.
Before you begin, ensure you have the following installed on your system:
- Docker: https://www.docker.com/get-started
- Docker Compose: (Usually included with Docker Desktop)
- Clone the Repository
git clone https://github.com/Tanio253/streaming-Wav2Lip cd streaming-Wav2Lip
With the model in place, you can start the entire application using a single Docker Compose command:
docker-compose up --buildThe gateway provides a built-in HTML client for easy testing.
-
Open the Client: Once the Docker containers are running, navigate to the following URL in your web browser: http://localhost:8000
-
Start a Session:
- Click "Choose File" and select a clear, front-facing image (PNG or JPEG).
- Click the "Start LipSync Session" button.
-
Stream Audio:
- Allow the microphone permission.
- Click the "Start Recording & Streaming" button.
- Begin speaking into your microphone.
Please visit non-streaming branch to use the non streaming version, which is of higher quality.
