Slight delay when webm videos play, why?
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.
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.
Slight delay when webm videos play, why?
Hi, I'm having issues with loading videos into my game. The transition from image to video is not instant. There's about a half-second delay where the player sees a transparent background before the video starts. Is there some sort of optimization I need to do? I thought this was normal until I played other Ren'py games where the video playback was instant.
I convert all videos to webm and even the small ones under 1mb in size do this. Any ideas?
Thanks
I convert all videos to webm and even the small ones under 1mb in size do this. Any ideas?
Thanks
- isobellesophia
- Miko-Class Veteran
- Posts: 979
- Joined: Mon Jan 07, 2019 2:55 am
- Completed: None
- Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
- Organization: Friendly Teachers series
- Deviantart: SophBelle
- itch: Child Creation
- Location: Philippines, Mindanao
- Contact:
Re: Slight delay when webm videos play, why?
You might be adding alot of transitions before playing the video or something like that?
Showing the code will help.
Showing the code will help.
Re: Slight delay when webm videos play, why?
Movies have a start image property - if you set that to an image that matches the first frame of your video, that’ll display for a fraction of a second, then merge seamlessly into your video.
That’s the workaround. The underlying reason is that it takes Ren’py a few frames to get its video pipeline going.
That’s the workaround. The underlying reason is that it takes Ren’py a few frames to get its video pipeline going.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: Slight delay when webm videos play, why?
Alternatively, display a black image immediately before the video.
show black should work (black is already defined within renpy internals)
Naturally this won't work if you're trying to blend a scene into a movie.
show black should work (black is already defined within renpy internals)
Naturally this won't work if you're trying to blend a scene into a movie.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Re: Slight delay when webm videos play, why?
I figured out my issue. I've been using the following syntax for all my video animations this entire time.
I've now begun using the following syntax.
Now there is no delay before the start of the video.
Edit: Although I've spoken to some other Ren'Py users and they still use the Movie(play=) method without any issues.
I don't have any transitions or really any reason for there to be a delay using that first method. I'm thoroughly confused.
Edit 2: I was using instead of
Calling the video with show removes any delay in the beginning.
Code: Select all
image anim1 = Movie(play="/animation/anim1.webm", loop = True ) Code: Select all
$ renpy.movie_cutscene("/animation/anim_1.webm", loops = -1)Edit: Although I've spoken to some other Ren'Py users and they still use the Movie(play=) method without any issues.
I don't have any transitions or really any reason for there to be a delay using that first method. I'm thoroughly confused.
Edit 2: I was using
Code: Select all
scene anim1Code: Select all
show anim1- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: Slight delay when webm videos play, why?
The scene command uses a transform, Fade. (or Dissolve, I cannot remember which)
This may be why.
This may be why.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Re: Slight delay when webm videos play, why?
Hmm, that's interesting. Whatever transform is being used, it's not actually transforming from the previous scene. It just showed a checkered empty background for half a second before the video starts instantly.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: Slight delay when webm videos play, why?
That's what I meant.
If you had used an image, it would have taken 0.5 seconds to fade to the image. But opacity cannot be controlled on videos so you get half a second of completely invisible followed by completely visible.
If you had used an image, it would have taken 0.5 seconds to fade to the image. But opacity cannot be controlled on videos so you get half a second of completely invisible followed by completely visible.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Re: Slight delay when webm videos play, why?
Sorry, I'm still a bit confused. I've used scene for all my images or videos this entire time. There is no visible transformation between the images, certainly not the 0.5 seconds.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: Slight delay when webm videos play, why?
I'm not currently at a computer where I could copy code to show you from, but the old wiki states that the scene command uses the transition "dissolve"
https://www.renpy.org/wiki/renpy/doc/re ... enpy.scene
The documentation does not reflect this.
https://www.renpy.org/doc/html/displayi ... -statement
https://www.renpy.org/wiki/renpy/doc/re ... enpy.scene
The documentation does not reflect this.
https://www.renpy.org/doc/html/displayi ... -statement
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Re: Slight delay when webm videos play, why?
To the best of my knowledge, if you don’t put an explicit transition in, “scene” does not (or doesn’t any more) include a “dissolve” transition.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: Slight delay when webm videos play, why?
Was doing something completely unrelated and found the section of code I was referring to.
This is found in options.rpy around line 107 (freshly made options.rpy with an up to date renpy version)
the "scene" command makes the window hide and show, so this transform is applied to it.
You can confirm it is there by defining an image named "white"
and then adding this to your script (assuming your textbox is black)
You can make it more apparent by lengthening the default config.window_show_transition and config.window_hide_transition
Try 1 second.
This is found in options.rpy around line 107 (freshly made options.rpy with an up to date renpy version)
Code: Select all
define config.window_show_transition = Dissolve(.2)
define config.window_hide_transition = Dissolve(.2)
You can confirm it is there by defining an image named "white"
Code: Select all
image white = "#fff"
Code: Select all
scene white
pause
scene white
Try 1 second.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
-
rayminator
- Miko-Class Veteran
- Posts: 754
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: Slight delay when webm videos play, why?
you can try it this way
Code: Select all
image anim1 = Movie(channel="anim1", play="video/anim1.webm", start_image="Your_Image", image="Your_Image")
scene anim1
or
show anim1Who is online
Users browsing this forum: Bing [Bot], Google [Bot], span4ev


