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

VideoDecoder decodes keyframe to retrieve video resolution #120

Open
haydenmc opened this issue Apr 7, 2021 · 0 comments
Open

VideoDecoder decodes keyframe to retrieve video resolution #120

haydenmc opened this issue Apr 7, 2021 · 0 comments

Comments

@haydenmc
Copy link
Member

haydenmc commented Apr 7, 2021

As part of #87, VideoDecoder is now capable of retrieving the width/height of a video stream. However, to do this, it must be provided a keyframe sequence that it will decode via libav. As a result, the metadata report thread now ends up decoding keyframes twice - first to retrieve the video dimensions, and a second time to generate a JPEG preview image.

It's also worth considering using a different approach to extract the resolution from H264 video. SPS NAL units should contain the information we need. There's some good reference code from the WebRTC implementation here. This will save us from having to decode an entire frame just to get the width/height information.

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

1 participant