-
Notifications
You must be signed in to change notification settings - Fork 290
render: Make ffmpeg an optional dependency #591
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
base: main
Are you sure you want to change the base?
Conversation
As per commit 92db33b ffmpeg is not required anymore by VHS unless some rendering is enabled. For example we only use VHS as a testing tool and we rely on text output only, so having the whole ffmpeg installed isn't required. So do this check at rendering time instead of as a pre-requisite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the pr!
@@ -16,6 +23,16 @@ type FilterComplexBuilder struct { | |||
prevStageName string | |||
} | |||
|
|||
func checkFFMpegDependency() error { | |||
haveFFMpegOnce.Do(func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could use sync.OnceValue
if err := checkFFMpegDependency(); err != nil { | ||
return err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could move this before the for loop, then the sync.Once stuff isn't even needed.
coudl copy the if from main.go:309 there and that's it I think 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR makes the ffmpeg dependency optional by deferring its check to rendering time, allowing users relying solely on text output to avoid installing ffmpeg. Key changes include:
- Adding a runtime ffmpeg dependency check in the Render method.
- Removing the global ffmpeg dependency check from ensureDependencies in main.go.
- Introducing a cached ffmpeg dependency check function in ffmpeg.go.
- Updating README.md to reflect that ffmpeg is optional if text output is used.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
vhs.go | Added a runtime dependency check for ffmpeg during rendering. |
main.go | Removed the mandatory ffmpeg dependency check at startup. |
ffmpeg.go | Introduced a cached checkFFMpegDependency function. |
README.md | Updated installation instructions to clarify optional use. |
As per commit 92db33b ffmpeg is not required anymore by VHS unless some rendering is enabled.
For example we only use VHS as a testing tool and we rely on text output only, so having the whole ffmpeg installed isn't required.
So do this check at rendering time instead of as a pre-requisite