-
Notifications
You must be signed in to change notification settings - Fork 171
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
Conversation
ce9f56f
to
4acca75
Compare
There used to be a |
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.
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()
.
sigal/video.py
Outdated
@@ -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={}): |
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.
I would use directly a video_converter
parameter (or converter
) here to avoid having to pass a dict just for one key.
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.
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.
Can be 'avconv' in certain distributions.
Also split arguments for image and video's generate_thumbnail functions.
4acca75
to
498d94c
Compare
Codecov Report
@@ 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.
|
Merged, thanks @leplatrem . Ideally it should be testable on Travis, but I'm too lazy right now ;) |
Allow to configure the ffmpeg binary
Can be
avconv
in certain distributions, or out of$PATH