Ren'Py Error with the end of the videos

Racker6

New Member
Jul 21, 2018
4
7
At the end of a movie, the previous scene is displayed for a short time until the next scene begins.

This is the code I'm using to play the video. I also tried $ renpy.movie_cutscene and the same thing happened to me.

Code:
        image movie = Movie(size=(1920, 1080), xpos=0, ypos=0, xanchor=0, yanchor=0)
 
        scene image 1
        with fade
        $ renpy.pause ()

        play movie "animaciones/dance test.webm" loop
        show movie with fade
        $ renpy.pause ()
        hide movie with fade
        stop movie

        scene image 2
        with fade
        $ renpy.pause ()
Attach a gif to visualize what is happening to me.

Sorry for my bad english. Thanks
 

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,548
Its the with fade I think, if there is a way around it or it's a renpy thing I don't know. Remove the with fade and see if it's right.
 
  • Like
Reactions: Racker6

the66

beware, the germans are cumming
Modder
Donor
Respected User
Jan 27, 2017
7,668
23,783
try this:
Python:
image dance test = Movie(play="animaciones/dance test.webm", start_image="the 1st frame of your movie.png", image="the last frame of your movie.png")

label whatever:
    scene image 1
    with fade
    $ renpy.pause()

    show dance test with fade
    $ renpy.pause()

    scene image 2
    with fade
    $ renpy.pause()
i know, it's more work to define your movie displayables, but you will no longer have glitches at the start/end of your movies.
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
At the end of a movie, the previous scene is displayed for a short time until the next scene begins.
the66 has given you code that will fix this, but I wanted to explain WHY it was happening, just so you understand.

Code:
        scene image 1
        with fade
        $ renpy.pause ()
This code creates a background image, and then, as you know, waits for an interaction from the user.

Code:
        play movie "animaciones/dance test.webm" loop
        show movie with fade
        $ renpy.pause ()
        hide movie with fade
        stop movie
Since this uses "show", it displays the movie on top of the previous background image. The previous background image isn't replaced.

[CODE
scene image 2
with fade
$ renpy.pause ()
[/CODE]

This code then sets up the new background image. So, what was happening, was that when the movie was being taken off the screen, for a brief instant, the original background image was now the thing visible until Ren'py got to the point that it could replace it with the new one.

One possible improvement on the66 's code would be to do this:
Code:
image dance test = Movie(play="animaciones/dance test.webm", start_image="the 1st frame of your movie.png", image="the last frame of your movie.png")

label whatever:
    scene image 1
    with fade
    $ renpy.pause()

    scene dance test with fade
    $ renpy.pause()

    scene image 2
    with fade
    $ renpy.pause()
Note that I've changed the "show dance test" to "scene dance test". In this case, the movie (which is defined as an image) actually replaces the original background, rather than overlaying it. If you do this, you definitely want to include the "start_image" attribute on your movie. Otherwise, since it takes Ren'py a few frames to get a movie playing, you'll see a brief flicker of "nothing on the screen". (With the "show" approach, this isn't noticeable, because the previous background is still there.)

The "image" attribute (last frame of the movie) isn't as important if you have a looping movie, but it's critical if you have a "play it once through and then stop" movie (by setting "loop=False") since you need to have something to "leave behind" when the movie stops playing.
 

Racker6

New Member
Jul 21, 2018
4
7
Its the with fade I think, if there is a way around it or it's a renpy thing I don't know. Remove the with fade and see if it's right.
That didn't work, thanks anyway.

try this:
Python:
image dance test = Movie(play="animaciones/dance test.webm", start_image="the 1st frame of your movie.png", image="the last frame of your movie.png")

label whatever:
    scene image 1
    with fade
    $ renpy.pause()

    show dance test with fade
    $ renpy.pause()

    scene image 2
    with fade
    $ renpy.pause()
i know, it's more work to define your movie displayables, but you will no longer have glitches at the start/end of your movies.
That worked! thanks

the66 has given you code that will fix this, but I wanted to explain WHY it was happening, just so you understand.

Code:
        scene image 1
        with fade
        $ renpy.pause ()
This code creates a background image, and then, as you know, waits for an interaction from the user.

Code:
        play movie "animaciones/dance test.webm" loop
        show movie with fade
        $ renpy.pause ()
        hide movie with fade
        stop movie
Since this uses "show", it displays the movie on top of the previous background image. The previous background image isn't replaced.

[CODE
scene image 2
with fade
$ renpy.pause ()
[/CODE]

This code then sets up the new background image. So, what was happening, was that when the movie was being taken off the screen, for a brief instant, the original background image was now the thing visible until Ren'py got to the point that it could replace it with the new one.

One possible improvement on the66 's code would be to do this:
Code:
image dance test = Movie(play="animaciones/dance test.webm", start_image="the 1st frame of your movie.png", image="the last frame of your movie.png")

label whatever:
    scene image 1
    with fade
    $ renpy.pause()

    scene dance test with fade
    $ renpy.pause()

    scene image 2
    with fade
    $ renpy.pause()
Note that I've changed the "show dance test" to "scene dance test". In this case, the movie (which is defined as an image) actually replaces the original background, rather than overlaying it. If you do this, you definitely want to include the "start_image" attribute on your movie. Otherwise, since it takes Ren'py a few frames to get a movie playing, you'll see a brief flicker of "nothing on the screen". (With the "show" approach, this isn't noticeable, because the previous background is still there.)

The "image" attribute (last frame of the movie) isn't as important if you have a looping movie, but it's critical if you have a "play it once through and then stop" movie (by setting "loop=False") since you need to have something to "leave behind" when the movie stops playing.
Thanks for the explanation!