@@ -119,11 +119,16 @@ The plotting is identical as in [`abmplot`](@ref) and applicable keywords are pr
119119* `showstep = true`: If current step should be shown in title.
120120* `figure = NamedTuple()`: Figure related keywords (e.g. resolution, backgroundcolor).
121121* `axis = NamedTuple()`: Axis related keywords (e.g. aspect).
122+ * `recordkwargs = NamedTuple()`: Keyword arguments given to `Makie.record`.
123+ You can use `(compression = 1, profile = "high")` for a higher quality output,
124+ and prefer the `CairoMakie` backend.
125+ (compression 0 results in videos that are not playable by some software)
122126* `kwargs...`: All other keywords are propagated to [`abmplot`](@ref).
123127"""
124128function abmvideo (file, model, agent_step!, model_step! = Agents. dummystep;
125129 spf = 1 , framerate = 30 , frames = 300 , title = " " , showstep = true ,
126- figure = (resolution = (600 , 600 ),), axis = NamedTuple (), kwargs...
130+ figure = (resolution = (600 , 600 ),), axis = NamedTuple (),
131+ recordkwargs = (compression = 20 ,), kwargs...
127132 )
128133 # add some title stuff
129134 s = Observable (0 ) # counter of current step
@@ -141,7 +146,7 @@ function abmvideo(file, model, agent_step!, model_step! = Agents.dummystep;
141146
142147 resize_to_layout! (fig)
143148
144- record (fig, file; framerate) do io
149+ record (fig, file; framerate, recordkwargs ... ) do io
145150 for j in 1 : frames- 1
146151 recordframe! (io)
147152 Agents. step! (abmobs, spf)
0 commit comments