Error Code 0x505 Cannot create image

Create issue
Issue #64 resolved
Sla Master created an issue

I get this on my video player script, at end of the video, I tested it before with a shorter video and it ran but with this 1054 frames video doesn't work, works perfect on Windows.

Images are JPG, they're removed after they were rendered, so memory is not a problem (also I have 1 GB RAM on it). Images are sent trough threads to the main thread and then loaded as images into the buffer table.

sometimes it works and doesn't crash, but most of times does. m is a userdata (Graphic) and checked before using it. the line where it crashes: SSV.buffer[SSV.framereceive]

Comments (3)

  1. Alex Szpakowski

    0x505 means OpenGL doesn't have enough video memory to store the new image. Your old images probably aren't being garbage collected as fast as you'd like.

    Instead of creating a new image for every frame in your video, you should just upload new frame's data to the same image each time (using Image:refresh()). Then you'll only ever need a single Image for an entire video.

    The code for that might look something like this:

    videoImageData = love.image.newImageData(videowidth, videoheight)
    videoImage =
    function updateVideo(newVideoData)
        videoImageData:paste(newVideoData, 0, 0, 0, 0, newVideoData:getDimensions())
    function love.update(dt)
        -- updateVideo(...) etc.
    function love.draw(), 0, 0)
  2. Log in to comment