Best way to add/ import intro animation?

redruM-110redruM-110 Posts: 12Member

Hi All,

So, I have a ten second animation (with an accompanying MP3 track) lined up, but aren't sure of the best way (or, indeed, any way) of adding these to Godot. If anyone could point me in the direction of a good tutorial for this- or give me a reasonable explanation, I'd be very grateful (all the tutorials I've found so far seem to involve sprite animations, or background animations created with Godot).

I'm pretty new to Godot- just at the stage of going through tutorials and making very basic programs, but am quite experienced in Gimp (which I used to create the animation) and, less so, Audacity- so I can have the animation as an MP4, AVI, or even the 70-odd individual JPG frames if this is easier. The native Godot animation formats do confuse me though- are they easy to convert to?

Cheers,

Dom

Tagged:

Tags :

Answers

  • redruM-110redruM-110 Posts: 12Member

    Oh, and here's the animation if it helps...

  • KitKatKitKat Posts: 7Member
    Answer ✓

    I'm going to make this brief, use this node. If you don't know how to use nodes. Ask away.
    http://docs.godotengine.org/en/stable/classes/class_videoplayer.html?highlight=video

  • redruM-110redruM-110 Posts: 12Member

    Thanks, KitKat, I've just converted it into an OGV (this is about the fifth different format I've converted it to for one thing or another!) and I'll have a crack at it as soon as I've got time :)

  • RayekRayek Posts: 21Member

    Expanding on this question: is it possible to jump to a specific time in a video stream (random access)? And is it possible to jump from video A [time X] to video B [time Y]? Also wondering if OGV and Godot allow for flagging specific frames in the video stream to fire events in sync with the video play.

  • redruM-110redruM-110 Posts: 12Member

    Yeah, that worked, thanks.

    But it's led to another problem (nothing's ever simple!): the animation's visuals don't sync with the audio- even though the OGV file plays fine by itself.

    What happens is the OGV's audio cuts in, and then stutters by a second or two (which is enough to send the whole thing off kilter). I've got the Main Menu scene to switch to the Video Player scene via a button, but I'm not sure why that would cause a problem. Anyone?

  • razvanc-rrazvanc-r Posts: 84Member

    You probably have to play with set_buffering_msec: http://docs.godotengine.org/en/stable/classes/class_videoplayer.html?highlight=set_buffering_msec, which sadly isn't exposed in the inspector. Also doesn't seem to be a way to play at specific locations in time. Interested in features? Submit to the issue tracker (if it isn't already submitted)

  • KitKatKitKat Posts: 7Member

    Why did I not get an email update :(

  • redruM-110redruM-110 Posts: 12Member

    Thanks for the help , razvanc-r. Could you (or anybody), give me a specific example of a script I could try, please?
    I had a go at this one below, but with no joy. This is hardly surprising, though, as I'm still very much at the beginner stage of scripting.

    extends VideoPlayer
    
    func _ready():
        pass
    
    func _on_Video_Player_is_playing():
        set_buffering_msec("100")
    

    Also, Rayek, I noticed there was a get_stream_pos constant ("Get the current position of the stream, in seconds"). Maybe there's a way of playing around with that to get what you're after?

  • KitKatKitKat Posts: 7Member

    put it in ready. and don't use a string, use an int (1000msecs in 1 sec) @redruM-110

    extends VideoPlayer
    func _ready():
        set_buffering_msec(100)
    
  • redruM-110redruM-110 Posts: 12Member

    Still not doing anything, sadly- even setting it up to 5000 and down to -1000.

  • KitKatKitKat Posts: 7Member

    It's just supposed to be an internal thing to prevent the video and audio from desyncing

  • RayekRayek Posts: 21Member

    @redruM-110 said:
    Also, Rayek, I noticed there was a get_stream_pos constant ("Get the current position of the stream, in seconds"). Maybe there's a way of playing around with that to get what you're after?

    Yes, I found that in the docs, but there does not seem to be a method to seek/random access a stream. I could be wrong, though.

  • redruM-110redruM-110 Posts: 12Member
    Answer ✓

    Right, I've found a way around this by removing the sound from the original video, saving the soundtrack separately as an OGG on Audacity, and then running them both simultaneously on Godot using VideoPlayer and StreamPlayer.

    This hardly sounds like the most efficient way of doing things ;) so any further suggestions are still very welcome!

  • KitKatKitKat Posts: 7Member

    Nope sounds about right :|
    That might even be the way that big company's do it :|

Sign In or Register to comment.