Playing High Quality Movie

Epadder

Programmer
Game Developer
Oct 25, 2016
567
1,047
I just remembered that at one point I had trouble with Ren'py framerate performance with transforms running over images. Try adding this to your screens.rpy under screen preferences.
Code:
vbox:
    style_prefix "check"
    label _("Performance Mode")
    textbutton _("On") action Preference("gl powersave", True)
    textbutton _("Off") action Preference("gl powersave", False)
    textbutton _("Automatic") action Preference("gl powersave", "auto")
It would make the preference section look like this:
Code:
## Preferences screen ##########################################################
##
## The preferences screen allows the player to configure the game to better suit
## themselves.
##
## https://www.renpy.org/doc/html/screen_special.html#preferences

screen preferences():

    tag menu

    use game_menu(_("Preferences"), scroll="viewport"):

        vbox:

            hbox:
                box_wrap True

                if renpy.variant("pc"):

                    vbox:
                        style_prefix "radio"
                        label _("Display")
                        textbutton _("Window") action Preference("display", "window")
                        textbutton _("Fullscreen") action Preference("display", "fullscreen")
                    vbox:
                        style_prefix "check"
                        label _("Performance Mode")
                        textbutton _("On") action Preference("gl powersave", True)
                        textbutton _("Off") action Preference("gl powersave", False)
                        textbutton _("Automatic") action Preference("gl powersave", "auto")

                vbox:
                    style_prefix "radio"
                    label _("Rollback Side")
                    textbutton _("Disable") action Preference("rollback side", "disable")
                    textbutton _("Left") action Preference("rollback side", "left")
                    textbutton _("Right") action Preference("rollback side", "right")

                vbox:
                    style_prefix "check"
                    label _("Skip")
                    textbutton _("Unseen Text") action Preference("skip", "toggle")
                    textbutton _("After Choices") action Preference("after choices", "toggle")
                    textbutton _("Transitions") action InvertSelected(Preference("transitions", "toggle"))

                ## Additional vboxes of type "radio_pref" or "check_pref" can be
                ## added here, to add additional creator-defined preferences.

            null height (4 * gui.pref_spacing)

            hbox:
                style_prefix "slider"
                box_wrap True

                vbox:

                    label _("Text Speed")

                    bar value Preference("text speed")

                    label _("Auto-Forward Time")

                    bar value Preference("auto-forward time")

                vbox:

                    if config.has_music:
                        label _("Music Volume")

                        hbox:
                            bar value Preference("music volume")

                    if config.has_sound:

                        label _("Sound Volume")

                        hbox:
                            bar value Preference("sound volume")

                            if config.sample_sound:
                                textbutton _("Test") action Play("sound", config.sample_sound)


                    if config.has_voice:
                        label _("Voice Volume")

                        hbox:
                            bar value Preference("voice volume")

                            if config.sample_voice:
                                textbutton _("Test") action Play("voice", config.sample_voice)

                    if config.has_music or config.has_sound or config.has_voice:
                        null height gui.pref_spacing

                        textbutton _("Mute All"):
                            action Preference("all mute", "toggle")
                            style "mute_all_button"


style pref_label is gui_label
style pref_label_text is gui_label_text
style pref_vbox is vbox

style radio_label is pref_label
style radio_label_text is pref_label_text
style radio_button is gui_button
style radio_button_text is gui_button_text
style radio_vbox is pref_vbox

style check_label is pref_label
style check_label_text is pref_label_text
style check_button is gui_button
style check_button_text is gui_button_text
style check_vbox is pref_vbox

style slider_label is pref_label
style slider_label_text is pref_label_text
style slider_slider is gui_slider
style slider_button is gui_button
style slider_button_text is gui_button_text
style slider_pref_vbox is pref_vbox

style mute_all_button is check_button
style mute_all_button_text is check_button_text

style pref_label:
    top_margin gui.pref_spacing
    bottom_margin 3

style pref_label_text:
    yalign 1.0

style pref_vbox:
    xsize 338

style radio_vbox:
    spacing gui.pref_button_spacing

style radio_button:
    properties gui.button_properties("radio_button")
    foreground "gui/button/check_[prefix_]foreground.png"

style radio_button_text:
    properties gui.button_text_properties("radio_button")

style check_vbox:
    spacing gui.pref_button_spacing

style check_button:
    properties gui.button_properties("check_button")
    foreground "gui/button/check_[prefix_]foreground.png"

style check_button_text:
    properties gui.button_text_properties("check_button")

style slider_slider:
    xsize 525

style slider_button:
    properties gui.button_properties("slider_button")
    yalign 0.5
    left_margin 15

style slider_button_text:
    properties gui.button_text_properties("slider_button")

style slider_vbox:
    xsize 675
If your project is automatically in Performance mode try changing it to off and seeing if that gets rid of the lag, to force it to always off add this somewhere in the project.
Code:
default preferences.gl_powersave = False
 

AlphaBubble

Newbie
Dec 29, 2017
52
22
I just remembered that at one point I had trouble with Ren'py framerate performance with transforms running over images. Try adding this to your screens.rpy under screen preferences.
Code:
vbox:
    style_prefix "check"
    label _("Performance Mode")
    textbutton _("On") action Preference("gl powersave", True)
    textbutton _("Off") action Preference("gl powersave", False)
    textbutton _("Automatic") action Preference("gl powersave", "auto")
It would make the preference section look like this:
Code:
## Preferences screen ##########################################################
##
## The preferences screen allows the player to configure the game to better suit
## themselves.
##
## https://www.renpy.org/doc/html/screen_special.html#preferences

screen preferences():

    tag menu

    use game_menu(_("Preferences"), scroll="viewport"):

        vbox:

            hbox:
                box_wrap True

                if renpy.variant("pc"):

                    vbox:
                        style_prefix "radio"
                        label _("Display")
                        textbutton _("Window") action Preference("display", "window")
                        textbutton _("Fullscreen") action Preference("display", "fullscreen")
                    vbox:
                        style_prefix "check"
                        label _("Performance Mode")
                        textbutton _("On") action Preference("gl powersave", True)
                        textbutton _("Off") action Preference("gl powersave", False)
                        textbutton _("Automatic") action Preference("gl powersave", "auto")

                vbox:
                    style_prefix "radio"
                    label _("Rollback Side")
                    textbutton _("Disable") action Preference("rollback side", "disable")
                    textbutton _("Left") action Preference("rollback side", "left")
                    textbutton _("Right") action Preference("rollback side", "right")

                vbox:
                    style_prefix "check"
                    label _("Skip")
                    textbutton _("Unseen Text") action Preference("skip", "toggle")
                    textbutton _("After Choices") action Preference("after choices", "toggle")
                    textbutton _("Transitions") action InvertSelected(Preference("transitions", "toggle"))

                ## Additional vboxes of type "radio_pref" or "check_pref" can be
                ## added here, to add additional creator-defined preferences.

            null height (4 * gui.pref_spacing)

            hbox:
                style_prefix "slider"
                box_wrap True

                vbox:

                    label _("Text Speed")

                    bar value Preference("text speed")

                    label _("Auto-Forward Time")

                    bar value Preference("auto-forward time")

                vbox:

                    if config.has_music:
                        label _("Music Volume")

                        hbox:
                            bar value Preference("music volume")

                    if config.has_sound:

                        label _("Sound Volume")

                        hbox:
                            bar value Preference("sound volume")

                            if config.sample_sound:
                                textbutton _("Test") action Play("sound", config.sample_sound)


                    if config.has_voice:
                        label _("Voice Volume")

                        hbox:
                            bar value Preference("voice volume")

                            if config.sample_voice:
                                textbutton _("Test") action Play("voice", config.sample_voice)

                    if config.has_music or config.has_sound or config.has_voice:
                        null height gui.pref_spacing

                        textbutton _("Mute All"):
                            action Preference("all mute", "toggle")
                            style "mute_all_button"


style pref_label is gui_label
style pref_label_text is gui_label_text
style pref_vbox is vbox

style radio_label is pref_label
style radio_label_text is pref_label_text
style radio_button is gui_button
style radio_button_text is gui_button_text
style radio_vbox is pref_vbox

style check_label is pref_label
style check_label_text is pref_label_text
style check_button is gui_button
style check_button_text is gui_button_text
style check_vbox is pref_vbox

style slider_label is pref_label
style slider_label_text is pref_label_text
style slider_slider is gui_slider
style slider_button is gui_button
style slider_button_text is gui_button_text
style slider_pref_vbox is pref_vbox

style mute_all_button is check_button
style mute_all_button_text is check_button_text

style pref_label:
    top_margin gui.pref_spacing
    bottom_margin 3

style pref_label_text:
    yalign 1.0

style pref_vbox:
    xsize 338

style radio_vbox:
    spacing gui.pref_button_spacing

style radio_button:
    properties gui.button_properties("radio_button")
    foreground "gui/button/check_[prefix_]foreground.png"

style radio_button_text:
    properties gui.button_text_properties("radio_button")

style check_vbox:
    spacing gui.pref_button_spacing

style check_button:
    properties gui.button_properties("check_button")
    foreground "gui/button/check_[prefix_]foreground.png"

style check_button_text:
    properties gui.button_text_properties("check_button")

style slider_slider:
    xsize 525

style slider_button:
    properties gui.button_properties("slider_button")
    yalign 0.5
    left_margin 15

style slider_button_text:
    properties gui.button_text_properties("slider_button")

style slider_vbox:
    xsize 675
If your project is automatically in Performance mode try changing it to off and seeing if that gets rid of the lag, to force it to always off add this somewhere in the project.
Code:
default preferences.gl_powersave = False
I copied it into sreens.rpy but nothing seems to change :(
The video is still laggy at the start. But thank you!
 

Epadder

Programmer
Game Developer
Oct 25, 2016
567
1,047
Um hmmm, even going into the options and changing the performance mode doesn't do anything? You do have do that, the code only creates a convenient way to switch between "on" "off" "auto".
 

Epadder

Programmer
Game Developer
Oct 25, 2016
567
1,047
When you launch the game go to "Preferences", and there you should see a section that says "Performance Mode" and underneath you can then choose to change what is is set to by clicking one of the non-selected options.

I added it to a test project and mine looks like:
ss-pref.jpg

Your color scheme may be different.
 

Epadder

Programmer
Game Developer
Oct 25, 2016
567
1,047
Well I don't have any more thoughts then if turning Performance Mode off/automatic didn't help.

Maybe try the official Ren'py forums: .

If the crash doesn't involve sexual activity you could ask about it in the general ren'py questions section, there is an adult section on the forums I know it takes 24 hours to get access to it...

I think you have to set an age above 18 on your profile and it becomes active... it's been like 3 months since I did it so I don't exactly remember.
 

Fantomax

"Ares Revenge" game developper
Game Developer
Oct 30, 2017
77
110
Hi everyone,

i'm exactly in the same case scenario, just like Mister AlphaBubble


i've tried 3 differents methods :

1) play movie "video/test.mp4"
$ renpy.pause(6, hard=True)
stop movie

2) image video_1 = Movie(size=(1920, 1080), channel="movie", play="video/test.mp4")
# this upper line is in the first main settings script.rpy

show video_1
pause 6

3) $ renpy.movie_cutscene("/video/test.mp4",6,0)

as i guessed my codec was initially the H264, then i did try to convert it in a .mov file with the codec VP9
the video is 24 FPS duration 5.2 seconds for 120 frames

1) play movie "video/test.mov"
$ renpy.pause(6, hard=True)
stop movie

2) image video_1 = Movie(size=(1920, 1080), channel="movie", play="video/test.mov")
# this upper line is in the first main settings script.rpy

show video_1
pause 6
3) $ renpy.movie_cutscene("/video/test.mov",6,0)


as a result in every cases tested, i'm just having a 6 seconds pause in Ren'Py and no video display at all.

here is below a gdrive link to the video if anyone has a solution for my issue, i'll be very grateful.



I can't tell how many hours i've lost already with this issue, which is really a big pain in my ass (lol just wath the file)...

Otherwise i'll abort the idea of adding this kind of movie files in Ren'Py ...

Many thanks by advance to those who would take some time to help me.

King Regards.
 
Last edited:

MissFortune

I Was Once, Possibly, Maybe, Perhaps… A Harem King
Respected User
Game Developer
Aug 17, 2019
4,470
7,341
Holy necro.

2) image video_1 = Movie(size=(1920, 1080), channel="movie", play="video/test.mp4")
# this upper line is in the first main settings script.rpy
This is closest to the right way. Your issue here is MP4. It just doesn't work well with Ren'py, or it's finnicky at best. WebM with VP8 or VP9 are going to give you the best result.

I basically show the entire process here.
 
  • Red Heart
Reactions: Fantomax

Fantomax

"Ares Revenge" game developper
Game Developer
Oct 30, 2017
77
110
i'll try to convert it in a webm file with VP8 or VP9 and let you know about my results.

Thank you Miss :-*
 

Fantomax

"Ares Revenge" game developper
Game Developer
Oct 30, 2017
77
110
I've been using HandBrake to convert the file and it's working now just fine, you really are a life saver Miss.
You did my Day, i owe you one ;)
 
  • Like
Reactions: MissFortune

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,103
14,752
Your issue here is MP4. It just doesn't work well with Ren'py, or it's finnicky at best.
More precisely, MP4 is both a container and a video codec. When the container host a MPEG-1 or MPEG-2 video, there's no issue. When it host a MPEG-4 video it depend on the variation, and when it host a video encoded with another codec, it will not works.
This while the other supported containers only host a really small range of codecs, all supported by Ren'Py.