# GLMakie Method error (Makie.image!)

**URL:** <https://discourse.julialang.org/t/glmakie-method-error-makie-image/63090>\
**Category:** Visualization\
**Created:** [June 17, 2021, 2:03pm UTC](https://discourse.julialang.org/t/glmakie-method-error-makie-image/63090 "2021-06-17T14:03:38Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)\
**Post date:** [June 21, 2021, 4:40pm UTC](https://discourse.julialang.org/t/glmakie-method-error-makie-image/63090/9 "2021-06-21T16:40:16Z")

</div>

That was most helpful. I now have something that does not eat memory! The only thing currently missing is a foolproof way to get the framerate from the file. In the past it would have been f.framerate according to the demo code on the github VideoIO page but that seems not to work anymore. I have a workaround that works in some cases.  
My current code is:

```julia
using GLMakie
using VideoIO
using Printf

#filename = "MOV_20210607_1540323.mp4"
#f = VideoIO.openvideo(filename)
io = VideoIO.testvideo("annie_oakley") # for testing purposes
f = VideoIO.openvideo(io)

framerate = 0.0
try
    framerate = VideoIO.get_number_frames(filename) / VideoIO.get_duration(filename)
    println("Using calculated framerate of $framerate")
catch
    framerate = 30.0
    println("Using default framerate of $framerate")
end
@show(framerate)
img = read(f)
fig = Figure()
ax = Axis(fig[1,1], aspect = DataAspect())
hidedecorations!(ax)
node = Node(rotr90(img))

makieimg = image!(node)

i = 0
while !eof(f)
    i += 1
    print("Frame $i\r")
    read!(f, img)
    node[] = rotr90(img)
    save(@sprintf("test_%04d.png", i) , fig.scene)
    sleep(1/framerate)
end

```

Thank you very much for your help!

Edit: minor correction and added a line to save every frame to a png file.

---

_[View the full topic](https://discourse.julialang.org/t/glmakie-method-error-makie-image/63090)._
