Page 1 of 1

[BUG] Video not playing to the end

Posted: Mon Mar 18, 2024 5:42 pm
by reverent.lapwing
Hi,

I tried to play a splash animation encoded in ogg and for some reason it will only play a few frames and stop. I thought it was only skipping the last frame, but after duplicating that frame, it still keeps getting stuck on frame #5. Please advise.

Video creation:

Code: Select all

        ffmpeg \
	-framerate 10 \
	-i $(FRAMES_DIR)/%00d.png \
	-c:v libtheora -qscale:v 30 -crf 20 -pix_fmt yuv420p \
	logo.ogg;
Code displaying the video (tested in empty project):

Code: Select all

function love.load()
   local vs = love.video.newVideoStream("logo.ogg")
   video = love.graphics.newVideo(vs)
   video:play()
end

function love.draw()
   love.graphics.draw(video, 0, 0)
end
   
Here is the logo.ogg file, so you can try yourself. Love is running on newest version.

Thank you.

Re: [BUG] Video not playing to the end

Posted: Mon Mar 18, 2024 8:18 pm
by BrotSagtMist
Not a Löve problem.
This file doesnt play correctly in mpv either. Its probably too short.

Re: [BUG] Video not playing to the end

Posted: Mon Mar 18, 2024 9:56 pm
by reverent.lapwing
It plays correctly in ffplay, VLC, Parole and Firefox embedded video player, if Love cannot handle it but all those programs can then that points to a bug.

Either way, removing all the flags from ffmpeg except for those required fixed the problem.

Re: [BUG] Video not playing to the end

Posted: Tue Mar 19, 2024 3:05 pm
by zorg
I have videos that glitch in VLC, crash mpc-hc, but play fine in Chrome... video player libraries are widely different from each other, so you are better off re-encoding stuff you want to use in löve than expect fixes to this kind of thing, i believe.

Re: [BUG] Video not playing to the end

Posted: Thu Mar 21, 2024 11:19 pm
by knorke
This seems solved then?
For everything related to video codecs etc I still want to mention this very good forum:
https://forum.doom9.org/

Re: [BUG] Video not playing to the end

Posted: Fri Mar 22, 2024 9:24 am
by reverent.lapwing
My problem is solved, sure, but if there are some additional restrictions to the supported video format other than codec, shouldn't they be documented somewhere on the wiki? At least say "Love supports the same video formats as the backend X we are using" or "following flags are enabled in the video decoder" - not sure which one would be easier without looking at the code.

Re: [BUG] Video not playing to the end

Posted: Fri Mar 22, 2024 10:59 am
by slime
love uses libtheora with no special flags. I imagine most theora encoder tools and video players use libtheora.

It's not a very good library or video codec for making something that consistently works well though, so I'm not surprised about issues like that affecting several tools.

Re: [BUG] Video not playing to the end

Posted: Fri Mar 22, 2024 12:10 pm
by reverent.lapwing
I added a "Notes" section to the wiki in newVideo and newVideoStream warning about this potential problem. I think Video and VideoStream pages would be a better fit for information about codecs, but supported codec are mentioned in the newVideo and newVideoStream, so I followed this convention.