this post was submitted on 17 Jul 2024
115 points (97.5% liked)

Canvas

2082 readers
1 users here now

Canvas — The Fediverse’s r/place


2024 Concluded!


Get a print!


Links

Timelapses

founded 1 year ago
MODERATORS
 

Small disclaimer this is from the txt log which is not exactly complete, there are few pixels missing here and there.

One second of the video is about 30 minutes of drawing (one frame contains 1 minute of drawing, 30 frames per second)

Also a little bit of bragging - couldn't resist the challenge and got this all glued together in Python! Which is obviously a valid tool for this considering the rich data processing ecosystem.
Well maybe except the video generation part... definitely except the video generation - Pyav - bindings for ffmpeg, are really badly documented, luckily they have at least good enough examples.

The short story of how:

  • little bit of python script to convert the txt log into csv
  • from csv to pandas, there I made a few cleaning passes to get the "format" just right (mainly dealing with the mod_fill action)
  • pyav, ffmpeg and the world of video - oh boy:
    • for each one minute of drawing data
    • replay them over the canvas (numpy RGB array)
    • embed/copy the canvas into the video frame (another ndarray)
    • (add the timestamp above the canvas - cv2)
    • invoke pyav magic to mux/append it into the video
    • hope that your numpy array slices, splices, "broadcasts", pyav codec options and stream configurations are correct. Otherwise, watch as you end up with 1GB+ of mp4 file - 3 hours to watch whole (1s/30fps) with really bad resolution or inverted/wrong colors:)

If anyone wants to tweak this or has ideas how to make this better just hit me up. Can also put the code somewhere if wanted.

What a wild ride ha!

top 5 comments
sorted by: hot top controversial new old
[–] [email protected] 10 points 2 months ago (1 children)

This is cool! Thanks for making it, as well as sharing the details. If you can be bothered with it, I'd really like to watch a peer tube video of the making of.

[–] [email protected] 8 points 2 months ago

Glad you liked it!

Now making a video about this... now that is a food for thought lol

[–] [email protected] 2 points 2 months ago
[–] [email protected] 2 points 2 months ago (1 children)

Could you provide the source code? Where did you get the txt log?

[–] [email protected] 3 points 2 months ago* (last edited 2 months ago)

The logs were provided by @grant here https://toast.ooo/post/4077161 but now that they released the (cleaner) database dump the post is edited with link to that instead.

I am now integrating the databse dump into these timelapse scripts so will up the source some time after I get that done.