You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verify audio if available in file format, and handle error of by lack thereof, ie. skip file processing if not video file.
Approaches:
Check for filetype magic bytes by using a library interfacing with libmagic (preferable)
Read file name extension.
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
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: