IO Error: Trying to load a movie

seamanq

Well-Known Member
Game Developer
Aug 28, 2018
1,888
2,858
Code:
$ wild_ride = "movie_wild_ride"

python:

    renpy.movie_cutscene(wild_ride, delay=None, loops=-1)
I am trying to play a looping video in MP4 format in this location, using the above code.

I have tried every kind of variation you can imagine, including:

movie_wild_ride
movie_wild_ride.mp4
/images/movie_wild_ride
../images/movie_wild_ride

None of them work and I get an IO Error every time. I also tried putting the movie name directly in the cutscene command (in the first position, in quotes) but it didn't work either. The movie is in the images folder. All of the other images are loading with no problem being called directly. In the Windows Explorer window, the file is called movie_wild_ride with no suffix (as seen in Properties). Can anyone see anything obvious here? What do I need to do to get this to work?
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,688
Try with this:

Code:
window hide
play movie "images/movie_wild_ride.mp4" loop
show movie with dissolve
pause
Remember to stop the movie when you want:
Code:
stop movie
BTW: I've used sometimes your code, but without declare the movie:
Code:
$ renpy.movie_cutscene("images/movie_wild_ride.mp4")
 
  • Like
Reactions: Vanderer

seamanq

Well-Known Member
Game Developer
Aug 28, 2018
1,888
2,858
I got my code directly out of the Ren'py documentation for movies. When running your code, it gives the error:

File "game/script.rpy", line 2017, in script
show movie with dissolve
IOError: Couldn't find file 'images/movie_wild_ride'.

This occurs with having the .mp4 suffix or not. I have double-checked and cut and pasted the name from the actual movie file into the Ren'py script, so I am certain it's not a typo.

By the way, before anyone else asks, I posted here only after I searched this and found several different responses (and tried them) to no avail.
 

seamanq

Well-Known Member
Game Developer
Aug 28, 2018
1,888
2,858
BTW: I've used sometimes your code, but without declare the movie:
Code:
$ renpy.movie_cutscene("images/movie_wild_ride.mp4")
This is actually what I tried first, but it didn't work any better.
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,688
I got my code directly out of the Ren'py documentation for movies. When running your code, it gives the error:

File "game/script.rpy", line 2017, in script
show movie with dissolve
IOError: Couldn't find file 'images/movie_wild_ride'.

This occurs with having the .mp4 suffix or not. I have double-checked and cut and pasted the name from the actual movie file into the Ren'py script, so I am certain it's not a typo.

By the way, before anyone else asks, I posted here only after I searched this and found several different responses (and tried them) to no avail.
Try to put this at the beggining of your scipt (just after "label intro"):
Code:
image movie = Movie(size=(1920, 1080), xpos=0, ypos=0, xanchor=0, yanchor=0)
Anyway, it seems to be a problem not finding the file, if the path and name is specified well, I do not understand why it fails you.
 

seamanq

Well-Known Member
Game Developer
Aug 28, 2018
1,888
2,858
Try to put this at the beggining of your scipt (just after "label intro"):
Code:
image movie = Movie(size=(1920, 1080), xpos=0, ypos=0, xanchor=0, yanchor=0)
Anyway, it seems to be a problem not finding the file, if the path and name is specified well, I do not understand why it fails you.
Yep. Now you can see why I am frustrated as well. I only hope someone can see something blatantly obvious that I am missing somehow because I am such a NooB.
 

seamanq

Well-Known Member
Game Developer
Aug 28, 2018
1,888
2,858
I added the line you suggested (image movie) at the beginning of the script and now I am getting this error:

File "game/script.rpy," line 2020, in script
pause
File "renpy/common/000statements.rpy", Line 416, in execute_pause
renpy.pause()
IOError: "Couldn't find file 'images/movie_wild_ride'.
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,688
To review it well, can you put an exact copy of your code? And the exact path and name where the file is right now. Thank you.
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,688
Isn't it the "images" folder that's causing problems? Try putting your video in a folder called "movies" and then use this code:
Code:
label start:

     image movie = Movie(size=(1920, 1080), xpos=0, ypos=0, xanchor=0, yanchor=0)

     window hide
     play movie "movies/movie_wild_ride.mp4" loop
     show movie with dissolve
     pause
 

seamanq

Well-Known Member
Game Developer
Aug 28, 2018
1,888
2,858
Same deal. IO Error. On a hunch that maybe it was something damaged in that particular movie file, I copied two other movies into the movies folder and labeled them movie_1 and movie_2. I tried both but also received the same error.
 

seamanq

Well-Known Member
Game Developer
Aug 28, 2018
1,888
2,858
Excuse me, but this is completely off topic. This is a question of how to insert a video in Ren'py in a visual novel. It has nothing to do with the question of how to view a video as a loop outside of Ren'py, which VLC would have nothing to do with.
 

Epadder

Programmer
Game Developer
Oct 25, 2016
568
1,058
I can't figure out exactly why you're having an IO error.

The images folder is fine, it won't give problems. It would help if you could actually post at least the label's worth of code where you are trying to use the renpy.moviecutscene() function and the full traceback.

You can also use Shift+D and choose 'Filename List' to see exactly what files Ren'py knows about.

The following example shows everyway that I could think of to show renpy.moviecutscene() working:

Python:
define wildride_fn =  "mm.webm"
define wildride_fnwithpath = "images/mm.webm"

label start:
    "1"
    "2: wild_ride variable given path and filename."
    $ wild_ride = "images/mm.webm"
    python:
        renpy.movie_cutscene(wild_ride, delay=None, loops=-1)
    "3"
    "4"

label again:
    "5"
    "6: wild_ride variable given filename only, file is in the images folder."
    $ wild_ride = "mm.webm" #still in images folder
    python:
        renpy.movie_cutscene(wild_ride, delay=None, loops=-1)
    "7"
    "8"

label andagain:
    "9"
    "10: Filename and path inserted directly into the function."
    $ renpy.movie_cutscene("images/mm.webm", delay=None, loops=-1)
    "11"
    "12"

label fourthtime:
    "13"
    "14: Filename only given directly to the function."
    $ renpy.movie_cutscene("mm.webm", delay=None, loops=-1)
    "15"
    "16"

label fifthtime:
    "17"
    "18: Defined variable with filename and path given to the function."
    $ renpy.movie_cutscene(wildride_fnwithpath, delay=None, loops=-1)
    "19"
    "20"

label final:
    "21"
    "22: Defined variable with filename only given to the function."
    $ renpy.movie_cutscene(wildride_fn, delay=None, loops=-1)
    "23"
    "24: Next click drops into the next label or returns to the main menu if nothing else has been called."

return
 

seamanq

Well-Known Member
Game Developer
Aug 28, 2018
1,888
2,858
Wow. This was totally spot on. As a Ren'py NooB, I was not aware that the Developer mode had a way to show what files that Ren'py could "see." When showing the filename list, even though I created the movies folder within the game folder, the movies folder (and thus, none of the files in it) do not show up. When I try to take my three movies and move them back to the images folder, then restart the game, when I pull the filename list, all of the images show up like normal, but none of the movies do.

I am beginning to suspect that it is something in the way that I created these movies that is making them "unreadable" by Ren'py.

Looking at my files, the first one (movie_wild_ride) is an MPEG-4 video using the isom (isom/iso2/mp41) codec.

The second one (movie1) is an AVI using the IYUV codec.

The third one (movie2) an MPEG-4 using the mp41 (mp41/isom) codec.

In reviewing the Ren'py documentation for movies, it says explicitly that Ren'py supports MPEG-4 with Divx encoding so I re-encoded the movies as MPEG-4 with the Divx codec and put them back into images. But when I use shift-D and list the files that Ren'py is aware of, none of the movies are showing up. It is looking like Ren'py is really not seeing them. Any more suggestions?
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,688
Wow. This was totally spot on. As a Ren'py NooB, I was not aware that the Developer mode had a way to show what files that Ren'py could "see." When showing the filename list, even though I created the movies folder within the game folder, the movies folder (and thus, none of the files in it) do not show up. When I try to take my three movies and move them back to the images folder, then restart the game, when I pull the filename list, all of the images show up like normal, but none of the movies do.

I am beginning to suspect that it is something in the way that I created these movies that is making them "unreadable" by Ren'py.

Looking at my files, the first one (movie_wild_ride) is an MPEG-4 video using the isom (isom/iso2/mp41) codec.

The second one (movie1) is an AVI using the IYUV codec.

The third one (movie2) an MPEG-4 using the mp41 (mp41/isom) codec.

In reviewing the Ren'py documentation for movies, it says explicitly that Ren'py supports MPEG-4 with Divx encoding so I re-encoded the movies as MPEG-4 with the Divx codec and put them back into images. But when I use shift-D and list the files that Ren'py is aware of, none of the movies are showing up. It is looking like Ren'py is really not seeing them. Any more suggestions?
It seems that the problem could be the format you're using...

To be sure try this:
- Go to:
- Load your actual video > "Choose Files"
- In "Optional Settings" only change "Select video codec" to vp9
- Click on "Start conversion"
- Wait a while and the new file will be downloaded, extension "webm" in Vorbis9 format.
- Try to use it with Renpy
- Let us know if it works :p
 

seamanq

Well-Known Member
Game Developer
Aug 28, 2018
1,888
2,858
It seems that the problem could be the format you're using...

To be sure try this:
- Go to:
- Load your actual video > "Choose Files"
- In "Optional Settings" only change "Select video codec" to vp9
- Click on "Start conversion"
- Wait a while and the new file will be downloaded, extension "webm" in Vorbis9 format.
- Try to use it with Renpy
- Let us know if it works :p
I tried another tool to make the video webm and the quality went to absolute crap. I'll try this tool and see what happens.
 

seamanq

Well-Known Member
Game Developer
Aug 28, 2018
1,888
2,858
It seems that the problem could be the format you're using...

To be sure try this:
- Go to:
- Load your actual video > "Choose Files"
- In "Optional Settings" only change "Select video codec" to vp9
- Click on "Start conversion"
- Wait a while and the new file will be downloaded, extension "webm" in Vorbis9 format.
- Try to use it with Renpy
- Let us know if it works :p
Nope. Loaded the game, hit shift D. Still not seeing the new video in Webm format either. It sees all the images in the image folder, but won't recognize any videos.
 

Epadder

Programmer
Game Developer
Oct 25, 2016
568
1,058
Okay I know this file works, once you extract it if you drop it into your images folder and load the game and check the filelist, is this file visible?

If not, create a new test project and check the filelist and see if this file and your other files are visible if you move them into that project's images folder.