Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

File uploads fail to transcribe unless they are MP4 format. #12

Closed
tuxpowered opened this issue Jan 25, 2023 · 1 comment
Closed

File uploads fail to transcribe unless they are MP4 format. #12

tuxpowered opened this issue Jan 25, 2023 · 1 comment

Comments

@tuxpowered
Copy link

Trying to upload a PCM wav file, MP3 audio fail to process due to error. (Uploading a wav file gives a codec error) however converting the file to mp4 the process works.

  Metadata:
    encoder         : Lavf56.40.101
  Duration: 00:08:55.75, start: 0.138125, bitrate: 64 kb/s
  Stream #0:0: Audio: mp3, 8000 Hz, mono, fltp, 64 kb/s
[mp4 @ 0x7f970a304ec0] track 0: muxing mp3 at 8000hz is not standard, to mux anyway set strict to -1
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
    Last message repeated 1 times
2023-01-25 11:30:51.555 Uncaught app exception
Traceback (most recent call last):
  File "/Users/ben/Developer/whisper-ui/.venv/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/Users/ben/Developer/whisper-ui/01_Transcribe.py", line 66, in <module>
    st.session_state.transcription = Transcription(name, input_file, "file", start, duration)
  File "/Users/ben/Developer/whisper-ui/transcriber.py", line 54, in __init__
    ffmpeg.run(audio, overwrite_output=True)
  File "/Users/ben/Developer/whisper-ui/.venv/lib/python3.10/site-packages/ffmpeg/_run.py", line 325, in run
    raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

The current work around is to convert the file to wav then back to mp4

ffmpeg -i src.mp3 audio.wav
ffmpeg -i audio.wav audio.mp4
@hayabhay
Copy link
Owner

hayabhay commented Feb 5, 2023

This shouldn't surface now. Previously audio files were trimmed and now that feature is removed which means files are stored as-is. So this error shouldn't surface as long as Whisper can understand the native format. Please raise this issue again if it reappears (see #13)

@hayabhay hayabhay closed this as completed Feb 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants