Coincidentally, I was just trying something similar yesterday. I found that VideoIO by default transcodes into RGB (from the more usual YUV format that webcams produce) which slows down the data capture quite a bit. You could try disabling the transcoding (since it’s unnecessary if you are just piping out to a file) with the transcode=false in the opencamera call. However, that hits some only partially implemented code paths but I put a PR to VideoIO with some fixes in https://github.com/JuliaIO/VideoIO.jl/pull/277 but they could definitely use more testing.
That said, I’ve just noticed you aren’t actually timing the data acquisition…
Wow, sounds promising! I think I can copypaste a build-script from BinaryBuilder.jl to build a version of ffmpeg that uses the h264_omx codec instead and then fork VideoIO and change its dependency to use thatFFMPEG_jll instead?
Ideally, installing VideoIO would involve checking which system it’s installed on and changing its dependency accordingly… But that sounds like science fiction.
I’ll give it a try. Currently it’s the only viable solution I have to move forward on this front.