auto-subtitle
auto-subtitle copied to clipboard
Fix audio out of sync
I encountered a similar issue described in #28, but my videos are in English. I suspect it is related to the variable framerates of the video's recording device.
After some debugging, it turns out the output .wav
audio file is out of sync with the original video. Thus, I added the -async 1
option to ffmpeg
and it fixed the issue.
Also, becauseasync
is a reversed keyword in Python, I replaced the call to ffmpeg
with subprocess.run
.
- The ffmpeg module was replaced with the subprocess module due to conflicting argument name "async"
- A new function get_audio() is added which extracts audio from a video file and returns its path
- In main(), if --extract-audio flag is set, then extract audio using get_audio() instead of calling transcribe().
@RapDoodle Can you update this to use the newer aresample
option instead? I believe this will also let us keep using ffmpeg directly
- The ffmpeg module was replaced with the subprocess module due to conflicting argument name "async"
- A new function get_audio() is added which extracts audio from a video file and returns its path
- In main(), if --extract-audio flag is set, then extract audio using get_audio() instead of calling transcribe().
[what-the-diff] what a lovely but completely useless chap you are 😉. Your contribution made no sense to this thread. Anyway, @RapDoodle I'm afraid the de-synchronization still happens despite the changes!
Following the discussion here https://github.com/openai/whisper/discussions/1888 I was able to greatly improve accuracy by adding the --word_timestamps True
flag to the transcribe call.
GitHub
Hail I'm trying to translate this German movie into English or at least transcribing. I see that the translation or transcribing are truly impressive, nothing to complain. And somehow somewhat, the...