Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Capability to specify FFMPEG Path to Whisperer #2511

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PeterAkande
Copy link

Description of the Issue

There are scenarios where specifying a default ffmpeg executable path is essential for achieving desired functionality. By default, the program attempts to use the globally available ffmpeg command, but this approach might not always work.

For instance, a common error that users may encounter is:

ERROR - Error in transcribe_and_save: [Errno 2] No such file or directory: 'ffmpeg'

This error often arises when ffmpeg is not properly installed or accessible due to specific system configurations. Even after installing ffmpeg, users might face challenges if their environment is not set up correctly.

Proposed Solution

To make configuration more flexible and user-friendly, this update allows users to explicitly specify the path to the ffmpeg executable. By setting the path programmatically, users can avoid system-level issues and ensure the correct executable is used.

Here’s an example of how this can be configured:

import whisper

# Specify the path to the ffmpeg executable
whisper.ffmpeg_path = "/usr/bin/ffmpeg"

# Load the model and transcribe audio
model = whisper.load_model("turbo")
result = model.transcribe("audio.mp3")
print(result["text"])

Benefits

  • Improved Flexibility: Users can define the ffmpeg path based on their specific environment, bypassing global configuration issues.
  • Error Prevention: Reduces errors caused by missing or improperly configured ffmpeg installations.
  • Ease of Use: Provides a straightforward way for users to resolve potential issues without extensive debugging.

@ryanheise
Copy link
Contributor

If the user lacks admin privileges to correctly configure the system, they can still update the PATH environment variable as desired to point to their preferred ffmpeg path, without changing the Whisper source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants