video:play() issues [SOLVED] (sorta)
Posted: Mon Aug 30, 2021 12:11 am
Hey there!
I'm using love2d v 11.4 (built on windows using megasource) and have some weird issue with play() method of a video.
The code is so simple, IDK whether I'm dumb or blind:
The thing is, video gets stuck in zero time position and never plays.
isPlaying reports things just fine, seek(0) works as well, but the video doesn't start to play.
Now, if you're wondering, I'm trying to loop a short video.
The one in the demo is less than 2 seconds in length, so it's doubtful it somehow hogs the memory or is too big to be manipulated quickly.
I've attached a demo project to illustrate the issue.
Does anyone have any ideas?
Edit
I tried different ways to encode the OGV file and it's gotten even weirder.
FFmpeg 4.2 produces a bigger file and corrupts it with artifacts (colored squares all over the video).
FFmpeg 4.4 produces smaller file and the video is just fine.
But the "corrupted" file *does* loop, whereas the "clean" one doesn't.
The command I've used to encode the video looks like this:
It definitely has something to do with the way I encode stuff, but I fail to understand what's going wrong.
According to ffprobe, the only difference is "Lavc58.54.100 libvorbis" in 4.2 VS "Lavc58.134.100 libvorbis" in 4.4 (well, and the bitrate)
I'm using love2d v 11.4 (built on windows using megasource) and have some weird issue with play() method of a video.
The code is so simple, IDK whether I'm dumb or blind:
Code: Select all
if not video:isPlaying() then
video:seek(0)
video:play()
end
isPlaying reports things just fine, seek(0) works as well, but the video doesn't start to play.
Now, if you're wondering, I'm trying to loop a short video.
The one in the demo is less than 2 seconds in length, so it's doubtful it somehow hogs the memory or is too big to be manipulated quickly.
I've attached a demo project to illustrate the issue.
Does anyone have any ideas?
Edit
I tried different ways to encode the OGV file and it's gotten even weirder.
FFmpeg 4.2 produces a bigger file and corrupts it with artifacts (colored squares all over the video).
FFmpeg 4.4 produces smaller file and the video is just fine.
But the "corrupted" file *does* loop, whereas the "clean" one doesn't.
The command I've used to encode the video looks like this:
Code: Select all
./ffmpeg -i bgv1.mp4 -c:v libtheora -q:v 10 -c:a libvorbis -q:a 5 bgv1.ogv
According to ffprobe, the only difference is "Lavc58.54.100 libvorbis" in 4.2 VS "Lavc58.134.100 libvorbis" in 4.4 (well, and the bitrate)