Half a second of a checkerboard screen before the video starts...

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
withtheknife
Newbie
Posts: 7
Joined: Mon Mar 04, 2024 10:29 pm
itch: indentation
Contact:

Half a second of a checkerboard screen before the video starts...

#1 Post by withtheknife »

I want to use a video as a background, but it doesn't seem to be working!

What the code looks like:

------------------------

image movie = Movie(channel="bg-placeholder4", play="images/bg-placeholder4.ogv", size=(1920, 1080), loop=True)
[irrelavant code]

scene movie

play music "audio/user melancholy - somber.mp3" fadein 1.0 volume 1

h "uuh. the uuh"


-------------
Instead of playing the video "bg-placeholder4.ogv", instantly, a gray checkerboard appears for a split second.

Image

What am I doing wrong?

Thanks :^)

EDIT: I copied the code from this solution: (https://www.reddit.com/r/RenPy/comments ... ansparent/), but there is still half a second of a checkerboard screen before it displays the video.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2405
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Half a second of a checkerboard screen before the video starts...

#2 Post by Ocelot »

What you wrote is equivalent to:

Code: Select all

# scene something is just a shortcut for writing both scene and show statement.
scene # clears screen
show movie # shows movie WHEN IT LOADS AND DECODES THE FIRST FRAME. Which might take time.
You can use scene black fowwlowed by show movie to show black screen before movie loads. Which technically isn't nessesary, because screen would be black after building the game for release anyway.
< < insert Rick Cook quote here > >

withtheknife
Newbie
Posts: 7
Joined: Mon Mar 04, 2024 10:29 pm
itch: indentation
Contact:

Re: Half a second of a checkerboard screen before the video starts...

#3 Post by withtheknife »

Ocelot wrote: Tue Mar 05, 2024 11:49 am What you wrote is equivalent to:

Code: Select all

# scene something is just a shortcut for writing both scene and show statement.
scene # clears screen
show movie # shows movie WHEN IT LOADS AND DECODES THE FIRST FRAME. Which might take time.
You can use scene black fowwlowed by show movie to show black screen before movie loads. Which technically isn't nessesary, because screen would be black after building the game for release anyway.
scene black makes it look less jarring, but I'd like the video to start as soon as the player advances. I don't want a black screen flash before every video. Is that possible? Thanks for the reply :^D

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2405
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Half a second of a checkerboard screen before the video starts...

#4 Post by Ocelot »

You can use a start_image parameter to provide an image which is shown after scene statement executesm but before video starts playing. If you use first frame of your video as that image, it might look better. Another way is only remove old images after movie starts playing.
< < insert Rick Cook quote here > >

withtheknife
Newbie
Posts: 7
Joined: Mon Mar 04, 2024 10:29 pm
itch: indentation
Contact:

Re: Half a second of a checkerboard screen before the video starts...

#5 Post by withtheknife »

Ocelot wrote: Tue Mar 05, 2024 12:45 pm You can use a start_image parameter to provide an image which is shown after scene statement executesm but before video starts playing. If you use first frame of your video as that image, it might look better. Another way is only remove old images after movie starts playing.
Thanks! How would these look as code?

This is what I tried. I noticed "spongeman" doesn't appear before the video, only a split second of black screen
-----------------------------------------------------
image movie = Movie(play="images/bg-placeholder4.ogv", image_start="spongeman")

[irrelevant code]

show movie

play music "audio/user melancholy - somber.mp3" fadein 1.0 volume 1

h "uuh. the uuh"
-----------------------------------------

withtheknife
Newbie
Posts: 7
Joined: Mon Mar 04, 2024 10:29 pm
itch: indentation
Contact:

Re: Half a second of a checkerboard screen before the video starts...

#6 Post by withtheknife »

withtheknife wrote: Tue Mar 05, 2024 12:54 pm
Ocelot wrote: Tue Mar 05, 2024 12:45 pm You can use a start_image parameter to provide an image which is shown after scene statement executesm but before video starts playing. If you use first frame of your video as that image, it might look better. Another way is only remove old images after movie starts playing.
Thanks! How would these look as code?

This is what I tried. I noticed "spongeman" doesn't appear before the video, only a split second of black screen
-----------------------------------------------------
image movie = Movie(play="images/bg-placeholder4.ogv", image_start="spongeman")

[irrelevant code]

show movie

play music "audio/user melancholy - somber.mp3" fadein 1.0 volume 1

h "uuh. the uuh"
-----------------------------------------
I'm.... dumb....

I wrote image_start instead of start_image.

I think that's it. That solves everything. Every time I add a video, I'll have to define both the movie and the start_image first, correct? So, in the end, I'll have a bunch of:

image scene1 = Movie(play="images/scene1.ogv", image_start="imgscene1")
image scene2 = Movie(play="images/scene2.ogv", image_start="imgscene2")
image scene3 = Movie(play="images/scene3.ogv", image_start="imgscene3")

Post Reply

Who is online

Users browsing this forum: No registered users