[BUG] Video not playing to the end

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
reverent.lapwing
Prole
Posts: 10
Joined: Wed Mar 13, 2024 1:02 pm

[BUG] Video not playing to the end

Post 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.
User avatar
BrotSagtMist
Party member
Posts: 615
Joined: Fri Aug 06, 2021 10:30 pm

Re: [BUG] Video not playing to the end

Post by BrotSagtMist »

Not a Löve problem.
This file doesnt play correctly in mpv either. Its probably too short.
obey
reverent.lapwing
Prole
Posts: 10
Joined: Wed Mar 13, 2024 1:02 pm

Re: [BUG] Video not playing to the end

Post 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.
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: [BUG] Video not playing to the end

Post 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.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
knorke
Party member
Posts: 239
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: [BUG] Video not playing to the end

Post 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/
reverent.lapwing
Prole
Posts: 10
Joined: Wed Mar 13, 2024 1:02 pm

Re: [BUG] Video not playing to the end

Post 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.
User avatar
slime
Solid Snayke
Posts: 3134
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: [BUG] Video not playing to the end

Post 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.
reverent.lapwing
Prole
Posts: 10
Joined: Wed Mar 13, 2024 1:02 pm

Re: [BUG] Video not playing to the end

Post 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.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 58 guests