Skip to content

Accept - as --input to transcribe from stdin - #2061

Open
Kayvan-Zahiri wants to merge 1 commit into
alphacep:masterfrom
Kayvan-Zahiri:feat/2031-stdin-input
Open

Accept - as --input to transcribe from stdin#2061
Kayvan-Zahiri wants to merge 1 commit into
alphacep:masterfrom
Kayvan-Zahiri:feat/2031-stdin-input

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown

Closes #2031.

vosk-transcriber could not be piped into. The reported command

ffmpeg ... -f wav - | vosk-transcriber -i - --lang en -t txt

failed at the Path(args.input).exists() check, so ffmpeg was never reached and
the writer got a broken pipe.

- as --input now maps the ffmpeg input URL to pipe:0 and builds a single
task, which is how ffmpeg and whisper spell stdin. -nostdin stays: it only
stops ffmpeg reading interactive commands and does not affect an explicit
-i pipe:0 (checked against ffmpeg 8.0.1, byte-identical output either way).

Also formatted the missing-input message, which printed the literal
{args.input} instead of the path. That is visible in the issue's own output.

Verified with vosk-model-small-en-us-0.15 on a 16 kHz mono WAV:

run result
-i file.wav (control) the quick brown fox jumps over the lazy dog
ffmpeg ... | -i - identical
-i - with -o out.txt identical, written to the file
-i - with -t srt timed subtitles
directory input unchanged
missing file now names the path

vosk-transcriber could not be piped into, so 'ffmpeg ... -f wav - |
vosk-transcriber -i -' failed the Path.exists() check before reaching
ffmpeg. Passing - now maps the ffmpeg input URL to pipe:0 and builds a
single task, matching how ffmpeg and whisper spell stdin.

Also format the missing-input message, which printed the literal text
{args.input} rather than the path.

Closes alphacep#2031
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Implement input from stdin in vosk-transcriber

1 participant