Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Video playback in Decker

A topic by Millie Squilly created Apr 26, 2023 Views: 406 Replies: 6
Viewing posts 1 to 4
(+2)


https://zine.kawaiiuguu.moe/videotest.html

I've managed to commit unspeakable acts in somehow getting Decker to play an appropriately converted video (or rather, playing a gif and a sound at the same time).

I kinda like the gritty aesthetic it has. I put some explanation about how to do it in the deck linked above.

(+1)

This is awesome!

Developer (1 edit)

This is unhinged, in the best way!

You might be able to get better image quality by using ffmpeg to explode the video into individual frames and then performing the dither on that batch of images using imagemagick, like I described elsewhere, before fusing them back together into a GIF.

I'm really looking forward to seeing where you go with this idea.

(+2)

I'm glad you approve of my unhingedness! I definitely have some experimenting to do in terms of getting the best results with dithering, I'll add imagemagick to the mental list of things to try out. Thanks for the advice!

(1 edit) (+1)


I had another try with a different video, I'm trying using ffmpeg to do the 1-bit video dither directly since this feels like a neater method. And I'm cropping to a more era-appropriate-feeling 4x3 aspect ratio. Also: there's optional subtitles now! https://zine.kawaiiuguu.moe/videotest2.html

Developer

That's really slick!

I have a  few thoughts on handling subtitles. In your script, you use an if-elseif chain to assign the values to your subtitle field:


This totally works, and is perhaps the most straightforward approach possible! One alternative Lil offers is to take advantage of the fact that conditionals are expressions to cut down on repetition, like so:


If none of the elseif clauses match, the implicit "else" will evaluate to the number 0. The "unless" operator returns its left hand side "unless" its right hand side is not 0, which lets us keep the field value the same unless there's a new caption available.

Another alternative would be to build a dictionary of captions keyed by their trigger frame and index into it:


Of course, what might be even better than defining a dictionary in a bunch of code could be to store it in a grid! By converting the caption dictionary into a CSV representation (including a header row naming our columns "f" and "c" respectively):

f,c
0,
46,"Hi, trying another"
72,"Decker video experiment."
117,"So, if all goes well,"
140,"this should be much better"
167,"video quality than the last time"
221,"and we should have subtitles!"
278,

We can make a grid widget called "subs" with column formats "is" to indicate we have an Integer column (i) followed by a String column (s):

And then build our dictionary by gluing together the "f" and "c" columns of that table using the "dict" operator:


Or, being slightly more verbose, we could even phrase that as a query if we wanted:


The grid widget storing this metadata can be made invisible or tucked away on a different card if desired.

All of these approaches have their merits, of course. The best script is the one that makes you happiest!

(+1)

Thanks! I'm still getting to grips with Lil so tips like this are useful. It's been a while since I've done much actual programming tbh