kidrigger / godot-videodecoder

GDNative Video Decoder libraries for Godot Game Engine, using FFmpeg library for codecs. A Google Summer of Code Project, 2018
MIT License
84 stars 22 forks source link

" Cannot get ratio when minimum and maximum value are equal" and others errors #30

Closed kzerot closed 3 years ago

kzerot commented 3 years ago

I have error both on Win and Linux when I make new or open "test" project from git. Maybe I'm doing something wrong :) But most important, I can't play any video, usually I have no errors Compiled with docker.

E 0:00:01.055 get_as_ratio: Cannot get ratio when minimum and maximum value are equal. <C++ Error> Condition "Math::is_equal_approx(get_max(), get_min())" is true. Returned: 0.0 <C++ Source> scene/gui/range.cpp:174 @ get_as_ratio()

Also if I try to play webm video from test project I have error: W 0:00:00.545 godot_videodecoder_open_file(): Videodecoder vp8 (On2 VP8) not found. <C++ Source> src/gdnative_videodecoder.c:572 @ godot_videodecoder_open_file()()

World.gd:9 @ _ready()
ttencate commented 3 years ago

I had this too. This "Cannot get ratio" happens because the min and max of the ProgressBar are set to equal values (both 0). This happens if the plugin failed to open the video. And that is happening because the VP8 codec is not supported by the plugin, as you can see from the second error. (Note that none of the example videos in the test project are actually in a supported format...)

A combination that works for me is to use the .webm extension, WebM container format, VP9 video, Vorbis audio. Using the newer Opus for audio should also work, considering what the plugin reports at startup:

ffmpeg_videoplayer: Supported video codecs:
    decode vp9
    decode vorbis
      codec: libvorbis
    decode opus
      codec: libopus
Calinou commented 3 years ago

This is a Godot bug that was fixed in 3.3 by https://github.com/godotengine/godot/pull/45220.

@kidrigger Can you close this issue?