Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • add fallback for ffmpeg

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Nov 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Nov 20, 2025 5:45am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 20, 2025

Greptile Summary

  • Enhanced ffmpeg initialization with binary verification using fsSync.accessSync before falling back to system ffmpeg
  • Changed error handling to throw module-level errors instead of silent warnings when no ffmpeg binary is found
  • Added improved logging with specific installation instructions for Alpine Linux

Confidence Score: 3/5

  • This PR improves ffmpeg detection but introduces a Windows compatibility issue that will cause failures
  • The enhanced fallback logic is good, but using which ffmpeg breaks Windows compatibility. The module-level error throwing is also more strict but appropriate for catching configuration issues early
  • Pay close attention to apps/sim/lib/audio/extractor.ts for the Windows compatibility fix

Important Files Changed

Filename Overview
apps/sim/lib/audio/extractor.ts Improved ffmpeg fallback logic with verification, but has Windows compatibility issue and throws at module load time if no binary found

Sequence Diagram

sequenceDiagram
    participant User
    participant API as "STT Proxy API"
    participant Extractor as "Audio Extractor"
    participant FFmpeg as "FFmpeg Binary"
    participant System as "System FFmpeg"

    User->>API: POST /api/proxy/stt (video file)
    API->>Extractor: extractAudioFromVideo(buffer, mimeType)
    
    Note over Extractor: Module initialization
    Extractor->>FFmpeg: Check ffmpeg-static binary exists
    alt ffmpeg-static exists and executable
        Extractor->>Extractor: Use ffmpeg-static path
    else ffmpeg-static not found
        Extractor->>System: execSync("which ffmpeg")
        alt system ffmpeg found
            Extractor->>Extractor: Use system ffmpeg path
        else no ffmpeg found
            Extractor-->>API: throw Error("No FFmpeg binary found")
            API-->>User: 500 error
        end
    end
    
    Extractor->>FFmpeg: ffmpeg.setFfmpegPath(path)
    Extractor->>FFmpeg: Convert video to audio
    FFmpeg-->>Extractor: Audio buffer
    Extractor-->>API: AudioExtractionResult
    API-->>User: Transcription response
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

@waleedlatif1 waleedlatif1 merged commit 4d5c574 into staging Nov 20, 2025
9 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/sttt branch November 20, 2025 05:49
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