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 'threads' option to ffmpeg invocations #381

Open
jesusbagpuss opened this issue Apr 9, 2024 · 0 comments
Open

Add 'threads' option to ffmpeg invocations #381

jesusbagpuss opened this issue Apr 9, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jesusbagpuss
Copy link
Contributor

By default, ffmpeg will be 'greedy' in it's CPU use.

This can be limited by defining a -threads X option to the invocation.
The value of 'X' should be chosen appropriately for the resources on the server - e.g. 50% of the number of CPUs - to leave overhead for web requests to be handled.

Lowering the number of threads may mean ffmpeg calls take longer to complete - but the benefit of leaving resource for Apache outweighs this.

There are a few ways to address this (and possibly more):

  • document the use of the -threads X option on the EP-wiki. The invocations can be set in repo config, so if someone wanted to use the threads option, they could add an appropriate option to their archive config.
  • hardcode it in ~/lib/syscfg.d/invocations.pl
  • add a global config option, defaulting to zero (to maintain existing way it works). Would need to be interpolated in ~/lib/syscfg.d/invocations.pl. Option can be overwritten in archive config.
  • add to Plugin::Convert::Thumbnails as e.g. $DEFAULT{ffmpeg_threads} = 0;. This would allow most tuning of the option.

If an appropriate approach can be decided, I'll do the coding.

@drn05r drn05r self-assigned this Apr 14, 2024
@drn05r drn05r added the enhancement New feature or request label Apr 14, 2024
@drn05r drn05r added this to the 3.4.6 milestone Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants