Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frame rate for AVI broken #349

Open
bjarthur opened this issue Mar 30, 2022 · 1 comment
Open

frame rate for AVI broken #349

bjarthur opened this issue Mar 30, 2022 · 1 comment

Comments

@bjarthur
Copy link
Member

julia> VideoIO.framerate(video_reader)
1//0

but if instead i examine the code for seek i can get the correct value:

julia> convert(Rational, video_reader.avin.format_context.streams[1].time_base)
1//10

the framerate method is currently defined as

framerate(f::VideoReader) = f.codec_context.time_base.den // f.codec_context.time_base.num

presumably that works for some formats, just not AVI. what's the best way to redefine it to work with everything?

@maetshju
Copy link

maetshju commented Jul 21, 2022

I have also just run into this behavior. For what it's worth, the framerate method works properly for me if you have called read on the VideoReader object first. By example:

x = openvideo("vid.avi");
VideoIO.framerate(x) # gives 1//0
read(x);
VideoIO.framerate(x) # gives correct framerate

This is using VideoIO v1.0.3 on Julia v1.7.3 on Windows 11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants