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

Allow to configure the ffmpeg binary #273

Merged
merged 3 commits into from Jan 3, 2018

Conversation

3 participants
@leplatrem
Contributor

leplatrem commented Nov 14, 2017

Can be avconv in certain distributions, or out of $PATH

@leplatrem leplatrem force-pushed the leplatrem:configurable-ffmpeg branch from ce9f56f to 4acca75 Nov 14, 2017

@saimn

This comment has been minimized.

Owner

saimn commented Nov 14, 2017

There used to be a ffmpeg binary provided by avconv, is it no more the case ?

@saimn

You should declare the new setting in sigal/settings.py. This way it will always have a default value, no more need to use .get().

@@ -61,10 +61,14 @@ def check_subprocess(cmd, source, outname):
raise SubprocessException('Failed to process ' + source)
def video_size(source):
"""Returns the dimensions of the video."""
def video_size(source, settings={}):

This comment has been minimized.

@saimn

saimn Nov 14, 2017

Owner

I would use directly a video_converter parameter (or converter) here to avoid having to pass a dict just for one key.

This comment has been minimized.

@153957

153957 Dec 16, 2017

Also do not create a dict in the function definition (the {} default for settings), because if you do not provide different settings that same dict will be used each time, potentially causing problems.

From flake8-bugbear:

B008: Do not perform calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-time call. If this is intended, assign the function call to a module-level variable and use that variable as a default value.

leplatrem and others added some commits Nov 14, 2017

Allow to configure the ffmpeg binary
Can be 'avconv' in certain distributions.
Add video_converter to the settings dict
Also split arguments for image and video's generate_thumbnail functions.

@saimn saimn force-pushed the leplatrem:configurable-ffmpeg branch from 4acca75 to 498d94c Jan 3, 2018

@codecov

This comment has been minimized.

codecov bot commented Jan 3, 2018

Codecov Report

Merging #273 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #273   +/-   ##
=======================================
  Coverage   79.78%   79.78%           
=======================================
  Files          19       19           
  Lines        1370     1370           
=======================================
  Hits         1093     1093           
  Misses        277      277

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c3fb55...ae6abc3. Read the comment docs.

@saimn saimn added this to the 1.4 milestone Jan 3, 2018

@saimn saimn merged commit f4d07aa into saimn:master Jan 3, 2018

@saimn

This comment has been minimized.

Owner

saimn commented Jan 3, 2018

Merged, thanks @leplatrem . Ideally it should be testable on Travis, but I'm too lazy right now ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment