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

feat(info.jl): added get_fps #392

Closed
wants to merge 2 commits into from
Closed

feat(info.jl): added get_fps #392

wants to merge 2 commits into from

Conversation

AbelHo
Copy link

@AbelHo AbelHo commented Feb 8, 2023

function to retrieve video fps

@codecov
Copy link

codecov bot commented Feb 8, 2023

Codecov Report

Base: 79.40% // Head: 78.78% // Decreases project coverage by -0.62% ⚠️

Coverage data is based on head (c174b08) compared to base (98739b9).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #392      +/-   ##
==========================================
- Coverage   79.40%   78.78%   -0.62%     
==========================================
  Files          10       10              
  Lines        1277     1287      +10     
==========================================
  Hits         1014     1014              
- Misses        263      273      +10     
Impacted Files Coverage Δ
src/info.jl 75.00% <0.00%> (-25.00%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@IanButterworth
Copy link
Member

VideoIO.framerate(f) exists, but I notice it is only mentioned in passing in the manual.

Does that meet your needs? If so can you PR to add that to the manual.

Thanks!

@AbelHo
Copy link
Author

AbelHo commented Feb 8, 2023

Thanks for your quick response!
VideoIO.framerate(f) gives 1//0 for the videos I have. I hope I am not doing something wrong?

@IanButterworth
Copy link
Member

I think it requires that at least one frame has been read. Can you test that?

Perhaps that's fixable

@AbelHo
Copy link
Author

AbelHo commented Feb 8, 2023

The following is what I did:

vid = VideoIO.openvideo("somefile.mp4")
img = read(vid);
VideoIO.framerate(vid)

3 out of 5 video still gives:
1//0

2 out of 5 video successfully give the frame rate after reading one frame

@IanButterworth
Copy link
Member

Can you try #393

@AbelHo
Copy link
Author

AbelHo commented Feb 9, 2023

Results from the current master branch before:

julia> VideoIO.framerate.(VideoIO.openvideo.(fnames))
5-element Vector{Rational{Int32}}:
 1//0
 1//0
 1//0
 1//0
 1//0

julia> map(fnames) do x
               vid=VideoIO.openvideo(x); read(vid); VideoIO.framerate(vid)
       end
5-element Vector{Rational{Int32}}:
    1//0
   50//1
 3840//1
    1//0
    1//0

julia> get_fps.(fnames)
5-element Vector{Rational{Int64}}:
 30//1
 25//1
 30//1
 25//1
 25//1

@AbelHo
Copy link
Author

AbelHo commented Feb 9, 2023

Can you try #393

Thank you.
tested, added results for both before and after changes, here and in #393 respectively

@IanButterworth
Copy link
Member

@AbelHo thanks for the help here. I'm going to close this and try to finish all the framerate fixes over in #393

I'd appreciate your review there as I can't see why tests are failing currently

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

Successfully merging this pull request may close these issues.

2 participants