Closed maxruby closed 9 years ago
Getting that in openvideo
too (after fixing #49):
julia> v = VideoIO.openvideo("/home/beyer/data/bbenfold/TownCentreXVID.avi")
ERROR: `convert` has no method matching convert(::Type{AVFrame})
in VideoReader at /home/beyer/.julia/v0.4/VideoIO/src/avio.jl:303
in VideoReader at /home/beyer/.julia/v0.4/VideoIO/src/avio.jl:281
in VideoReader at /home/beyer/.julia/v0.4/VideoIO/src/avio.jl:364
in openvideo at /home/beyer/.julia/v0.4/VideoIO/src/avio.jl:482
I think it's because the function AVFrame
is not defined for newer versions of ffmpeg. If I grep for it, all I find is:
><((("> ag 'function AVFrame' lb
src/libav/AVUtil/v53/LIBAVUTIL.jl
22:function AVFrame()
src/libav/AVCodecs/v54/LIBAVCODEC.jl
5:function AVFrame()
src/libav/AVCodecs/v53/LIBAVCODEC.jl
5:function AVFrame()
src/ffmpeg/AVUtil/v52/LIBAVUTIL.jl
26:function AVFrame()
src/ffmpeg/AVCodecs/v53/LIBAVCODEC.jl
7:function AVFrame()
compare to:
julia> VideoIO.versioninfo()
Using ffmpeg
AVCodecs version 56.1.100
AVFormat version 56.4.101
AVUtil version 54.7.100
SWScale version 3.0.100
AVDevice version 56.0.100
AVFilters version 5.1.100
Actually, I find AVFrame() in
src/ffmpeg/AVUtil/v54/LIBAVUTIL.jl
src/ffmpeg/AVUtil/v52/LIBAVUTIL.jl
Now, the following sequence of calls for AVFrame()
using VideoIO
using AVUtil
AVUtil/src/AVUtil.jl
include(w("LIBAVUTIL.jl"))
=> function AVFrame()
According to this, AVFrame() should be loaded. However, the conversion is still a problem with Type{AVFrame}, which we need to locate in the code.
The error is most definitely at lines 296 and 299 in src/avio.jl
# Type AVFrame is indeed defined in VideoIO
julia> typeof(VideoIO.AVFrame)
DataType
# However, initializing it as a vector in function VideoReader() fails
julia> aVideoFrame = [VideoIO.AVFrame()]
ERROR: `convert` has no method matching convert(::Type{AVFrame})
julia> aTargetVideoFrame = [VideoIO.AVFrame()]
ERROR: `convert` has no method matching convert(::Type{AVFrame})
Something about the conversion of AVFrame in v0.4-dev is the source of the failure. Lets see if we can fix this.
Sorry, I have 2 separate installations of VideoIO (one with v0.3 which works fine and a second one under v0.4-dev). The one associated with v0.4-dev
was missing AVFrame()
. I added AVFrame()
alone to
src/ffmpeg/AVUtil/v54/LIBAVUTIL.jl
This fixed the problem and now opencamera()
works. Can you try it on your side with openvideo()
to confirm this works for you too?
I was about to suggest trying to call AVFrame()
in the terminal :) Yes, that works. I didn't want to just copy-paste it over from v52
because I wonder
It should be relatively easy to reduce duplication in VideoIO but I would suggest to wait until #47 is processed. Regarding AVFrame, it is a custom function likely added manually to LIBAVUTIL.jl
Just to verify: yes, AVFrame
was added by hand. I also added it by hand to src/ffmpeg/AVUtil/v54/LIBAVUTIL.jl, as @maxruby did above, and committed that change as part of 26b301cb. Can you run Pkg.update()
and see if this is fixed?
@maxruby, sorry, this is going to screw up your pull request.
Since both of you have push access, please feel free to push fixes for things like these in the future. If you're unsure, you can always just make a pull request, but anything obviously wrong can be fixed again in the future.
(Obviously, if you don't have time for a fix, a bug report is still welcome!) Cheers, and sorry for the delay.
It works, thanks.
I forgot I had push access, sorry^^
No worries--glad it's fixed!
Somewhat related, at some point, there was discussion of moving a few repositories to a JuliaImages (or some such) organization. I'll try to get that discussion going again this week.
Sounds good, please ping when you do.
In julia dev v0.4.0, opencamera complains about "convert" of ::Type{AVFrame}.