GithubHelp home page GithubHelp logo

vosk-cli's Introduction

vosk-cli

Apache 2.0 License PyPI

This python package serves as an Vosk interface for Opencast. It allows to generate subtitles (WebVTT files) from Video and Audio sources via Vosk.

Installation

1. Install vosk-cli

To install the latest stable version of vosk-cli, run

pip install vosk-cli

Alternatively, to install the latest development version, clone this project and inside the project directory run

pip install .

2. Install dependencies

  • FFmpeg
  • ffprobe

Vosk-cli uses ffprobe to analyze and ffmpeg to preprocess input files. The easiest way to install ffmpeg is by using a package manager. If you want or need to install from source, visit FFmpeg.org/download.html and follow the instructions for your operating system.

3. Download the language model

Go to https://alphacephei.com/vosk/models and download at least the English language model. The larger models generally yield better results.

Usage

Now you are able to run vosk-cli -i <input_file_path> -o <output_file_path> -m <model_name_or_path>.

For example, if there is a video.mp4 file in your download folder and a model named vosk-model-en-us-0.22 in the ./models folder you created, you can run

vosk-cli -i ~/Downloads/video.mp4 -o text -m vosk-model-en-us-0.22

This will create a text.vtt file (which contains the transcribed captions) in your current directory.

Model Search Paths

Vosk-cli follows the following algorithm when attempting to find matching models:

  • Check if the -m flag is passed as an absolute path, if so use it verbatim.
  • Check if ./models/$model is a directory, if so use it.
  • Check if /usr/share/vosk/models/$model is a directory, if so use it.

NOTE: Vosk-cli requires an exact match between directory and model name. If you pass -m eng you must have an eng model in your model search path!

vosk-cli's People

Contributors

lkiesow avatar marwyg avatar owi92 avatar arnei avatar gregorydlogan avatar user10293401 avatar

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.