Is there a simple way of making a sequence of 3d array of UInt8 into a video?

Is there a simple way to save a sequence of Array{UInt8, 3} as a video? Can’t find any documentation on this. Writing Videos · VideoIO.jl (juliaio.github.io)

I want to do something like:

import VideoIO
imgstack = map(x->rand(UInt8, 100, 100, 3), 1:100)  #vector of 3D arrays. RGB.
encoder_options = (crf=23, preset="medium")
VideoIO.save("video.mp4", imgstack, framerate=30, encoder_options=encoder_options)

This works for grayscale images i.e., when framestack = map(x->rand(UInt8, 100, 100), 1:100) #vector of 2D arrays.

Would appreciate any help.

https://juliaio.github.io/VideoIO.jl/latest/writing/#Supported-Colortypes

you need RGB{N0f8} as eltype if you want to produce colored video output

1 Like