-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera widget #13
Comments
@hhaensel looks like in my case can't access camera. I'm on Macbook. Do I need to allow some sort of camera permission? What
|
I'm on windows 10. You can try to use using VideoIO
VideoIO.CAMERA_DEVICES Then put the name of your camera in place of Good luck! |
P.S.: I'm struggling to get VideoIO running on my windows PC. |
Will look into it. Thanks 🙃 |
Just found out how to get VideoIO working: import Base.unsafe_convert
unsafe_convert(::Type{Ptr{Ptr{T}}}, ad::VideoIO.AVDict) where T = unsafe_convert(Ptr{Ptr{T}}, getfield(ad, :ref_ptr_dict)) So there is some probability that we will switch to VideoIO soon. |
You could try const FMT = "avfoundation" or const FMT = "qtkit" The next version will automate this process ... |
Just submitted a correction for webcam that should make it functional on all platforms. @essenciary , @AbhimanyuAryan |
@hhaensel webcam2.jl works. Asked for facetime permission but it's very slow. Infact it only took first frame and didn't update new frames. Toggle off turns off the camera. |
You have to decrease the |
Toggle turns off the camera so that other programs it like zoom or teams can use it |
will check :) |
Please check |
yes @hhaensel checking ... |
Has anyone tested? Can we move it to Advanced? |
I haven't had time. I'll test tomorrow :) |
The latest feature of WebCam3.jl is autosizing of the widget if you drag the side handles. The edge handles don't work properly, but that's not a big issue as they are anyhow difficult to find. |
I'm running on macbook m1(16gb ram)
|
So we have to solve two problems:
|
Some weird issue with
followed this for solution. No luck: https://discourse.julialang.org/t/running-external-programs-in-windows/72353/6?u=abhimanyuaryan Need to dig deeper I have 720p m1 air |
Try to execute the two lines that are also in the webcam2 and webcam3. Before you call open camera. import VideoIO
import Base.cconvert
Base.cconvert(::Type{Ptr{Ptr{VideoIO.AVDictionary}}}, d::VideoIO.AVDict) = d.ref_ptr_dict
cam = opencamera() |
will check/debug on weekend :) |
Not very clear what's causing this: JuliaIO/VideoIO.jl#343 says it's the frame rate. Have you tried running this default example? import VideoIO, GLMakie
import Base.cconvert
Base.cconvert(::Type{Ptr{Ptr{VideoIO.AVDictionary}}}, d::VideoIO.AVDict) = d.ref_ptr_dict
cam = VideoIO.opencamera()
img = read(cam)
scene = GLMakie.Scene(resolution = size(img'))
makieimg = GLMakie.image!(scene, img)
GLMakie.rotate!(scene, -0.5pi)
display(scene)
while isopen(scene)
read!(cam, img)
makieimg.image = img
sleep(1/VideoIO.framerate(cam))
end
close(cam) ERROR: LoadError: Could not scale frame
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] exec!
@ ~/.julia/dev/VideoIO/src/frame_graph.jl:109 [inlined]
[3] execute_graph!
@ ~/.julia/dev/VideoIO/src/avio.jl:456 [inlined]
[4] _retrieve!(r::VideoIO.VideoReader{true, VideoIO.SwsTransform, String}, buf::PermutedDimsArray{ColorTypes.RGB{FixedPointNumbers.N0f8}, 2, (2, 1), (2, 1), Matrix{ColorTypes.RGB{FixedPointNumbers.N0f8}}})
@ VideoIO ~/.julia/dev/VideoIO/src/avio.jl:467
[5] retrieve!
@ ~/.julia/dev/VideoIO/src/avio.jl:478 [inlined]
[6] read!(r::VideoIO.VideoReader{true, VideoIO.SwsTransform, String}, buf::PermutedDimsArray{ColorTypes.RGB{FixedPointNumbers.N0f8}, 2, (2, 1), (2, 1), Matrix{ColorTypes.RGB{FixedPointNumbers.N0f8}}})
@ VideoIO ~/.julia/dev/VideoIO/src/avio.jl:637
[7] top-level scope
@ ~/Git/VideoIO/videomakie.jl:14
[8] include(fname::String)
@ Base.MainInclude ./client.jl:444
[9] top-level scope
@ REPL[1]:1
in expression starting at /Users/abhi/Git/VideoIO/videomakie.jl:13 |
I have turned the WebCam Demo into a camera widget.
It's not yet very fast and can certainly be optimised, perhaps by using
VideoIO.jl
, that's why I currently leave it in broken.Whoever is interested, please try out and comment here.
The text was updated successfully, but these errors were encountered: