Zurkei

Newbie
Nov 25, 2017
47
153
Here is the game converted for mp4, the html has also been updated to work with the mp4 files. I have not done anything more than minor testing but I don't expect you to run into any real bugs. The dev had regular webp mixed in with the animated webp, I know for sure that all the regular webp are still there. But my script converts all the webp img tags to mp4 video tags, I have gone changed the regular ones back to webp img tags but may have missed a couple lines of html so there may be a few broken images.

This change has brought the game down from 6GB to about 1.8GB which is much more reasonable.

v0.62
 

xanoss

Member
Game Developer
Jun 6, 2020
215
922
xanoss
Here is a simple widget you can use to add new videos.

Code:
<<widget vid>>
    <<set _path = "img/"+$args[0]+".mp4">>
    <<set _width = $args[1] ? $args[1] : 500>>

    <video autoplay @width=_width>
       <source @src=_path type="video/mp4">
    </video>
<</widget>>
To use this widget, make a new passage in Twine named widgets or something. Then add the tag widget at the top and then add the widget code in the passage.

Then, to add a video with path img/bathroom/gf/vid1.mp4 in a passage, just do like this: <<vid bathroom/gf/vid1>> and it will add the video with default width 500. If you want another width, just add the width: <<vid bathroom/gf/vid1 300>> Note that I'm adding img/ and .mp4 to the path in the widget.

If you use webm, you have to change .mp4 to .webm (and the type to video/webm)

And, if you convert all your old animated webp to mp4 or webm, it would be pretty easy to make a script that replaced your old webp in the passages with the mp4/webm videos using the widget, including the width you used.

Okay Thank you thats easy for me to understand! :) :) :)
 

xanoss

Member
Game Developer
Jun 6, 2020
215
922
Here is the game converted for mp4, the html has also been updated to work with the mp4 files. I have not done anything more than minor testing but I don't expect you to run into any real bugs. The dev had regular webp mixed in with the animated webp, I know for sure that all the regular webp are still there. But my script converts all the webp img tags to mp4 video tags, I have gone changed the regular ones back to webp img tags but may have missed a couple lines of html so there may be a few broken images.

This change has brought the game down from 6GB to about 1.8GB which is much more reasonable.

v0.62 MEGA
I’ll poke at the .62 version and see if I can do at least some basic changes to lower the size. I’m an amateur at video transcoding. If I find something decent, I can write out instructions or something like that (IE something like, download ffmpeg from here, create a file like this here with this code, and then do this).

More or less what I did for the Corrupt girlfriend with very basic settings was exactly that. Most of it I lifted from people who had already done it. Then I just let it run for a bit while it transcoded the large gifs (and I targeted only the gifs for Corrupt Girlfriend), then I did a basic find and replace for those files inside your code for the html file.

Pretty much to answer your question, I’d do it for free and share it here for others to say, yeah this works or try this setting to get better results. More or less, we all want the game to look the same but save our internet download time and our hard drive space.
Thank you both for the support! I still have no clue about any of this but Ill see If I can continue with this! The files get wonky because some I pull directly off the internet and some I download and convert myself
 

xanoss

Member
Game Developer
Jun 6, 2020
215
922
Here is the game converted for mp4, the html has also been updated to work with the mp4 files. I have not done anything more than minor testing but I don't expect you to run into any real bugs. The dev had regular webp mixed in with the animated webp, I know for sure that all the regular webp are still there. But my script converts all the webp img tags to mp4 video tags, I have gone changed the regular ones back to webp img tags but may have missed a couple lines of html so there may be a few broken images.

This change has brought the game down from 6GB to about 1.8GB which is much more reasonable.

v0.62 MEGA
Its works pretty good actually wierd bug with half the videos playing at like 1.25 or 1.5 times speed though? Its better than nothing for though for the people that cannot download the 6gb file.

and also unfortunately I have the latest update thats in development still in webp but this will still be a good optimized version for people that cannot play the game at all that wanted to try it.

Im def going to start using mp4 though thats so much lighter
 
  • Like
Reactions: Zurkei

Alcahest

Engaged Member
Donor
Game Developer
Jul 28, 2017
3,261
4,131
Its works pretty good actually wierd bug with half the videos playing at like 1.25 or 1.5 times speed though? Its better than nothing for though for the people that cannot download the 6gb file.

and also unfortunately I have the latest update thats in development still in webp but this will still be a good optimized version for people that cannot play the game at all that wanted to try it.

Im def going to start using mp4 though thats so much lighter
Another issue I see is that he used width 500 for all videos and no width at all for the webp that were non-animated. I know some of your webp had other widths, and no width at all would display it in full size I think. Not sure how much of a problem that will be.
 
  • Like
Reactions: Zurkei

Zurkei

Newbie
Nov 25, 2017
47
153
Its works pretty good actually wierd bug with half the videos playing at like 1.25 or 1.5 times speed though? Its better than nothing for though for the people that cannot download the 6gb file.

and also unfortunately I have the latest update thats in development still in webp but this will still be a good optimized version for people that cannot play the game at all that wanted to try it.

Im def going to start using mp4 though thats so much lighter
Ah, they had the wrong framerate, I will do another pass while I am at work today with the correct framerate.
As long as the next update is just what has been added then I will convert it as well, but probably won't provide conversions after that.

Another issue I see is that he used width 500 for all videos and no width at all for the webp that were non-animated. I know some of your webp had other widths, and no width at all would display it in full size I think. Not sure how much of a problem that will be.
Yup, honestly the html was more just meant to provide a working code/example for the dev and the users, not to be an exact replica but with mp4. I'll leave getting the way the dev wants it to look up to the dev.
 
  • Like
Reactions: Alcahest

xanoss

Member
Game Developer
Jun 6, 2020
215
922
Ah, they had the wrong framerate, I will do another pass while I am at work today with the correct framerate.
As long as the next update is just what has been added then I will convert it as well, but probably won't provide conversions after that.



Yup, honestly the html was more just meant to provide a working code/example for the dev and the users, not to be an exact replica but with mp4. I'll leave getting the way the dev wants it to look up to the dev.
Thank you! Ill work hard and finish up what I got for the latest update asap so I don't waste your time :)
 

xanoss

Member
Game Developer
Jun 6, 2020
215
922
Another issue I see is that he used width 500 for all videos and no width at all for the webp that were non-animated. I know some of your webp had other widths, and no width at all would display it in full size I think. Not sure how much of a problem that will be.
another interesting problem I cannot figure out, I got the video to loop but not autoplay.. I started rendering avc mp4s or whatever that was was a twine forum said to do. In the mean time I added the controls to the widget so u can press the play button until there is a solution
 

Alcahest

Engaged Member
Donor
Game Developer
Jul 28, 2017
3,261
4,131
The widget I showed you will autoplay it when I try. One thing to note is that if you load or refresh a passage with a video, videos will not autoplay. At least not for me on Chrome.
 

xanoss

Member
Game Developer
Jun 6, 2020
215
922
The widget I showed you will autoplay it when I try. One thing to note is that if you load or refresh a passage with a video, videos will not autoplay. At least not for me on Chrome.
okay Ill retry that
 

xanoss

Member
Game Developer
Jun 6, 2020
215
922
The widget I showed you will autoplay it when I try. One thing to note is that if you load or refresh a passage with a video, videos will not autoplay. At least not for me on Chrome.
I FIXED IT! I did read somthing about chrome not being able to autoplay videos not muted so between the autoplay and loop I added "muted" and its all good now!
 

Alcahest

Engaged Member
Donor
Game Developer
Jul 28, 2017
3,261
4,131
I FIXED IT! I did read somthing about chrome not being able to autoplay videos not muted so between the autoplay and loop I added "muted" and its all good now!
Ah yes, you're right. I had forgotten that's why. But again, that's only relevant for the case I mentioned, where you load or refresh a passage. As soon as the player interacts with the game, for instance clicks a button to a new passage, autoplay will work regardless of muted status. It's the same with playing just a soundclip. Won't work in Chrome until the player has interacted with the game. Incidentally, that's why I have a start screen with a quote from Nietzsche before showing the main menu. Because the main manu is playing an mp3, but it won't play if I load the main menu first, so I have the player interact by clicking away the quote, and then the main menu will play the track.
 
Apr 24, 2018
20
10
Ah, they had the wrong framerate, I will do another pass while I am at work today with the correct framerate.
As long as the next update is just what has been added then I will convert it as well, but probably won't provide conversions after that.



Yup, honestly the html was more just meant to provide a working code/example for the dev and the users, not to be an exact replica but with mp4. I'll leave getting the way the dev wants it to look up to the dev.

Yeah, you were right. forgot about that. That said, what are you using to convert? I was thinking of trying magick to grab the images to pipe into ffmpeg.
 

Zurkei

Newbie
Nov 25, 2017
47
153
Yeah, you were right. forgot about that. That said, what are you using to convert? I was thinking of trying magick to grab the images to pipe into ffmpeg.
I like HTML games so I built a python script that can do a bunch of stuff that can help devs. I've shared it with the Become Alpha dev when he first started. Will probably polish it up a bit more and post it in the tools section at some point.

1. Convert videos (supported types are webp, webm, gif, mp4, wmv) though webp, gif, and wmv are really only there to be converted to webm and mp4.
2. Cut MP4s and WEBMs video into set chunks (eg. Take a 30m porno and cut it into 180 10 second clips that you can then do with what you will. You choose the length)
3. Scan an html file for webp and gif img tags and then convert to video tags using mp4 or webm (though I haven't added much customization to that part yet.)

For WEBP to other formats I originally tried using ImageSequence from the PIL library to pipe the frames into ffmpeg but for whatever reason it would just end up generating a black video. So instead I use ImageSequence to save each frame into a tmp folder and then pass them into ffmpeg to encode. Though I might spend more time figuring out why the piping didn't work as this last passthrough took about 7 1/2 hours to convert each webp to mp4.
 

Squirrliens

Newbie
May 10, 2019
28
22
Here is the game converted for mp4, the html has also been updated to work with the mp4 files. I have not done anything more than minor testing but I don't expect you to run into any real bugs. The dev had regular webp mixed in with the animated webp, I know for sure that all the regular webp are still there. But my script converts all the webp img tags to mp4 video tags, I have gone changed the regular ones back to webp img tags but may have missed a couple lines of html so there may be a few broken images.

This change has brought the game down from 6GB to about 1.8GB which is much more reasonable.

v0.62 MEGA

Seems to work fine but every single gif/mp4 is super sped up. Looks like shit on some off them.
 
2.60 star(s) 26 Votes