hafpaf / asr_subtitles Goto Github PK
View Code? Open in Web Editor NEWGenerate talk subtitles with OpenAI Whisper. This is now a mirror, origin can be found at codeberg.
Home Page: https://codeberg.org/hafnium/ASR_subtitles
License: MIT License
Generate talk subtitles with OpenAI Whisper. This is now a mirror, origin can be found at codeberg.
Home Page: https://codeberg.org/hafnium/ASR_subtitles
License: MIT License
Add comment in SRT file on transcribed date and Whisper model size
Suggested format:
# Transcribed 2023-11-10 with medium model size
This allows proofreading contributors to identify the accuracy of a raw transcription file
Verify audio if available in file format, and handle error of by lack thereof, ie. skip file processing if not video file.
Approaches:
One could make a list of accepted filetypes or simply skip SRT files
Error shown:
video file: ../videofiles/import-56124-eng-Goodbye_World_hd.mp4.srt
Traceback (most recent call last):
File "/ASR_subtitles/venv/lib/python3.9/site-packages/whisper/audio.py", line 59, in load_audio
out = run(cmd, capture_output=True, check=True).stdout
File "/usr/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ffmpeg', '-nostdin', '-threads', '0', '-i', '../videofiles/import-56124-en
g-Goodbye_World_hd.mp4.srt', '-f', 's16le', '-ac', '1', '-acodec', 'pcm_s16le', '-ar', '16000', '-']' returned non-z
ero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/ASR_subtitles/app.py", line 38, in transcribe_audio audio = whisper.load_audio(video_file_path)
File "/ASR_subtitles/venv/lib/python3.9/site-packages/whisper/audio.py", line 61, in load_audio raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e
RuntimeError: Failed to load audio: ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
...
Output file #0 does not contain any stream
Error message
/ASR_subtitles/app.py:55: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.
df = pd.concat([df, pd.DataFrame([new_row])], axis=0, ignore_index=True)
A recent upgrade to pandas 2.1.2 from 1.5.2 now presents this warning.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.