File size: 2,590 Bytes
9fe2da5
 
 
 
 
 
 
 
 
 
 
 
f19ef2a
 
dc8fd1b
6d95494
0edbcd1
051ee03
 
 
 
 
 
dc8fd1b
 
 
 
 
 
 
 
 
051ee03
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dc8fd1b
 
 
 
 
 
 
 
 
 
 
 
 
051ee03
dc8fd1b
 
 
 
 
 
 
 
 
 
 
051ee03
 
dc8fd1b
051ee03
 
 
 
 
 
 
 
 
20506d2
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
title: Youtube Whisper
emoji: 🐢
colorFrom: purple
colorTo: pink
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: mit
---

# Youtube-Whisper
A simple Gradio app that transcribes YouTube videos by extracting audio and using OpenAI’s Whisper model for transcription. Paste a YouTube link and get the video’s audio transcribed into text.

![Demo](assets/demo.gif)

## Requirements

- Conda installed (for managing environments)
- Python 3.9 or above
- **FFmpeg** installed (required for audio conversion)

## Installation

### Step 1: Clone the Repository

```bash
git clone https://github.com/danilotpnta/Youtube-Whisper.git
cd Youtube-Whisper
```

### Step 2: Install FFmpeg

You need FFmpeg for processing the audio. Install it based on your operating system:

- **macOS**: Install FFmpeg via Homebrew:
  ```bash
  brew install ffmpeg
  ```

- **Ubuntu/Linux**: Install FFmpeg via apt:
  ```bash
  sudo apt update
  sudo apt install ffmpeg
  ```

- **Windows**: 
  - Download FFmpeg from the official website: [FFmpeg Download](https://ffmpeg.org/download.html).
  - Extract the files and add the `bin` folder to your system’s PATH environment variable. For detailed instructions on adding FFmpeg to PATH, you can follow [this guide](https://www.geeksforgeeks.org/how-to-install-ffmpeg-on-windows/).

Verify the installation by running:
```bash
ffmpeg -version
```

### Step 3: Create and Activate the Conda Environment

To set up the environment using the provided `environment.yml` file:

```bash
conda env create -f environment.yml
```

Once the environment is created, activate it with:

```bash
conda activate yt-whisper
```

### Step 4: Run the App

Once the environment is active, you can launch the Gradio app with:

```bash
python app.py
```

This will start a local server for the app, and you can access it by visiting the URL printed in the terminal (usually `http://localhost:7860/`).

### Troubleshooting

1. **FFmpeg Not Found**: 
   If you see an error related to `ffmpeg not found`, ensure FFmpeg is installed and added to your system's PATH. You can also specify its location manually in the script by setting `ffmpeg_location`.

2. **Pytube Errors**:
   If you encounter issues with `pytube`, ensure you’re using the `yt-dlp` version and that your URL is correctly formatted.

3. **Update Dependencies**:
   Ensure that `pip` and `conda` are up to date:
   ```bash
   conda update conda
   pip install --upgrade pip
   ```

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.