VideoIO.jl don't recognizes encodevideo() function anymore


Last week I was using VideoIO.jl package and everything was normal. Today I tried to encode a video and the function simply doesn’t exists anymore.

I searched in the GitHub page and noticed that the last update was yesterday, the changelog said that they removed encodevideo() function. Why?

Does anyone knows how to encode a video now? The documentation page isn’t updated yet.


Looks like that’s been replaced with

  save(filename::String, imgstack; ...)

  Create a video container filename and encode the set of frames imgstack into it. imgstack must be an iterable of
  matrices and each frame must have the same dimensions and element type.

  Encoding options, restrictions on frame size and element type, and other details are described in open_video_out.
  All keyword arguments are passed to open_video_out.

  See also: open_video_out, write, close_video_out!

Thanks for catching that the docs haven’t updated. I’ll look into that (Edit: now fixed). For now you can see the master docs by selecting the ‘dev’ version, which has the new format for encodevideo.

This release doesn’t remove any functionality, but is a breaking change release that does rework the API with the intention of making things more streamlined/standard. Also a lot of bug fixes.

Hopefully the full changelog makes the changes and motivations clear.

Please file any issues if you find them, I’m hoping we can stabilize 0.9 and make a 1.0 release next.


By the way, I recommend using a Project.toml with compat entries to avoid package breaking change releases breaking your code. If you don’t already, you’ll thank yourself later if you start doing it :slight_smile:



Trying to follow the documentation and using the new “save” method in a very simple example…

using PyPlot; pygui(true)
using VideoIO

encoder_options = (crf=23, preset="medium")
imagestack = map(x->rand(Float64, 10, 10), 1:100) #vector of 2D arrays
for i in eachindex(imagestack)
    imagestack[i] = rand(10,10)
end"testvideo.mp4", imagestack, framerate=24, encoder_options=encoder_options)

… I receive the following error:

ERROR: LoadError: MethodError: no method matching #VideoWriter#29(::Nothing, ::Int64, ::Bool, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Int64, ::Nothing, ::Bool, ::Nothing, ::Nothing, ::Type{VideoIO.VideoWriter}, ::String, ::Type{Float64}, ::Tuple{Int64,Int64})
Closest candidates are:
  #VideoWriter#29(::Union{Nothing, AbstractString}, ::Real, ::Bool, ::Union{AbstractDict{Union{},Union{}}, AbstractDict{Symbol,#s200} where #s200, NamedTuple}, ::Union{AbstractDict{Union{},Union{}}, AbstractDict{Symbol,#s200} where #s200, NamedTuple}, ::Union{AbstractDict{Union{},Union{}}, AbstractDict{Symbol,#s200} where #s200, NamedTuple}, ::Union{AbstractDict{Union{},Union{}}, AbstractDict{Symbol,#s200} where #s200, NamedTuple}, ::Union{AbstractDict{Union{},Union{}}, AbstractDict{Symbol,#s200} where #s200, NamedTuple}, ::Union{Nothing, Int32}, ::Any, ::Any, ::Any, ::Union{AbstractDict{Union{},Union{}}, AbstractDict{Symbol,#s200} where #s200, NamedTuple}, ::Union{Nothing, Int64}, ::Type{VideoIO.VideoWriter}, ::AbstractString, ::Type{T}, ::Tuple{Integer,Integer}) where T at C:\Users\bauermar\.julia\packages\VideoIO\w6BET\src\encoding.jl:245
 [1] VideoIO.VideoWriter(::String, ::Type{Float64}, ::Tuple{Int64,Int64}) at C:\Users\bauermar\.julia\packages\VideoIO\w6BET\src\encoding.jl:245
 [2] VideoIO.VideoWriter(::String, ::Array{Float64,2}; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\bauermar\.julia\packages\VideoIO\w6BET\src\encoding.jl:369
 [3] VideoIO.VideoWriter(::String, ::Array{Float64,2}) at C:\Users\bauermar\.julia\packages\VideoIO\w6BET\src\encoding.jl:369
 [4] open_video_out(::String, ::Array{Float64,2}; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\bauermar\.julia\packages\VideoIO\w6BET\src\encoding.jl:463
 [5] open_video_out(::String, ::Array{Float64,2}) at C:\Users\bauermar\.julia\packages\VideoIO\w6BET\src\encoding.jl:463
 [6] open_video_out(::VideoIO.var"#34#35"{Array{Array{Float64,2},1}}, ::String, ::Array{Float64,2}; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\bauermar\.julia\packages\VideoIO\w6BET\src\encoding.jl:467
 [7] open_video_out(::Function, ::String, ::Array{Float64,2}) at C:\Users\bauermar\.julia\packages\VideoIO\w6BET\src\encoding.jl:467
 [8] save(::String, ::Array{Array{Float64,2},1}; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\bauermar\.julia\packages\VideoIO\w6BET\src\encoding.jl:492
 [9] save(::String, ::Array{Array{Float64,2},1}) at C:\Users\bauermar\.julia\packages\VideoIO\w6BET\src\encoding.jl:492
 [10] top-level scope at d:\Research\Programming\julia\VideoExportScript\videoExportScript.jl:12
in expression starting at d:\Research\Programming\julia\VideoExportScript\videoExportScript.jl:12

Same happens when I try to use the “example saving a series of png files as a video” directly from the documentation (and which is exactly what I would like to do).

Any ideas why just fails? I first thought it could be a version problem, but shouldn’t. My version is v0.9.5 which should have the method instead of VideoIO.encodevideo


So I found out that according to

this is a julia version conflict!!

VideoIO v0.9 is not working with julia v1.4, which I had accidentally used in this project.
I am usually using julia v1.6 and just tested… is working fine with this version!!