Technical support - implement a video

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
angeberdude
Newbie
Posts: 6
Joined: Mon Jul 17, 2023 8:51 am
Contact:

Technical support - implement a video

#1 Post by angeberdude »

Hi, hope I didn´t miss any kind of support-subforum here. Found nothing of the sort, so I´ll post it in generall?

Maybe someone might help me on a problem I´m having. First time trying to put a video-file into my project and from what I got from the tutorial this should be simply two lines of code.

So I tried these lines of code. Second movie was only to test if my first one was faulty, third one was to test if positioning was wrong. None of them seemed to do anything at all:

image uk_movie = Movie(play="uk.webm")
image uk_movie3 = Movie(play="wink.webm")
image launch = Movie(play="uk.webm", pos=(10, 10), anchor=(0, 0))

show uk_movie
show uk_movie3
show launch

So I tried variant 2:


$ renpy.movie_cutscene("wink.webm", delay=2, loops=0, stop_music=True)


That one crashes to program, telling me:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 53, in script
    $ renpy.movie_cutscene("wink.webm", delay=2, loops=0, stop_music=True)
  File "game/script.rpy", line 53, in <module>
    $ renpy.movie_cutscene("wink.webm", delay=2, loops=0, stop_music=True)
OSError: Couldn't find file 'wink.webm'.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 53, in script
    $ renpy.movie_cutscene("wink.webm", delay=2, loops=0, stop_music=True)
  File "C:\Users\marco\OneDrive\Desktop\renpy-8.0.3-sdk\renpy\ast.py", line 1138, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\marco\OneDrive\Desktop\renpy-8.0.3-sdk\renpy\python.py", line 1122, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "game/script.rpy", line 53, in <module>
    $ renpy.movie_cutscene("wink.webm", delay=2, loops=0, stop_music=True)
  File "C:\Users\marco\OneDrive\Desktop\renpy-8.0.3-sdk\renpy\exports.py", line 1699, in movie_cutscene
    rv = renpy.ui.interact(suppress_overlay=True,
  File "C:\Users\marco\OneDrive\Desktop\renpy-8.0.3-sdk\renpy\ui.py", line 299, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\marco\OneDrive\Desktop\renpy-8.0.3-sdk\renpy\display\core.py", line 3579, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, pause_modal=pause_modal, **kwargs) # type: ignore
  File "C:\Users\marco\OneDrive\Desktop\renpy-8.0.3-sdk\renpy\display\core.py", line 4376, in interact_core
    renpy.audio.audio.periodic()
  File "C:\Users\marco\OneDrive\Desktop\renpy-8.0.3-sdk\renpy\audio\audio.py", line 1222, in periodic
    raise_(exc[0], exc[1], exc[2])
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python3.9/site-packages/future/utils/__init__.py", line 444, in raise_
  File "C:\Users\marco\OneDrive\Desktop\renpy-8.0.3-sdk\renpy\audio\audio.py", line 1200, in periodic_thread_main
    periodic_pass()
  File "C:\Users\marco\OneDrive\Desktop\renpy-8.0.3-sdk\renpy\audio\audio.py", line 1142, in periodic_pass
    c.periodic()
  File "C:\Users\marco\OneDrive\Desktop\renpy-8.0.3-sdk\renpy\audio\audio.py", line 534, in periodic
    topf = load(filename)
  File "C:\Users\marco\OneDrive\Desktop\renpy-8.0.3-sdk\renpy\audio\audio.py", line 72, in load
    rv = renpy.loader.load(fn, directory="audio")
  File "C:\Users\marco\OneDrive\Desktop\renpy-8.0.3-sdk\renpy\loader.py", line 833, in load
    raise IOError("Couldn't find file '%s'." % name)
OSError: Couldn't find file 'wink.webm'.

Windows-10-10.0.19045 AMD64
Ren'Py 8.1.1.23060707
Go Talk NOW 1.0
Mon Jul 17 15:07:28 2023

The video-files are in the image-folder of the game. All other files like picture in the same folder work as intended.
Tried converting the video-file from it´s original mp4 to avi and webm then, made no difference.

So I´m pretty much at my wits end on that. If anyone has experienced something like that, please let me know if and how you fixed that.

Thanks in advance

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Technical support - implement a video

#2 Post by Imperf3kt »

If your videos are in your images folder then you need to add images/ to the filepath
"images/wink.webm"
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

angeberdude
Newbie
Posts: 6
Joined: Mon Jul 17, 2023 8:51 am
Contact:

Re: Technical support - implement a video

#3 Post by angeberdude »

Sadly I tried that too.. even copied the exact lines and folder-structure from someone elses project and the videos still wouldn´t launch.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Technical support - implement a video

#4 Post by Imperf3kt »

What format are your videos in?
I know it says webm in the file extension, but are they also in a supported format such as vp8 or vp9?

More specific information can be found in the documentation for videos
Note that play=, pos= etc are not required in the Movie declaration line (but having them there won't hurt)
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

angeberdude
Newbie
Posts: 6
Joined: Mon Jul 17, 2023 8:51 am
Contact:

Re: Technical support - implement a video

#5 Post by angeberdude »

The original video was in mp4-format.

Used the page "https://video-converter.com/de/" to convert it into a webm file, with VP9 and Vorbis.

I´m getting really paranoid :cry: Even tried importing a video from another project, which worked in their script and tried using that for experimentation. Still wouldn´t launch or crash dependant on the variant.

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Technical support - implement a video

#6 Post by Alex »

angeberdude wrote: Wed Jul 19, 2023 5:55 am The original video was in mp4-format.

Used the page "https://video-converter.com/de/" to convert it into a webm file, with VP9 and Vorbis.

I´m getting really paranoid :cry: Even tried importing a video from another project, which worked in their script and tried using that for experimentation. Still wouldn´t launch or crash dependant on the variant.
Any chance that file extension is hidden and file actually named 'wink.webm.webm'?

angeberdude
Newbie
Posts: 6
Joined: Mon Jul 17, 2023 8:51 am
Contact:

Re: Technical support - implement a video

#7 Post by angeberdude »

Thanks you all for all your efforts, I got it figured out now.

The error seemed to be, that Windows automatically blocked the converted video-file. In the file properties there´s a box which can be checked to allow other programs to use this file then. Didn´t think of it, as the video could be opened just normally in the VPN-player, but apparently not by RenPy,

Should I delete this post or let it remain here for others to find? I case they stumble across the same problem as me?

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]