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

**URL:** <https://discourse.julialang.org/t/videoio-jl-dont-recognizes-encodevideo-function-anymore/58479>\
**Category:** General Usage\
**Tags:** question, package, videoio\
**Created:** [April 3, 2021, 2:57am UTC](https://discourse.julialang.org/t/videoio-jl-dont-recognizes-encodevideo-function-anymore/58479 "2021-04-03T02:57:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Renan\_Rabelo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/renan_rabelo/32/8048_2.png) [@Renan\_Rabelo](https://discourse.julialang.org/u/Renan_Rabelo)\
**Post date:** [April 3, 2021, 2:57am UTC](https://discourse.julialang.org/t/videoio-jl-dont-recognizes-encodevideo-function-anymore/58479/1 "2021-04-03T02:57:50Z")

</div>

Hi,

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](https://github.com/JuliaIO/VideoIO.jl/releases) 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](https://juliaio.github.io/VideoIO.jl/stable/writing/) page isn’t updated yet.

Thanks!

---

<div class="post-metadata">

**Author:** ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Post date:** [April 3, 2021, 3:29am UTC](https://discourse.julialang.org/t/videoio-jl-dont-recognizes-encodevideo-function-anymore/58479/2 "2021-04-03T03:29:29Z")

</div>

Looks like that’s been replaced with [VideoIO.save](https://juliaio.github.io/VideoIO.jl/latest/writing/#VideoIO.save):

```julia
help?> VideoIO.save
  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!

```

---

<div class="post-metadata">

**Author:** ![ianshmean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ianshmean/32/216042_2.png) [@ianshmean](https://discourse.julialang.org/u/ianshmean)\
**Post date:** [April 3, 2021, 7:39am UTC](https://discourse.julialang.org/t/videoio-jl-dont-recognizes-encodevideo-function-anymore/58479/4 "2021-04-03T07:39:43Z")

</div>

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 `VideoIO.save` 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](https://github.com/JuliaIO/VideoIO.jl/blob/master/CHANGELOG.md) 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.

---

<div class="post-metadata">

**Author:** ![ianshmean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ianshmean/32/216042_2.png) [@ianshmean](https://discourse.julialang.org/u/ianshmean)\
**Post date:** [April 3, 2021, 7:44am UTC](https://discourse.julialang.org/t/videoio-jl-dont-recognizes-encodevideo-function-anymore/58479/5 "2021-04-03T07:44:47Z")

</div>

> [@Renan\_Rabelo](#):
>
> 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.

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 🙂

---

<div class="post-metadata">

**Author:** ![itchy00](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/itchy00/32/30442_2.png) [@itchy00](https://discourse.julialang.org/u/itchy00)\
**Post date:** [November 2, 2021, 1:50pm UTC](https://discourse.julialang.org/t/videoio-jl-dont-recognizes-encodevideo-function-anymore/58479/6 "2021-11-02T13:50:19Z")

</div>

Hi

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

```julia
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:

```julia
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!

---

<div class="post-metadata">

**Author:** ![itchy00](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/itchy00/32/30442_2.png) [@itchy00](https://discourse.julialang.org/u/itchy00)\
**Post date:** [November 2, 2021, 4:12pm UTC](https://discourse.julialang.org/t/videoio-jl-dont-recognizes-encodevideo-function-anymore/58479/7 "2021-11-02T16:12:56Z")

</div>

So I found out that according to  
[https://github.com/JuliaIO/VideoIO.jl/issues/329](https://github.com/JuliaIO/VideoIO.jl/issues/329)

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… VideoIO.save() is working fine with this version!!
