Hi
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
VideoIO.save("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
Stacktrace:
[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 VideoIO.save() just fails? I first thought it could be a version problem, but shouldn’t. My version is v0.9.5 which should have the Video.save method instead of VideoIO.encodevideo
Thanks!