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

Allow to configure the ffmpeg binary #273

Merged
merged 3 commits into from Jan 3, 2018

Conversation

leplatrem
Copy link
Contributor

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

@saimn
Copy link
Owner

saimn commented Nov 14, 2017

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

Copy link
Owner

@saimn saimn left a 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={}):
Copy link
Owner

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.

Copy link

@153957 153957 Dec 16, 2017

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.

leplatrem and others added 2 commits January 3, 2018 18:52
Can be 'avconv' in certain distributions.
Also split arguments for image and video's generate_thumbnail functions.
@codecov
Copy link

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
Copy link
Owner

saimn commented Jan 3, 2018

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

kontza pushed a commit to kontza/sigal that referenced this pull request Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants