• Stars
    star
    471
  • Rank 92,625 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 3 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Input a local file or url and this service will transcribe it using Whisper AI. Completely private and Free 🀯🀯🀯

transcribe-anything

Actions Status Actions Status Actions Status Actions Status

USES WHISPER AI

Input a local file or url and this tool will transcribe it using Whisper AI into subtitle files and raw text.

Uses whisper AI so this is state of the art translation service - completely free. 🀯🀯🀯

Your data stays private and is not uploaded to any service.

Install (CPU Version)

pip install transcribe-anything

Usage (GPU Accelerated Version) (works on Python 3.10.X)

GPU acceleration is much faster than the CPU version. Install it using the following:

curl https://raw.githubusercontent.com/zackees/transcribe-anything/main/install_cuda.py | python

Usage

 transcribe-anything https://www.youtube.com/watch?v=dQw4w9WgXcQ

Will output:

Detecting language using up to the first 30 seconds. Use `--language` to specify the language
Detected language: English
[00:00.000 --> 00:27.000]  We're no strangers to love, you know the rules, and so do I
[00:27.000 --> 00:31.000]  I've built commitments while I'm thinking of
[00:31.000 --> 00:35.000]  You wouldn't get this from any other guy
[00:35.000 --> 00:40.000]  I just wanna tell you how I'm feeling
[00:40.000 --> 00:43.000]  Gotta make you understand
[00:43.000 --> 00:45.000]  Never gonna give you up
[00:45.000 --> 00:47.000]  Never gonna let you down
[00:47.000 --> 00:51.000]  Never gonna run around and desert you
[00:51.000 --> 00:53.000]  Never gonna make you cry
[00:53.000 --> 00:55.000]  Never gonna say goodbye
[00:55.000 --> 00:58.000]  Never gonna tell a lie
[00:58.000 --> 01:00.000]  And hurt you
[01:00.000 --> 01:04.000]  We've known each other for so long
[01:04.000 --> 01:09.000]  Your heart's been aching but you're too shy to say it
[01:09.000 --> 01:13.000]  Inside we both know what's been going on
[01:13.000 --> 01:17.000]  We know the game and we're gonna play it
[01:17.000 --> 01:22.000]  And if you ask me how I'm feeling
[01:22.000 --> 01:25.000]  Don't tell me you're too much to see
[01:25.000 --> 01:27.000]  Never gonna give you up
[01:27.000 --> 01:29.000]  Never gonna let you down
[01:29.000 --> 01:33.000]  Never gonna run around and desert you
[01:33.000 --> 01:35.000]  Never gonna make you cry
[01:35.000 --> 01:38.000]  Never gonna say goodbye
[01:38.000 --> 01:40.000]  Never gonna tell a lie
[01:40.000 --> 01:42.000]  And hurt you
[01:42.000 --> 01:44.000]  Never gonna give you up
[01:44.000 --> 01:46.000]  Never gonna let you down
[01:46.000 --> 01:50.000]  Never gonna run around and desert you
[01:50.000 --> 01:52.000]  Never gonna make you cry
[01:52.000 --> 01:54.000]  Never gonna say goodbye
[01:54.000 --> 01:57.000]  Never gonna tell a lie
[01:57.000 --> 01:59.000]  And hurt you
[02:08.000 --> 02:10.000]  Never gonna give
[02:12.000 --> 02:14.000]  Never gonna give
[02:16.000 --> 02:19.000]  We've known each other for so long
[02:19.000 --> 02:24.000]  Your heart's been aching but you're too shy to say it
[02:24.000 --> 02:28.000]  Inside we both know what's been going on
[02:28.000 --> 02:32.000]  We know the game and we're gonna play it
[02:32.000 --> 02:37.000]  I just wanna tell you how I'm feeling
[02:37.000 --> 02:40.000]  Gotta make you understand
[02:40.000 --> 02:42.000]  Never gonna give you up
[02:42.000 --> 02:44.000]  Never gonna let you down
[02:44.000 --> 02:48.000]  Never gonna run around and desert you
[02:48.000 --> 02:50.000]  Never gonna make you cry
[02:50.000 --> 02:53.000]  Never gonna say goodbye
[02:53.000 --> 02:55.000]  Never gonna tell a lie
[02:55.000 --> 02:57.000]  And hurt you
[02:57.000 --> 02:59.000]  Never gonna give you up
[02:59.000 --> 03:01.000]  Never gonna let you down
[03:01.000 --> 03:05.000]  Never gonna run around and desert you
[03:05.000 --> 03:08.000]  Never gonna make you cry
[03:08.000 --> 03:10.000]  Never gonna say goodbye
[03:10.000 --> 03:12.000]  Never gonna tell a lie
[03:12.000 --> 03:14.000]  And hurt you
[03:14.000 --> 03:16.000]  Never gonna give you up
[03:16.000 --> 03:23.000]  If you want, never gonna let you down Never gonna run around and desert you
[03:23.000 --> 03:28.000]  Never gonna make you hide Never gonna say goodbye
[03:28.000 --> 03:42.000]  Never gonna tell you I ain't ready

Api

from transcribe_anything.api import transcribe

transcribe(
    url_or_file="https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    output_dir="output_dir",
)

Develop

Works for Ubuntu/MacOS/Win32(in git-bash) This will create a virtual environment

> cd transcribe_anything
> ./install_dev.sh
# Enter the environment:
> source activate.sh

The environment is now active and the next step will only install to the local python. If the terminal is closed then to get back into the environment cd transcribe_anything and execute source activate.sh

Required: Install to current python environment

  • pip install transcribe-anything
    • The command transcribe_anything will magically become available.
  • transcribe_anything <YOUTUBE_URL>

Tech Stack

Testing

  • All tests are run by tox, simply go to the project directory root and run it.

Versions

  • 2.3.6: Fixes typo in readme for installation instructions.
  • 2.3.5: Now has --embed to burn the subtitles into the video itself. Only works on local mp4 files at the moment.
  • 2.3.4: Removed out.mp3 and instead use a temporary wav file, as that is faster to process. --no-keep-audio has now been removed.
  • 2.3.3: Fix case where there spaces in name (happens on windows)
  • 2.3.2: Fix windows transcoding error
  • 2.3.1: static-ffmpeg >= 2.5 now specified
  • 2.3.0: Now uses the official version of whisper ai
  • 2.2.1: "test_" is now prepended to all the different output folder names.
  • 2.2.0: Now explictly setting a language will put the file in a folder with that language name, allowing multi language passes without overwriting.
  • 2.1.2: yt-dlp pinned to new minimum version. Fixes downloading issues from old lib. Adds audio normalization by default.
  • 2.1.1: Updates keywords for easier pypi finding.
  • 2.1.0: Unknown args are now assumed to be for whisper and passed to it as-is. Fixes #3
  • 2.0.13: Now works with python 3.9
  • 2.0.12: Adds --device to argument parameters. This will default to CUDA if available, else CPU.
  • 2.0.11: Automatically deletes files in the out directory if they already exist.
  • 2.0.10: fixes local file issue #2
  • 2.0.9: fixes sanitization of path names for some youtube videos
  • 2.0.8: fix --output_dir not being respected.
  • 2.0.7: install_cuda.sh -> install_cuda.py
  • 2.0.6: Fixes twitter video fetching. --keep-audio -> --no-keep-audio
  • 2.0.5: Fix bad filename on trailing urls ending with /, adds --keep-audio
  • 2.0.3: GPU support is now added. Run the install_cuda.sh script to enable.
  • 2.0.2: Minor cleanup of file names (no more out.mp3.txt, it's now out.txt)
  • 2.0.1: Fixes missing dependencies and adds whisper option.
  • 2.0.0: New! Now a front end for Whisper ai!

More Repositories

1

static_ffmpeg

Installs FFMPEG v5 On Win32/Ubuntu/MacOS
Python
56
star
2

zcmds

Swiss army knife of insanely productive CLI and AI tools. Cross platform.
Python
27
star
3

ytclip

Downloads and clips videos from youtube, rumble, bitchute (using yt-dlp) and clips the video using ffmpeg.
Python
15
star
4

keyvalue_sqlite

Super simple KeyValue store for python, backed by sqlite.
Python
10
star
5

open-webdriver

Yet another web driver wrapper for python. But this one has cross platform tests!
Python
8
star
6

ytclip-server

Docker server running ytclip
Python
6
star
7

python-compile

Compile your python apps into linux binaries
Python
6
star
8

video-subtitles

Makes video subtitles for a video
Python
6
star
9

pydeepspeech

Easy setup for Mozillas Deepspeech transcriber
Python
6
star
10

static-sox

Static binaries for Sox on Win/MacOS/Linux
Python
5
star
11

isolated-environment

Internal venv management to fix AI dependency hell in python
Python
4
star
12

esp32-v51-inmp441

C++
4
star
13

pyjpgclipboard

Cross platform clipboard for handling copy/paste jpg in python
Python
4
star
14

vidcrawler

Crawls videos for content and exports the results as a json
Python
4
star
15

capturing_process

A subprocess type that streams out stdout/stderr easily
Python
4
star
16

install.py

Super easy script that can make a virtual env
Python
3
star
17

playaudio

Easiest way to play a sound in a cross platform way
Python
3
star
18

zcmds_win32

Win32 commands that make windows feel more like linux
Python
2
star
19

make-fastapi-app

Creates a FastAPI App
Python
2
star
20

setenvironment

Cross platform way to set the environment and add paths
Python
2
star
21

webtorrent-how-to-seed-server

An Instructional guide on how to create a network of seed servers to distribute large content
HTML
2
star
22

androidmonitor-backend

Python
2
star
23

aicode

Python
2
star
24

ffmpeg_bins

Repository of certain versions of ffmpeg/ffprobe
2
star
25

disklru

Disk based LRU cache. Great for apps that want to cache data between runs
Python
2
star
26

template-fastapi-project

Default FastAPI Default Project with Docker, ready for Render.com / DigitalOcean
Python
2
star
27

tx

Front end for wormhole, better transfers and more secure
Python
2
star
28

ai-image-video-models

Holds AI models for RealScaler and QualityScaler in pth format
1
star
29

python-subprocess-bug-spooled-temp-file

Python
1
star
30

matrix-shader-3js

HTML
1
star
31

webseed

Blazing Webseed Implementation for Webtorrent
Python
1
star
32

net_image_2_movie

Uses python to fetch an image and then shell utility to create an mp4 via ffmeg
Python
1
star
33

esp32-https-streaming-uploader

A streaming uploader for ESP32 that supports large files and https
C++
1
star
34

gen-rss

Generates an RSS feed, as sampled from wordpress sites
Python
1
star
35

docker-phpFox4

An open source installation of phpFox4 running in a Docker container
PHP
1
star
36

create-python-cmd

Python
1
star
37

qtwave

C++
1
star
38

vids-db

Python
1
star