Have a .webM video on the Main Menu? *solved*

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
SquittenKitten
Newbie
Posts: 16
Joined: Wed Jul 17, 2019 8:51 am
Contact:

Have a .webM video on the Main Menu? *solved*

#1 Post by SquittenKitten » Wed Jul 17, 2019 8:57 am

Hello,

I'm trying to put a .webM video that is repeating as the background of the Main Menu.

I've tried

Code: Select all

define gui.main_menu_background = "gui/Intro Animations/Intro.webm"
but it says that this image format is not supported. Probably because it isn't an image :shock:

Any way I can make this work?

Thanks :oops:

Edit: Nevermind, I found the solution here viewtopic.php?f=8&t=47552#p474525
Last edited by SquittenKitten on Thu Jul 18, 2019 4:12 am, edited 3 times in total.

rames44
Veteran
Posts: 232
Joined: Sun May 29, 2016 4:38 pm
Contact:

Re: Have a .webM video on the Main Menu?

#2 Post by rames44 » Wed Jul 17, 2019 12:00 pm

Create an “image” using the Movie() class, then use that.

SquittenKitten
Newbie
Posts: 16
Joined: Wed Jul 17, 2019 8:51 am
Contact:

Re: Have a .webM video on the Main Menu?

#3 Post by SquittenKitten » Wed Jul 17, 2019 12:22 pm

ok, I have it like this now

Code: Select all

define gui.main_menu_background =  Movie()
image movie = Movie()
with Pause(1)

play movie "/intro/menubackground.ogv" loop
show movie with dissolve

hide movie with dissolve
stop movie
but it won't show up and all I see is a black screen.

User avatar
Andredron
Miko-Class Veteran
Posts: 535
Joined: Thu Dec 28, 2017 2:37 pm
Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
Location: Russia
Contact:

Re: Have a .webM video on the Main Menu? *solved*

#4 Post by Andredron » Wed Jul 17, 2019 1:58 pm

SquittenKitten wrote:
Wed Jul 17, 2019 8:57 am
Hello,

I'm trying to put a .webM video that is repeating as the background of the Main Menu.

I've tried

Code: Select all

define gui.main_menu_background = "gui/Intro Animations/Intro.webm"
but it says that this image format is not supported. Probably because it isn't an image :shock:

Any way I can make this work?

Thanks :oops:

Edit: Nevermind, I found the solution here viewtopic.php?f=8&t=47552#p474525
Although in Russian, it is clear that yes how

I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Help me to register in QQ International

Honest Critique

SquittenKitten
Newbie
Posts: 16
Joined: Wed Jul 17, 2019 8:51 am
Contact:

Re: Have a .webM video on the Main Menu?

#5 Post by SquittenKitten » Wed Jul 17, 2019 2:28 pm

Thanks, I got it to work for Windows at least.

Though, when I build it for Android, I get this message on my phone:

https://i.imgur.com/uQdtylj.jpg

User avatar
Andredron
Miko-Class Veteran
Posts: 535
Joined: Thu Dec 28, 2017 2:37 pm
Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
Location: Russia
Contact:

Re: Have a .webM video on the Main Menu?

#6 Post by Andredron » Wed Jul 17, 2019 3:09 pm

SquittenKitten wrote:
Wed Jul 17, 2019 2:28 pm
Thanks, I got it to work for Windows at least.

Though, when I build it for Android, I get this message on my phone:

https://i.imgur.com/uQdtylj.jpg
As far as I remember, this method does not work on android. There you need to break video by frames, recode them into webp so that they take up less space. And prescribe through the animation. Crutch
I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Help me to register in QQ International

Honest Critique

User avatar
Andredron
Miko-Class Veteran
Posts: 535
Joined: Thu Dec 28, 2017 2:37 pm
Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
Location: Russia
Contact:

Re: Have a .webM video on the Main Menu?

#7 Post by Andredron » Wed Jul 17, 2019 3:27 pm

Video optimization for Android (maximum performance mode)

Additional programs: ffmpeg

To begin with, at the Ren'Py level we set the parameter "config.hw_video = True" in options.rpy, which includes the hardware video rendering mode.

Next comes the optimization of the video itself.
Using the ffmpeg command line, here is an example of a serious optimization:
ffmpeg -i video.mp4 -vcodec libvpx -b: v 3000k -deadline realtime -cpu-used 2 -vf scale = iw / 1.5: -1 -acodec libopus "video2.webm"
The same, but in the bat file (mass production):
for %% a IN (* .mp4) DO ffmpeg -i "%% a" -vcodec libvpx -b: v 3000k -deadline realtime -cpu-used 2 -vf scale = iw / 1.5: -1 -acodec libopus "% % ~ na2.webm"

And parse all the contents:
-i - incoming video
-vcodec libvpx - video codec. Since we have an android, the most productive will be vp8, that is, libvpx.
-b: v 3000k is the bit rate or relative stream rate. To improve performance, we put either as in youtube (720p = 4000k, 1080p = 8000k), or less.
-deadline realtime - set the video processing mode. Real-time results vary greatly from device to device, but performance increases.
-cpu-used 2 - the complexity of the cpu-decoding video. It can be in the range of values ​​from 0 to 5. Already from the 1st, a performance increase begins and up to 5 at the expense of quality damage.
-vf scale = iw / 1.5: -1 is an argument to scale 1920x1080 to 1280x720 and more along the same lines. Resolution plays a big role in decoding, so if you have a short story in FULL HD, then think twenty times if you want to make a separate version for android, so that the phones do not waste downscaling (video picture reduction)
-acodec libopus - audio codec. You can use libvorbis instead of libopus, but libopus will almost certainly weigh less, and it will provide less playback delay.
Well, the last write the output file - "video2.webm"

Android only full video on the entire screen displays.
I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Help me to register in QQ International

Honest Critique

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], span4ev