Giter Club home page Giter Club logo

livevtt's Introduction

LiveVTT

LiveVTT is a tool for live transcription of streaming audio/video content, providing real-time subtitles in WebVTT format.

Description

LiveVTT allows you to transcribe live audio/video streams and generate WebVTT subtitles. It supports various features such as model selection, CUDA utilization, silence filtering, and more.

Usage

livevtt -u <URL> [-s] [-l <BIND_ADDRESS>] [-p <BIND_PORT>] [-m <MODEL>] [-b <BEAM_SIZE>] [-c <USE_CUDA>] [-t <TRANSLATE>] [-vf <VAD_FILTER>] [-la <LANGUAGE>] [-ua <USER_AGENT>]

Arguments

  • -u, --url: [Required] URL of the live audio/video stream.
  • -s, --hard-subs: Set if you want the subtitles to be baked into the stream itself.
  • -l, --bind-address: The IP address to bind to (defaults to 127.0.0.1).
  • -p, --bind-port: The port to bind to (defaults to 8000).
  • -m, --model: Whisper model to use (defaults to large).
  • -b, --beam-size: Beam size to use (defaults to 5).
  • -c, --use-cuda: Use CUDA where available. Defaults to true.
  • -t, --transcribe: If set, transcribes rather than translates the given stream.
  • -vf, --vad-filter: Whether to utilize the Silero VAD model to try and filter out silences. Defaults to false.
  • -la, --language: The original language of the stream, if known/not multilingual. Can be left unset.
  • -ua, --user-agent: User agent to use to retrieve playlists/stream chunks (defaults to 'VLC/3.0.18 LibVLC/3.0.18').

Accessing Transcribed Stream

Once the program is running, you can access the transcribed and/or translated stream at the following URL:

http://127.0.0.1:8000/playlist.m3u8

This URL may vary based on the bind address and port provided via the command-line options.

Installation

Note that the minimum target Python version for this script is Python 3.10 at present. You will also need to ensure that you have the ffmpeg package installed on your system.

  1. Clone the repository:

    git clone https://github.com/Psychotropos/livevtt.git
  2. Navigate to the directory:

    cd livevtt
  3. Install dependencies:

    • For general installation:
    pip install -r requirements.txt

Examples

  1. Transcribe a live audio/video stream with default settings:

    livevtt -u <URL>
  2. Transcribe a live audio/video stream and embed subtitles:

    livevtt -u <URL> -s

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

livevtt's People

Contributors

psychotropos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

livevtt's Issues

Subtitles chunks created, but not shown in playback

Very cool project! I'm trying to get it up and running, and everything seems to be starting as it should, but there are very few requests towards the .vtt-endpoints. And I'm unable to see the subtitles.

I see a couple of requests to the .vtt-chunks when selecting the subtitle track in the player (VLC, Quicktime Player), but none of these vtt-chunks are displayed in the player.

Any thoughts on why that might be?

Reproduce by:
python main.py -u "https://cph-msl.akamaized.net/hls/live/2000341/test/master.m3u8"

Here are my server logs when starting a client connection in Quicktime and enabling subs:

192.168.1.143 - - [16/Jun/2024 18:14:20] "GET /chunklist.m3u8 HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:20] "GET /segment_4_20240616_1718561628.ts HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:23] "GET /segment_4_20240616_1718561634.ts HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:26] "GET /chunklist.m3u8 HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:26] "GET /segment_4_20240616_1718561640.ts HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:27] "GET /subs.m3u8 HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:27] "GET /segment_4_20240616_1718561628.vtt HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:27] "GET /segment_4_20240616_1718561634.vtt HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:27] "GET /segment_4_20240616_1718561640.vtt HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:29] "GET /segment_4_20240616_1718561646.ts HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:32] "GET /chunklist.m3u8 HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:32] "GET /segment_4_20240616_1718561652.ts HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:32] "GET /subs.m3u8 HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:35] "GET /chunklist.m3u8 HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:35] "GET /subs.m3u8 HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:38] "GET /chunklist.m3u8 HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:38] "GET /segment_4_20240616_1718561659.ts HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:38] "GET /subs.m3u8 HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:41] "GET /segment_4_20240616_1718561664.ts HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:44] "GET /chunklist.m3u8 HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:44] "GET /subs.m3u8 HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:47] "GET /chunklist.m3u8 HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:47] "GET /subs.m3u8 HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:50] "GET /chunklist.m3u8 HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:50] "GET /segment_4_20240616_1718561670.ts HTTP/1.1" 200 -
192.168.1.143 - - [16/Jun/2024 18:14:53] "GET /segment_4_20240616_1718561677.ts HTTP/1.1" 200 -```

Ubuntu 22.0.4

Hi,

Need to Thnaksyou first for amazing tool and nice idea, please I tried to use it on ubuntu 22.0.4 and python3 but I got a lot off error please if you can update or test it on Linux ,

Thanks a lot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.