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

Add utility function get_number_frames #260

Merged
merged 1 commit into from
Aug 17, 2020

Conversation

galenlynch
Copy link
Collaborator

@galenlynch galenlynch commented Aug 17, 2020

There is currently no way to query a video container to determine the number of video frames that it contains, besides decoding the video and counting the frames. While this is the best you can do for some container formats, other container formats can report the number of frames without decoding each video frame. I have added a new function, get_number_frames, which will query the container and return the number of frames, if applicable, or return nothing otherwise. This function will not decode the video stream in order to determine the number of frames.

I have additionally added simple tests of this function, a documentation string, and added it to the docs.

There is currently no way to query a video container to determine the number of
video frames that it contains, besides decoding video and counting the frames.
While this is the best you can do for some container formats, other container
formats can report the number of frames without decoding each video frame. I
have added a new function, `get_number_frames`, which will query the container
and return the number of frames, if applicable, or return `nothing` otherwise.
This function will not decode the video stream in order to determine the number
of frames.

I have additionally added simple tests of this function, a documentation string,
and added it to the docs.
@codecov
Copy link

codecov bot commented Aug 17, 2020

Codecov Report

Merging #260 into master will increase coverage by 0.30%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #260      +/-   ##
==========================================
+ Coverage   76.83%   77.13%   +0.30%     
==========================================
  Files          14       14              
  Lines         600      608       +8     
==========================================
+ Hits          461      469       +8     
  Misses        139      139              
Impacted Files Coverage Δ
src/info.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e69f3ff...9cbeff5. Read the comment docs.

@IanButterworth
Copy link
Member

Nice 👍

@IanButterworth IanButterworth merged commit 0f211c2 into JuliaIO:master Aug 17, 2020
@galenlynch galenlynch deleted the nframes branch August 17, 2020 13:14
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