JuliaIO / VideoIO.jl

Reading and writing of video files in Julia via ffmpeg
https://juliaio.github.io/VideoIO.jl/stable
Other
128 stars 53 forks source link

playvideo example from docs not working #326

Closed anandijain closed 3 years ago

anandijain commented 3 years ago

https://juliaio.github.io/VideoIO.jl/stable/reading/#Video-Playback

julia> f = VideoIO.testvideo("annie_oakley")  # downloaded if not available
Downloading annie_oakley.ogg to C:\Users\Anand\.julia\packages\VideoIO\9V6Rm\src\..\videos
AVInput(C:\Users\Anand\.julia\packages\VideoIO\9V6Rm\src\..\videos\annie_oakley.ogg, ...), with
  1 video stream(s)

julia> VideoIO.playvideo(f)
ERROR: type VideoReader has no field height
Stacktrace:
 [1] getproperty(x::VideoIO.VideoReader{true, VideoIO.SwsTransform, String}, f::Symbol)
   @ Base .\Base.jl:33
 [2] play(f::VideoIO.VideoReader{true, VideoIO.SwsTransform, String}; flipx::Bool, flipy::Bool, pixelaspectratio::Nothing)
   @ VideoIO ~\.julia\packages\VideoIO\9V6Rm\src\VideoIO.jl:140
 [3] playvideo(video::VideoIO.AVInput{String}; flipx::Bool, flipy::Bool, pixelaspectratio::Nothing)
   @ VideoIO ~\.julia\packages\VideoIO\9V6Rm\src\VideoIO.jl:163
 [4] playvideo(video::VideoIO.AVInput{String})
   @ VideoIO ~\.julia\packages\VideoIO\9V6Rm\src\VideoIO.jl:162
 [5] top-level scope
   @ REPL[14]:1

julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 4
JakeZw commented 3 years ago

I too am having this same issue. I am struggling to get something working as documented here. I am using Julia Version 1.6.1 on Windows 10.

JakeZw commented 3 years ago

I have something working now. You are welcome to use it here. The only thing I don't yet have working is querying the file for the framerate. The method used in the existing sample code does not work. If anyone knows how to do that please update the example.

anandijain commented 3 years ago

yeah i was going to open an issue about getting the framerate too

JakeZw commented 3 years ago

I edited my response to include a method to calculate the frame rate that seems to work for mp4 files but does not work on the annie.oakly video, perhaps because it is a different format?