How to make video file from netlogo simulation?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to make video file from netlogo simulation?

bakiunal
Hello
I want to capture a netlogo simulation in a video file. Then I want to use this video file in a presentation. How can I make a video file from a netlogo simulation?
Thanks
Baki Ünal
Reply | Threaded
Open this post in threaded view
|

Re: How to make video file from netlogo simulation?

Bryan Head
You can use the built-in vid extension! See the documentation here:
https://ccl.northwestern.edu/netlogo/docs/vid.html

As a quick example, to record 100 ticks of your simulation, you can do:

vid:start-recorder
vid:record-view
repeat 100 [
  go
  vid:record-view
]
vid:save-recorder "my-movie.mp4"


Reply | Threaded
Open this post in threaded view
|

Re: How to make video file from netlogo simulation?

Steve Railsback
In reply to this post by bakiunal

Bryan's solution using the vid extension is good---except that this
extension does not work for many of us using Windows: it creates a video
file that does not play properly. (This was discussed somewhere in the
release notes, as I recall, as a problem not likely to be fixed soon.)

A reliable alternative (also mentioned on NetLogo's Stackoverflow site)
is to export the interface (or view) every tick and then use separate
software to turn the exported .png files into a movie.

Modifying Bryan's code, you can use this:

to make-a-movie
   setup
   repeat 100 [
     go
     export-interface (word "Frame" (10000 + ticks) ".png")
   ]
end

This will produce 100 files labeled Frame10001.png to Frame10100.png.

The software I use to assemble these .png files into a movie is GIF
Construction Set Professional--$30 at
http://www.mindworkshop.com/gifcon.html. You can figure it out in 5
minutes and make a movie in 3 minutes. You can control the movie's frame
rate, compress it to reduce file size, and save it as .gif, .avi, and
several other formats. Movies with 100s of frames do get cumbersome.

Steve R.
--
Steve Railsback
www.railsback-grimm-abm-book.com
Reply | Threaded
Open this post in threaded view
|

Re: How to make video file from netlogo simulation?

Ken Kahn-3
In reply to this post by bakiunal
I agree that at least on Windows machines following Steve's advice works
well. I've used it frequently with Microsoft's Movie Maker (recently
discontinued - was bundled with Windows 7). I see that very soon Microsoft
will be releasing a free replacement for Windows 10 -
https://www.pcworld.com/article/3196464/windows/hands-on-with-microsofts-story-remix-the-new-tool-to-make-your-photos-pop.html

And this way of making movies is very flexible - easy to customise.

Best,

-ken kahn