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

get_prpgress function of VideoReader can compatible with more video format #3376

Closed
Thatwho opened this issue Jun 29, 2021 · 2 comments · Fixed by #3381
Closed

get_prpgress function of VideoReader can compatible with more video format #3376

Thatwho opened this issue Jun 29, 2021 · 2 comments · Fixed by #3381
Labels
enhancement New feature or request

Comments

@Thatwho
Copy link
Contributor

Thatwho commented Jun 29, 2021

My actions before raising this issue

while extract from video with typical format, like mkv, it can't show precise progress. Like shown in the code:

    def get_progress(self, pos):
        container = self._get_av_container()
        # Not for all containers return real value
        stream = container.streams.video[0]
        return pos / stream.duration if stream.duration else None

VideoStream object may not have a real duration value.

Expected Behaviour

But we can find duration information from metadata of VideoStream object, then we can calculate precise progress instead of showing "Images are being compressed |/-\"

@azhavoro azhavoro added the enhancement New feature or request label Jun 30, 2021
@azhavoro
Copy link
Contributor

@Thatwho Hi, thanks for the suggestion, would you like to prepare a PR for this?

@Thatwho
Copy link
Contributor Author

Thatwho commented Jul 1, 2021

@Thatwho Hi, thanks for the suggestion, would you like to prepare a PR for this?

Of course! I had made a PR which is #3381. Please let me know the PR has any error.

@azhavoro azhavoro linked a pull request Jul 1, 2021 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants