Giter VIP home page Giter VIP logo

video_to_text's Introduction

Video to Text Transcription

This project provides a tool for transcribing audio and video content using the OpenAI Whisper model.

Setup

1. Install Dependencies

Install Whisper

pip install -U openai-whisper

Install FFmpeg

ffmpeg is a powerful tool to handle multimedia data. It's required for extracting audio from video.

# on Ubuntu or Debian
sudo apt update && sudo apt install ffmpeg

# on Arch Linux
sudo pacman -S ffmpeg

# on MacOS using Homebrew (https://brew.sh/)
brew install ffmpeg

# on Windows using Chocolatey (https://chocolatey.org/)
choco install ffmpeg

# on Windows using Scoop (https://scoop.sh/)
scoop install ffmpeg

Install Rust (if needed)

In some cases, you might need Rust to be installed, especially if some dependencies don't provide pre-built binaries.

Follow the Getting started page to install Rust. You might need to set up your PATH:

export PATH="$HOME/.cargo/bin:$PATH"

If you encounter the error No module named 'setuptools_rust', install setuptools_rust:

pip install setuptools-rust

Install MoviePy

MoviePy is a Python module for video editing, which can also be used for opening and modifying video files.

pip install moviepy

2. Clone the Repository

git clone [REPOSITORY LINK]
cd [REPOSITORY NAME]

Usage

Display Help

python v2t.py --help

Transcribe Video

python v2t.py --task video --video path_to_video_file.mp4 --output_dir desired_output_directory

Transcribe Audio

python v2t.py --task audio --audio path_to_audio_file.wav --output_dir desired_output_directory

Specify Model

python v2t.py --task audio --audio path_to_audio_file.wav --model model_name

Output Format

python v2t.py --task audio --audio path_to_audio_file.wav --output_format txt

Language Specification

python v2t.py --task audio --audio path_to_audio_file.wav --language es

Translate to English

python v2t.py --task audio --audio path_to_audio_file.wav --translate

Silence Output

python v2t.py --task audio --audio path_to_audio_file.wav --verbose false

Combine arguments as needed. For example, to transcribe a Spanish video, save the results as a txt file, and translate it to English

python v2t.py --task video --video path_to_video_file.mp4 --language es --output_format txt --translate

video_to_text's People

Contributors

autumnfallenwang avatar

Watchers

 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.