Hey there! This is a handy Rust tool that takes your video files and turns them into text transcriptions. Perfect for when you need to convert lectures, meetings, or any video content into readable text.
Why Rust? This baby runs about 4x faster than the same thing written in Python. Because who wants to wait around for transcriptions, right?
This little program is like having a personal transcriptionist in your terminal. Here's the magic it performs:
- Takes your video file (MP4, MOV, and most FFmpeg-supported formats) and extracts the audio from it
- Cleans up the audio by removing those awkward silences (you know, the ones that make files unnecessarily long)
- Chops up long videos into manageable 30-minute chunks (because nobody wants to process a 3-hour file in one go)
- Transcribes the audio using OpenAI's Whisper model — default language is Portuguese, but you can pick another with
--language <code>(e.g.,en,pt,es) - Saves nice text files with all the transcribed content
The best part? It cleans up after itself, removing all those temporary files it created during the process. No mess left behind! 🧹
Before you dive in, you'll need:
- Rust installed on your machine (obviously!)
- FFmpeg development libraries (used via Rust bindings, no CLI calls). Install system packages so that
pkg-configcan findlibav*:- On macOS:
brew install ffmpeg pkg-config - On Ubuntu/Debian:
sudo apt install ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswresample-dev pkg-config - On other Linux distros: install the equivalent
libav*dev packages andpkg-config - Note: The FFmpeg CLI binary is NOT required anymore.
- On macOS:
Clone this bad boy and build it:
git clone <your-repo-url>
cd transcribe
cargo build --releaseIt's dead simple! Just run:
cargo run -- --input-video your-video.mov --output-dir transcriptions --language enOr if you built the release version:
./target/release/transcribe --input-video your-video.mp4 --output-dir transcriptions --language ptSay you've got a lecture recording called physics_101.mov and you want English:
cargo run -- --input-video physics_101.mov --output-dir physics_notes --language enThis will:
- Create a
physics_notesdirectory (if it doesn't exist) - Extract and process the audio
- Generate transcription files like
transcricao_parte_000.wav.txt,transcricao_parte_001.wav.txt, etc.
Don't panic if the first run takes a while! The program needs to download the Whisper model (about 500MB) on its first run. It'll save it in ~/.whisper-model/ so future runs will be much faster.
You'll see a nice progress bar while it downloads:
⬇️ Downloading whisper model :
https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin
[00:00:45] [████████████████████████████████████████] 500MB/500MB (00:00:00)
✅ Download finished
After the program finishes (grab a coffee, it might take a while for long videos), you'll find:
- Text files in your output directory
- Each file contains the transcription for a ~30-minute segment
- Files are named sequentially:
transcricao_parte_000.wav.txt,transcricao_parte_001.wav.txt, etc.
- Video format: Supports MP4, MOV, and most formats FFmpeg can read
- Language: Default is Portuguese (
pt). Choose another with--language <code>(e.g.,en,pt,es) - Temp files: The program uses
~/.transcribe-workdir/for temporary files but cleans everything up when done - Audio quality: Better audio = better transcriptions. The program does its best to clean up the audio, but garbage in, garbage out!
- Processing time: Transcription takes time. A 1-hour video might take 10-15 minutes depending on your machine
- The app now uses FFmpeg libraries directly (via
ffmpeg-next) instead of spawning theffmpegCLI. - Silence removal uses FFmpeg's
silenceremovefilter through libavfilter for parity with previous behavior. - Chunk files are written as
part_000.wav,part_001.wav, ... into~/.transcribe-workdir/.
"FFmpeg is not installed or not in PATH"
- Make sure FFmpeg is installed and accessible from your terminal. Try running
ffmpeg -versionto check.
"Input video does not exist"
- Double-check your file path. The program needs the full path or relative path from where you're running it.
Out of memory
- Very long videos might cause issues. The program splits them into chunks, but if you're still having problems, try splitting your video first.
Found a bug? Want to add a feature? PRs are welcome! Just remember to:
- Run
cargo fmtbefore committing - Check
cargo clippyfor any warnings - Keep the informal, friendly tone in docs 😊
This project is licensed under the MIT License - see the LICENSE file for details.
Happy transcribing! 🎉
E aí! Essa é uma ferramenta bacana em Rust que pega seus arquivos de vídeo e transforma em transcrições de texto. Perfeito pra quando você precisa converter aulas, reuniões ou qualquer conteúdo em vídeo pra texto.
Por que Rust? Esse negócio roda umas 4x mais rápido que a mesma coisa escrita em Python. Porque ninguém quer ficar esperando as transcrições, né?
Esse programinha é tipo ter um transcritor pessoal no seu terminal. Olha a mágica que ele faz:
- Pega seu arquivo de vídeo (MP4, MOV e outros formatos suportados pelo FFmpeg) e extrai o áudio
- Limpa o áudio removendo aqueles silêncios chatos (sabe aqueles que deixam os arquivos desnecessariamente longos?)
- Corta vídeos longos em pedaços de 30 minutos (porque ninguém quer processar um arquivo de 3 horas de uma vez)
- Transcreve o áudio usando o modelo Whisper da OpenAI — por padrão em português, mas você pode escolher com
--language <código>(ex.:en,pt,es) - Salva arquivos de texto com todo o conteúdo transcrito
A melhor parte? Ele limpa toda a bagunça depois, removendo todos os arquivos temporários que criou durante o processo. Não deixa sujeira pra trás! 🧹
Antes de começar, você vai precisar:
- Rust instalado na sua máquina (óbvio!)
- FFmpeg - Isso é super importante! O programa usa o FFmpeg pra lidar com todo o processamento de áudio/vídeo
- No macOS:
brew install ffmpeg - No Ubuntu/Debian:
sudo apt install ffmpeg - No Windows: Baixe em ffmpeg.org
- No macOS:
É moleza! Só rodar:
cargo run -- --input-video seu-video.mov --output-dir transcricoes --language enOu se você compilou a versão release:
./target/release/transcribe --input-video seu-video.mp4 --output-dir transcricoes --language ptDigamos que você tem uma gravação de aula chamada fisica_101.mov e quer em inglês:
cargo run -- --input-video fisica_101.mov --output-dir anotacoes_fisica --language enIsso vai:
- Criar um diretório
anotacoes_fisica(se não existir) - Extrair e processar o áudio
- Gerar arquivos de transcrição tipo
transcricao_parte_000.wav.txt,transcricao_parte_001.wav.txt, etc.
Não se assuste se a primeira execução demorar! O programa precisa baixar o modelo Whisper (uns 500MB) na primeira vez. Ele vai salvar em ~/.whisper-model/ então as próximas execuções serão bem mais rápidas.
- Formato de vídeo: Suporta MP4, MOV e a maioria dos formatos que o FFmpeg consegue abrir
- Idioma: Padrão é português (
pt). Escolha outro com--language <código>(ex.:en,pt,es) - Arquivos temporários: O programa usa
~/.transcribe-workdir/pra arquivos temporários mas limpa tudo quando termina - Qualidade do áudio: Áudio melhor = transcrições melhores. O programa faz o possível pra limpar o áudio, mas lixo entra, lixo sai!
- Tempo de processamento: Transcrição leva tempo. Um vídeo de 1 hora pode levar uns 10-15 minutos dependendo da sua máquina
Boas transcrições! 🎉