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

fix lost threads parameter from merge #78

Merged
merged 1 commit into from
Oct 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions moviepy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@

from config_defaults import (FFMPEG_BINARY, IMAGEMAGICK_BINARY)


def try_cmd(cmd):
try:
popen_params = {"stdout": sp.PIPE,
"stderr": sp.PIPE,
"stdin": DEVNULL}

# This was added so that no extra unwanted window opens on windows
# when the child process is created
if os.name == "nt":
Expand All @@ -26,7 +27,7 @@ def try_cmd(cmd):
return True, None


if FFMPEG_BINARY=='auto-detect':
if FFMPEG_BINARY == 'auto-detect':

if try_cmd(['ffmpeg'])[0]:
FFMPEG_BINARY = 'ffmpeg'
Expand All @@ -35,11 +36,11 @@ def try_cmd(cmd):
else:
FFMPEG_BINARY = 'unset'
else:
success, err = try_cmd(cmd)
success, err = try_cmd(FFMPEG_BINARY)
if not success:
raise err

if IMAGEMAGICK_BINARY=='auto-detect':
if IMAGEMAGICK_BINARY == 'auto-detect':

if try_cmd(['convert'])[0]:
IMAGEMAGICK_BINARY = 'convert'
Expand All @@ -49,7 +50,7 @@ def try_cmd(cmd):


def get_setting(varname):
""" Returns the value of a configuration variable. """
""" Returns the value of a configuration variable. """
gl = globals()
if varname not in gl.keys():
raise ValueError("Unknown setting %s"%varname)
Expand Down
6 changes: 5 additions & 1 deletion moviepy/video/io/ffmpeg_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ def __init__(self, filename, size, fps, codec="libx264", audiofile=None,
cmd.extend([
'-b', bitrate
])

if threads is not None:
cmd.extend(["-threads", str(threads)])

if ((codec == 'libx264') and
(size[0] % 2 == 0) and
(size[1] % 2 == 0)):
Expand All @@ -119,7 +123,7 @@ def __init__(self, filename, size, fps, codec="libx264", audiofile=None,
popen_params = {"stdout": DEVNULL,
"stderr": logfile,
"stdin": sp.PIPE}

# This was added so that no extra unwanted window opens on windows
# when the child process is created
if os.name == "nt":
Expand Down