Skip to content

Commit

Permalink
Improved embeddedsubtitles provider by turning on Audio Sync during a…
Browse files Browse the repository at this point in the history
…udio extraction process
  • Loading branch information
dvh312 authored Sep 22, 2024
1 parent 14a361d commit c69be93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_libs/subliminal_patch/providers/whisperai.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def encode_audio_stream(path, ffmpeg_path, audio_stream_language=None):
logger.debug(f"Whisper will only use the {audio_stream_language} audio stream for {path}")
inp = inp[f'a:m:language:{audio_stream_language}']

out, _ = inp.output("-", format="s16le", acodec="pcm_s16le", ac=1, ar=16000) \
out, _ = inp.output("-", format="s16le", acodec="pcm_s16le", ac=1, ar=16000, af="aresample=async=1") \
.run(cmd=[ffmpeg_path, "-nostdin"], capture_stdout=True, capture_stderr=True)

except ffmpeg.Error as e:
Expand Down

0 comments on commit c69be93

Please sign in to comment.