JuliaIO / VideoIO.jl

Reading and writing of video files in Julia via ffmpeg
https://juliaio.github.io/VideoIO.jl/stable
Other
126 stars 53 forks source link

How to call retrieve! with custom buffer? #210

Open Tagussan opened 5 years ago

Tagussan commented 5 years ago

Hi, Since the function retrieve! is defined as function retrieve!(r::VideoReader{TRANSCODE}, buf::VidArray{T}) where T <: EightBitTypes in src/avio.jl, I cannot call retrieve! with custom buffer.

I would like to read 16 bit Gray image. First, I defined N0f16 = FixedPointNumbers.Normed{UInt16,16} and let buf = VideoIO.permuteddimsview(Matrix{VideoIO.Gray{VideoIO.N0f16}}(undef, cam.width, cam.height), (2, 1)). cam is a video reader. Then I called retrieve!(cam, buf) and got error.

Are there any workaround?