How do I create a GIF from an emulator?

Y'know, other stuff, Sinclair related.
Post Reply
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

How do I create a GIF from an emulator?

Post by dfzx »

I see people on here occasionally post an inline image to an animated GIF file showing a short sequence from a Spectrum emulator. How do you create such a thing? I managed to get an AVI out of Fuse and its associated utilities for uploading to Youtube, but I couldn't figure out how to make an animated GIF of a Spectrum screen.
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: How do I create a GIF from an emulator?

Post by Ast A. Moore »

Some emulators—zxsp, for instance—create animated GIFs by default. If that’s not your cup of raktajino, you could use something like this.
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
bob_fossil
Manic Miner
Posts: 654
Joined: Mon Nov 13, 2017 6:09 pm

Re: How do I create a GIF from an emulator?

Post by bob_fossil »

ffmpeg can convert a video to a gif, though you might end up with a gif containing video compression artefacts depending on the codec used to create the original video. I managed to create an animated gif using SpecEmu's .bmp dump option (Recording menu, Video sub menu). This dumps every frame to a .bmp file. You can then use something like Image Magick to glue all the generated .bmps into an animated gif. That's how I managed to create this:

Image
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: How do I create a GIF from an emulator?

Post by dfzx »

Yes, I tried to convert the FMF file Fuse produces to an AVI, then break that into frames, but the compression had left severe artifacts and the result was horrible. But it looks like fmfconv will create a folder full of PNGs with no compression, so that's probably the way to go. I'll give that a try. :)
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
namco
Manic Miner
Posts: 247
Joined: Mon Dec 04, 2017 8:55 pm

Re: How do I create a GIF from an emulator?

Post by namco »

Gifcam can be useful for that:
http://blog.bahraniapps.com/gifcam/
serbalgi
Drutt
Posts: 27
Joined: Sat Jan 06, 2018 11:13 am

Re: How do I create a GIF from an emulator?

Post by serbalgi »

dfzx wrote: Sat Jan 06, 2018 11:16 am Yes, I tried to convert the FMF file Fuse produces to an AVI, then break that into frames, but the compression had left severe artifacts and the result was horrible. But it looks like fmfconv will create a folder full of PNGs with no compression, so that's probably the way to go. I'll give that a try. :)
The fmfconv manual explains a way to convert to animated GIF (25 fps) using ImageMagick:

Code: Select all

fmfconv -f 25 input.fmf tmp.png
convert -delay 4 -loop 0 -layers removeDups -layers Optimize tmp*.png output.gif
SPIN also supports animated GIFs.
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: How do I create a GIF from an emulator?

Post by R-Tape »

ZX SPIN is great for this purpose:

In ZX SPIN (I'm using 0.666) select recording > video > configure output and select animated gif, you will also need to link to a .GIF file in the filename part. I don't know why GIFs animate and other filetypes don't.

Set up the spectrum to do whatever you want.

Then when you're ready select recording > video > start recording and leave until you're ready to select stop from the same place.
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: How do I create a GIF from an emulator?

Post by dfzx »

serbalgi wrote: Sat Jan 06, 2018 11:20 am The fmfconv manual explains a way to convert to animated GIF (25 fps) using ImageMagick:

Code: Select all

fmfconv -f 25 input.fmf tmp.png
convert -delay 4 -loop 0 -layers removeDups -layers Optimize tmp*.png output.gif
SPIN also supports animated GIFs.
:lol: , RTFM why don't I? In my defence, I was reading the fmfconv help text, which doesn't offer the examples section.

Thanks for that!
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: How do I create a GIF from an emulator?

Post by dfzx »

Thanks for all the suggestions. Turns out that the Fuse utils already do it. You just need to read the chuffin' documentation. :)
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
Post Reply