Skip to content

Commit ac0b096

Browse files
API
1 parent 190d1b8 commit ac0b096

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

surfer/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ def ffmpeg(dst, frame_path, framerate=10, codec='mpeg4', opt="", inopt="",
662662
added. If the file already exists it is overwritten.
663663
frame_path : str
664664
Path to the source frames (with a frame number field like '%04d').
665-
framerate : int
665+
framerate : float
666666
Framerate of the movie (frames per second).
667667
codec : str
668668
Codec to use (default 'mpeg4').

surfer/viz.py

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,22 +2064,22 @@ def save_montage(self, filename, order=['lat', 'ven', 'med'],
20642064
cb.visible = colorbars_visibility[cb]
20652065
return out
20662066

2067-
def save_movie(self, dst, tstart=None, tstop=None, step=None,
2067+
def save_movie(self, fname, tstart=None, tstop=None, step=1,
20682068
time_idx=None, montage='current', orientation='h',
20692069
border_size=15, colorbar='auto', framerate=10,
2070-
codec='mpeg4', row=-1, col=-1, movie_tool='ffmpeg'):
2070+
codec='mpeg4', row=-1, col=-1):
20712071
"""Save a movie (for data with a time axis)
20722072
20732073
Parameters
20742074
----------
2075-
dst : str
2076-
Path at which to sae the movie.
2075+
fname : str
2076+
Path at which to save the movie.
20772077
tstart : None | float
20782078
First time point to include (default: all data).
20792079
tstop : None | float
20802080
Time point at which to stop the movie (exclusive; default: all
20812081
data).
2082-
step : None | int
2082+
step : int
20832083
Number of data frames to step forward between movie frames
20842084
(default 1).
20852085
time_idx : None | array
@@ -2100,27 +2100,20 @@ def save_movie(self, dst, tstart=None, tstop=None, step=None,
21002100
if None no colorbar is visible. If 'auto' is given the colorbar
21012101
is only shown in the middle view. Otherwise on the listed
21022102
views when a list of int is passed.
2103-
framerate : int
2103+
framerate : float
21042104
Framerate of the movie (frames per second).
21052105
codec : str
21062106
Codec to use (default 'mpeg4').
21072107
row : int
21082108
row index of the brain to use
21092109
col : int
21102110
column index of the brain to use
2111-
movie_tool : 'ffmpeg'
2112-
Tool to use to convert image sequence into a movie (default:
2113-
'ffmpeg').
21142111
"""
2115-
if movie_tool.lower() == 'ffmpeg':
2116-
if not has_ffmpeg():
2117-
err = ("FFmpeg is not in the path and is needed for saving "
2118-
"movies. Install FFmpeg and try again. It can be "
2119-
"downlaoded from http://ffmpeg.org/download.html.")
2120-
raise RuntimeError(err)
2121-
else:
2122-
err = "Currently the only possible movie tool is FFmpeg"
2123-
raise ValueError(err)
2112+
if not has_ffmpeg():
2113+
err = ("FFmpeg is needed for saving movies and was not found in "
2114+
"the path. Install FFmpeg and try again. It can be "
2115+
"downlaoded from http://ffmpeg.org/download.html.")
2116+
raise RuntimeError(err)
21242117

21252118
if tstart is not None:
21262119
start = self.index_for_time(tstart, rounding='up')
@@ -2152,7 +2145,7 @@ def save_movie(self, dst, tstart=None, tstop=None, step=None,
21522145
self.save_image_sequence(time_idx, fname_pattern, False, row,
21532146
col, montage, orientation, border_size,
21542147
colorbar)
2155-
ffmpeg(dst, fname_pattern, framerate, codec)
2148+
ffmpeg(fname, fname_pattern, framerate, codec)
21562149

21572150
def animate(self, views, n_steps=180., fname=None, use_cache=False,
21582151
row=-1, col=-1):

0 commit comments

Comments
 (0)