audio channel missing from 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
DirkB
Newbie
Posts: 10
Joined: Tue Jul 25, 2017 3:25 am
Contact:

audio channel missing from video

#1 Post by DirkB » Thu Nov 16, 2017 6:25 pm

Hello. I am new to Ren'Py and so far I was able to solve anything myself, but now I am really stuck.

I want to have a video play in loop, giving me the option to add dialogue while the video is playing.

I followed this guide: https://www.renpy.org/wiki/renpy/doc/co ... ackgrounds

I use VSDC Video Editor for making a movie. The movie itself plays normally if I just add it as a normal movie.

I added a silent mp3 file in VSDC and made sure it plays the whole movie (only 11 seconds).

On the Video Editor screen it mentions that there's an audio track with codec PCM signed 16-bit little-endian.

I know Ren'Py only accepts certain types of video and audio but I am really not sure what is the issue here now.

Thanks for any help!

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

Re: audio channel missing from video

#2 Post by Imperf3kt » Thu Nov 16, 2017 6:29 pm

You need to tell us what is wrong, more descriptively. Does it not play any audio at all? Does it not play the additional noises? Does it crash?
Does your sound channel not appear inside the video container?

Right now all I know is you made a video and it plays and you have a silent audio file to go with it which appears to be your mp3 file being converted into LPCM wav
Image

Warning: May contain trace amounts of gratuitous plot.

DirkB
Newbie
Posts: 10
Joined: Tue Jul 25, 2017 3:25 am
Contact:

Re: audio channel missing from video

#3 Post by DirkB » Thu Nov 16, 2017 7:01 pm

While playing the story, I get the following message when arriving at the point where the video should play:
Exception: Audio channel u'moviefirstdream' is unknown. (see also attachment)

So it doesn't play anything this way.

In Ren'Py I did the following:

line 16 image moviefirstdream = Movie(size=(960, 640), xpos=0, ypos=0, xanchor=0, yanchor=0)

line 258 play moviefirstdream "firstdreamdonothing.webm" loop
line 259 show movie with dissolve

I can play the video without loop if I just use a command like this $ renpy.movie_cutscene('moviefirstdream.webm'). So I am assuming that the video file itself is ok. However for using it with a loop, it seems you need to add a silent music channel to it. I thought that's what I did, but it keeps repeating that audio channel is unknown.
Attachments
videoaudiotrack.png
exception.png

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

Re: audio channel missing from video

#4 Post by Imperf3kt » Thu Nov 16, 2017 7:21 pm

Ok now I see.
You just need to add the audio to the video and play the video. No other special requirements.

Renpy will determine how to loop the video, from the audio present in the video.
Either add the audio when creating the video, or after via a process known as muxing.

I can give examples later if required, but I am.not at my computer right now and do not expect to be for at least several hours. Maybe 10 hours or so.
Image

Warning: May contain trace amounts of gratuitous plot.

DirkB
Newbie
Posts: 10
Joined: Tue Jul 25, 2017 3:25 am
Contact:

Re: audio channel missing from video

#5 Post by DirkB » Thu Nov 16, 2017 7:36 pm

Ok. Thank you for the replies.

I don't quite understand what you mean by adding audio to the video. I already added an mp3 file to the video in VSDC Video Editor. See the other attachment in previous message where it mentions video and audio codec.

I could look for some muxing software and try to combine it this way also. I will sleep now.

EDIT: When I make a new project in VSDC Video Editor it's like there's already an audio channel associated with it. Because both video and audio codec are listed in the source files (as in the attachment above). I tried MP4muxer but it doesn't seem to work with webm files. This is now the first time that I miss Tyranobuilder. I could just add a video backdrop in a few seconds without any hassle :(

User avatar
PyTom
Ren'Py Creator
Posts: 14846
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: audio channel missing from video

#6 Post by PyTom » Fri Nov 17, 2017 11:29 am

Code: Select all

image moviefirstdream = Movie(size=(960, 640), xpos=0, ypos=0, xanchor=0, yanchor=0)

play moviefirstdream "firstdreamdonothing.webm" loop
show movie with dissolve
This code is wrong, as you're using three unrelated things.

What you want to do is to just use the Play parameter to the movie, and then show the movie. Ren'Py will automatically take care of playing the movie, and it will loop as well.

Code: Select all

image moviefirstdream = Movie(play="firstdreamdonothing.webm")

label start:
    scene moviefirstdream

    "The movie is playing, and will loop forever."

    hide moviefirstdream

    "And, it's done."
As of recent Ren'Py versions, you don't need the audio channel anymore. (But it won't hurt anything either.)
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

DirkB
Newbie
Posts: 10
Joined: Tue Jul 25, 2017 3:25 am
Contact:

Re: audio channel missing from video

#7 Post by DirkB » Fri Nov 17, 2017 11:43 am

Awesome! That did it!

Thanks a lot!

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

Re: audio channel missing from video

#8 Post by Imperf3kt » Sat Nov 18, 2017 1:11 am

PyTom wrote:
Fri Nov 17, 2017 11:29 am
As of recent Ren'Py versions, you don't need the audio channel anymore. (But it won't hurt anything either.)
Very handy to know, thanks PyTom
Image

Warning: May contain trace amounts of gratuitous plot.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], ComputerArt.Club