This project is designed to convert video files into text by extracting the audio from the video and transcribing it using Python's speech_recognition library. The transcribed text files are saved in a dedicated folder.
- Convert video files (.mp4, .avi, .mov, .mkv) to WAV format using
ffmpeg. - Transcribe audio files using Google Speech Recognition API (
SpeechRecognitionlibrary). - Supports multiple languages, including Indonesian (
id-ID), English (en-US), and Spanish (es-ES). - Automatically deletes the audio files after successful transcription.
- Extract audio from video files.
- Convert the extracted audio to text using Google Web Speech API.
- Handle different video formats.
Before running the project, ensure you have installed the following:
- Python 3.x
ffmpegfor extracting audio from video.speechrecognitionlibrary for transcribing audio to text.
Clone this repository to your local machine:
git clone https://github.com/ryshaal/video-to-text.git
cd video-to-textInstall the necessary Python packages:
pip install -r requirements.txtMake sure ffmpeg is installed:
- For Linux:
sudo apt install ffmpeg
- For Windows, download
ffmpegfrom here and follow the installation instructions.
Place the video files you want to transcribe into the video_input/ folder.
Run the script to process the videos:
python main.pyThe transcribed text files will be saved in the transcribe/ folder with the same name as the video file.
You can also run this project on Android using Termux. Follow these steps:
-
Update Termux and install essential packages:
pkg update && pkg upgrade pkg install python ffmpeg -
Install
pipand required Python libraries:pkg install python-pip pip install speechrecognition
-
Install
ffmpegto handle video-to-audio conversion:pkg install ffmpeg
-
Clone the repository in Termux:
cd /storage/emulated/0/ && git clone https://github.com/ryshaal/video-to-text.git && cd /storage/emulated/0/video-to-text/
-
Place your video files in the
video_inputfolder. -
Run the script:
python main.py
-
Follow the instructions, and the transcribed text files will be saved in the
transcribefolder.
- Ensure that Termux has access to your storage. If needed, you can copy files from your internal storage to Termux using the command
cpas shown above. - The performance on Android might be slower than on a desktop environment, so be patient while the video conversion and transcription process runs.
This project is licensed under the MIT License - see the LICENSE file for details.