[Solved] $ renpy.movie_cutscene() not playing .webm video?

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
User avatar
SelLi
Miko-Class Veteran
Posts: 549
Joined: Fri Apr 27, 2012 4:49 pm
Completed: The Silent Column Demo, Memory Mage
Projects: The Silent Column, A Lily from the Lightless Water, A Castle on an Island
Deviantart: SelLillianna
itch: SelLillianna
Location: Canada
Contact:

[Solved] $ renpy.movie_cutscene() not playing .webm video?

#1 Post by SelLi »

Hi there~ I seem to be having a problem using $ renpy.movie_cutscene() in my script to play a .webm video~?
As far as I understand, it does try to play the video - the game freezes when I get to that point and, when I click, the game continues on - just as if I clicked to skip through a cutscene. Also, when I remove the file I'm trying to play, and reload the script, it shows me an error, informing me that it can't find the file. So, it does seem that it's attempting to play the appropriate video. However, it doesn't play, despite it being a .webm file.

The file itself does seem to play fine, outside of Ren'Py. Perhaps there's an issue with the file that I'm unaware of? (I don't have much know-how when it comes to exporting videos in specific formats, or anything like that.) Maybe I could run it through a video converter, of some kind, to make it more 'proper,' and allow it play in Ren'Py? I'm not sure.

As for my code, it simply looks like this:

Code: Select all

"Here's some text."
"Here's some more text."

$ renpy.movie_cutscene("opening.webm")

"This text is displayed, after the cutscene."
Would any of you be able to help me with this? I hope it doesn't cause too much of a headache.

Regardless, take care, and I hope you have a good day. <3
Last edited by SelLi on Mon Nov 27, 2023 12:06 pm, edited 1 time in total.

mtermik
Regular
Posts: 26
Joined: Fri Dec 23, 2022 2:26 pm
Contact:

Re: $ renpy.movie_cutscene() not playing .webm video?

#2 Post by mtermik »

Have you tried running it as an image and seeing if the video works that way?

Code: Select all

image unique_identifier = Movie(size=(1920, 1080), channel="movie", play="/[file_path]/[file_name].webm", loop=False, image="/[image_path]/[image_name].png")

show screen Movie("unique_identifier ")

screen Movie(file):
    layer "background"
    add "[file]" xpos 0 ypos 0
If it works running it with this code then your movie file is likely not the problem.

User avatar
PyTom
Ren'Py Creator
Posts: 16082
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: $ renpy.movie_cutscene() not playing .webm video?

#3 Post by PyTom »

Could you post the video? It's possible it's corrupted somehow.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
SelLi
Miko-Class Veteran
Posts: 549
Joined: Fri Apr 27, 2012 4:49 pm
Completed: The Silent Column Demo, Memory Mage
Projects: The Silent Column, A Lily from the Lightless Water, A Castle on an Island
Deviantart: SelLillianna
itch: SelLillianna
Location: Canada
Contact:

Re: $ renpy.movie_cutscene() not playing .webm video?

#4 Post by SelLi »

Thank you for your help, both of you. Running it as an image also doesn't work. I guess there is an issue with the file, after all.

Here is the file. (I'm not used to sharing files. I just used Google Drive, which is hopefully fine.)

A little background on the file - the video was made and exported using the Shotcut video editor. I simply went~
file> export> video
and then, in the window where you name and save the file you're wanting to export, I switched the "save as type" from the default "mp4" to "all files", and typed ".webm" at the end of the file's name, when naming the file.

I wouldn't be surprised to find that this isn't the proper way to export a .webm file, but it nonetheless exported a .webm file that I could play outside of Ren'Py~ and if that isn't the proper way of doing it, then I don't know what the proper way is~ ^^;

(Thanks for the help - I'm more of a traditional artist and writer type, so~ when people start talking about proper ways to export, and... start talking about what "video codecs" to use~ it's pretty confusing. Though, I know the video is 25 frames per second~)

User avatar
PyTom
Ren'Py Creator
Posts: 16082
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: $ renpy.movie_cutscene() not playing .webm video?

#5 Post by PyTom »

Okay, that file isn't really a webm - it's an mp4 file, containing h264. So it won't play.

I'm not that familiar with what tools people are using to convert mp4 to webm, but wikihow shows how to use VLC to do it: https://www.wikihow.com/Convert-a-Webm- ... 4-with-VLC
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
SelLi
Miko-Class Veteran
Posts: 549
Joined: Fri Apr 27, 2012 4:49 pm
Completed: The Silent Column Demo, Memory Mage
Projects: The Silent Column, A Lily from the Lightless Water, A Castle on an Island
Deviantart: SelLillianna
itch: SelLillianna
Location: Canada
Contact:

Re: $ renpy.movie_cutscene() not playing .webm video?

#6 Post by SelLi »

PyTom wrote: Wed Nov 22, 2023 5:40 pm Okay, that file isn't really a webm - it's an mp4 file, containing h264. So it won't play.

I'm not that familiar with what tools people are using to convert mp4 to webm, but wikihow shows how to use VLC to do it: https://www.wikihow.com/Convert-a-Webm- ... 4-with-VLC
I see! Thank you very much. :) I wasn't sure what was going on. Thanks for pointing me in the right direction!

Edit: VLC does convert mp4 to webm, but seems to do so in a low quality. Looking up mp4 to webm converters lead me to a program called HandBreak, which does a good job. Here's a link to the tutorial video I found: https://www.youtube.com/watch?v=j8-WKur ... ngEveryday

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot]