Closed rezgi closed 2 months ago
The issue moved from the Defold main issue tracker to the related extension repository.
The issue moved from the Defold main issue tracker to the related extension repository.
Ok thanks. So next time I always need to report issues on the related extension right ?
The issue moved from the Defold main issue tracker to the related extension repository.
Ok thanks. So next time I always need to report issues on the related extension right ?
Yes, please!
Noted. Sorry about that.
Same behavior in Ubuntu Linux, it crashes a few seconds into playing the video.
Apparently, if you press Stop and then hit Play, the crash is fixed.
Apparently, if you press Stop and then hit Play, the crash is fixed.
I did that too before and it worked a few more seconds before it crashed again.
changing this, works for me
It doesn't fix the issue for all videos. It continues to crash.
Interesting to note :
My knowledge of C is very basic, but I’ve been looking at the implementation, and it doesn’t seem to have anything unusual. So I thought the problem might be with Lua, in the demo script itself. I removed the comment from the stream function and commented out the call to the play function that appears in init, and it no longer crashes (although it shows visual errors).
I have tried to clean up Lua's garbage collector, but it keeps crashing, so I suppose the issue is in the open
function in C++.
Are you sure you are using the same exact example as in the original repository? I've just downloaded it and watched the video 5 times - it just works.
Yes, even with the untouched repository, it crashes after a few seconds. If I stop and play again, sometimes it works, but it depends on the video. Maybe it has more problems with higher resolution videos. It must be some kind of buffer issue because it doesn't seem to happen with the stream function (although, as I said, maybe it happens with higher resolution videos). I don't know if it's something that only happens on Linux.
I think I've found the problem. I'm attaching a video. I believe that the open
operation from Lua is causing the garbage collector to kill the buffer before it is loaded into memory by the C script. So, by declaring the variable as a local variable in the script instead of as a local variable in the method, it stays in memory longer, giving it time to load. This might only happen with disks or memory of certain speeds.
https://github.com/user-attachments/assets/192367b0-ec79-4371-9175-7f1b46a8b99f
Ah, yeah, the result from resource.load()
will return a buffer and that might ofc be garbage collected. We don't want the videoplayer to have to copy the video data so you need to keep that reference around while playing the video. I have updated the example so that it does this too.
Is it a private platform, and a platform specific issue? (i.e. would it break your NDA?)
Then please report your issue in the corresponding extension repository!
Describe the bug (REQUIRED) When I launch the build of the VideoPlayer-MPEG example project, it plays the video for 2-3s then crashes every time. I didn't change anything in the example, I also tried with another video and I had the same problem. I tried with the other VideoPlayer extension and it works fine.
I get the following error :
To Reproduce (REQUIRED) Steps to reproduce the behavior:
Expected behavior (REQUIRED) The video should play without crashing.
Defold version (REQUIRED):
Platforms (REQUIRED):
Minimal repro case project (OPTIONAL): The project is on Github.
Logs (OPTIONAL): I attached the dump file. _crash.zip
Workaround (OPTIONAL): Didn't find one except use the other video player extension, which uses WebM instead of Mpeg.