Skip to content

Conversation

@stratus-ss
Copy link
Contributor

Extract FFmpeg Utilities into Separate Module

Refactors FFmpeg command construction and execution logic from monkeyplug.py into a dedicated utilities.py module to improve maintainability and testability.

Why?

As I added features in my own fork monkeyplug.py grew fairly large. It also allows for a more easily maintainable code base. In order to support both remote whisper servers as well as file chunking, eventually it allows a separation of concerns moving forward.

Ideally this is the ground work for future feature PRs without overwhelming the monkeyplug.py

Changes

  • Extract FFmpegCommandBuilder, AudioFilterBuilder, and FFmpegRunner classes to src/monkeyplug/utilities.py
  • Add comprehensive unit tests (test_utilities.py) and functional tests (test_functional.py)
  • Add test fixtures and requirements-dev.txt

Benefits

  • Easier to test FFmpeg command construction in isolation
  • Reduces code duplication
  • Maintains backward compatibility
  • Improves code organization without changing behavior

Testing

  • All existing functionality preserved
  • New unit tests cover command builders and runners
  • Functional tests validate end-to-end behavior

- Extract FFmpegCommandBuilder, AudioFilterBuilder, and FFmpegRunner classes
- Add comprehensive unit and functional tests
@selfAndrewKB
Copy link

Again, I cannot stress enough how much of a game changer this tool is.

I’ve gone as far as using it to create profanity censor mods for entire video games. The future is bright.

@mmguero mmguero self-assigned this Jan 21, 2026
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.

3 participants