RimWorld

RimWorld

Progress Renderer
 This topic has been pinned, so it's probably important
Lanilor  [developer] Jul 31, 2018 @ 7:19am
How to create a gif or video with rendered images
There are various ways to convert images in gifs or videos with many programs. You can search on google how to do this with other programs that I don't use here.

Gif with GIMP
This is pretty simple:
  1. Open the first image in GIMP, then drag&drop all other images you want to add onto the plane to open them as layers. You can use both date/time and numbered renderings. They are already ordered corretly, so they should also be in the correct order after dragging them into gimp.
  2. Optinal: Rename layers that should show a different time in the gif. For example you want to animate your gif with 10 fps (so 100 ms for each image) but the first and last image should show a second. To do this, change the name of these image layers and add (1000ms) behind it.
  3. Now export it. Press [CTRL]+[Shift]+[E] or use the file menu. A window will open, choose a filename with the ending .gif and click "export".
  4. Another window will open. Activate the checkbox "as animation". Now you can set the delay between images (so inverse fps). A useful option to reduce filesize is to choose accumulated frame disposal in the dropdown below and check "Use disposal entered above for all frames".

You can also crop and rescale all images at once when opened in layers like described above.

Note that gifs quality is limited and they reach big file sizes pretty fast. Also loading many images in GIMP takes a lot memory or disk space if you don't have enough. (I crashed my laptop once when trying to open a long sequence of full size renderings and GIMP wanted to eat 19 gb memory).

Video with ffmpeg
Ffmpeg is a command line tool and as they say: "A complete, cross-platform solution to record, convert and stream audio and video" (https://www.ffmpeg.org/).
If you have consecutively numbered images (use the file name pattern option to get them easily), you can create a video out of them with a single command. Open the command line interface in the directory of your images or navigate there and use the following command. Replace the framerate and the output name with anything you want. Also replace "image-" (but not the "%06d.jpg") with the first part of the image names. Depending on your system you might also add a complete path to your ffmpeg installation if the command can't be found.
ffmpeg -framerate 10 -i image-%06d.jpg -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p output.mp4

An example for this might be:
c:\ffmpeg\bin\ffmpeg.exe -framerate 20 -i rimworld-interstellar-72363-%06d.jpg -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p output-video.mp4

Note that all images should have the same resolution. You may need to keep this in mind when using and changing render area limitations ingame.

Other useful commands:
// Crop video ffmpeg -i input.mp4 -filter:v "crop=out_w:out_h:x:y" out-crop.mp4 // Cut video ffmpeg -ss 00:00:30.0 -i input.mp4 -c copy -t 00:00:10.0 out-cut.mp4
Don't forget to replace the placeholders and settings with what you need. You can find more information about this and a lot more what you can do with ffmpeg on the above linked website.
< >
Showing 1-7 of 7 comments
TheDarkScale Sep 13, 2019 @ 6:21am 
thanks was so confused trying to get it to work
JonnyJaap Oct 7, 2019 @ 12:41pm 
Gif via gimp is a realy bad Idea :D
I got an gif that's 1.4 GB big, lol and it was 45(22 days) items with an total size of 380 MB.
JonnyJaap Oct 7, 2019 @ 12:49pm 
ffmpeg don't work for me, but that's prop because I do something wrong.
When the file is could "rimworld-interstalar-414604-5500-4-14-20.jpg", I use the commend : "ffmpeg -framerate 10 -i rimworld-interstalar-414604-5500-4-14-20%06.jpg -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p output.mp4" I'll get an error that file "rimworld-interstalar-414604-5500-4-14-20%06.jpg" dosn't exist.
Brodo #Swaggins Oct 9, 2019 @ 10:04am 
Here are my settings including cropping and scaling. Navigate to the screenshot folder in Powershell and run:

ls -Filter rimworld-archer-*.jpg | select -ExpandProperty name | sort | %{ "file '$_'" } | Out-File files.txt -Encoding ascii

ffmpeg.exe -r 5 -f concat -i files.txt -c:v libx265 -crf 20 -pix_fmt yuv420p -filter:v "crop=4000:3000:467:1732,scale=3840:2880" output.mp4

This creates a list of files in files.txt and renders it. Modify the "rimworld-archer" to whatever prefix your screenshots have. The numbers after "crop" are screenshot area width and height, followed by the top left corner position. Scale modifies the video to a 4:3 4k equivalent. Make sure the cropped area and scale resolution have the same ratio, otherwise it'll be deformed. Change the "-r" framerate to speed up or slow down the video.

I'm using more modern H.265 codec, use libx264 instead of libx265 if your player doesn't support it.
Last edited by Brodo #Swaggins; Oct 9, 2019 @ 10:05am
JonnyJaap Oct 13, 2019 @ 2:47am 
dosn't work for me. I found a command that works for me, I use "ffmpeg -pattern_type glob -i "*.jpg" -c:v libx265 -pix_fmt yuv420p -movflags +faststart -filter:v "crop=8800:8800:467:1732,scale=3840:2880" output.mp4".
Uuugggg Mar 4, 2021 @ 3:10pm 
2
EFX Mar 13, 2023 @ 8:36am 
Originally posted by Uuugggg:
There is a nice tool for this now : https://github.com/Epicguru/RimworldRender/releases/tag/Dev4

It still works, unfortunately looks abandoned :(
< >
Showing 1-7 of 7 comments
Per page: 1530 50