stream.ffmpegmux: cache executable lookups#4660
Merged
gravyboat merged 1 commit intoJul 20, 2022
Merged
Conversation
- Remove redundant commands with `.exe` suffixes. `shutil.which` will pick those up via `PATHEXT` on Windows. - Move executable lookup to `FFMPEGMuxer.resolve_command`, so its inputs and return values can be cached using `functools.lru_cache` without relying on a Streamlink session instance as input - Keep interface of `FFMPEGMuxer.is_usable` and `FFMPEGMuxer.command` - Add proper tests
bc1d6e2 to
3193fb6
Compare
Member
Author
|
I'll submit another PR which will update the other ffmpegmuxer tests once this one got merged, as it's unrelated to the changes here. |
Member
Author
|
Any reviews? The changes are fairly simple. |
Member
|
Sorry @bastimeyer. I actually looked at this 3 days ago but guess I closed the tab instead of merging. |
Billy2011
added a commit
to Billy2011/streamlink-27
that referenced
this pull request
Jul 23, 2022
- Remove redundant commands with `.exe` suffixes. `shutil.which` will pick those up via `PATHEXT` on Windows. - Move executable lookup to `FFMPEGMuxer.resolve_command`, so its inputs and return values can be cached using `functools.lru_cache` without relying on a Streamlink session instance as input - Keep interface of `FFMPEGMuxer.is_usable` and `FFMPEGMuxer.command` - Add proper tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
.exesuffixes.shutil.whichwill pick those up viaPATHEXTon Windows.FFMPEGMuxer.resolve_command, so its inputsand return values can be cached using
functools.lru_cachewithoutrelying on a Streamlink session instance as input
FFMPEGMuxer.is_usableandFFMPEGMuxer.commandFFMPEGMuxer.is_usablecurrently doesn't get cached, which means that when generating a list ofMuxedHLSStreams for example,ffmpegwill get looked up every single time, and additionally when a the stream gets opened.I didn't remove
avconvyet, even if it's totally useless nowadays (the libav fork of ffmpeg was abandoned in 2018). There might still be someone though using an old Debian or CentOS release which defaults to libav.