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

[WIP] Add get_video_metadata() and associated dataclasses #48

Closed
wants to merge 8 commits into from

Conversation

NicolasHug
Copy link
Member

@NicolasHug NicolasHug commented Jun 24, 2024

This PR Implements https://docs.google.com/document/d/1OislJC2eeaI2X38Ufy8fDRJDrEj1lcSNtZ-8L-CeQm8/edit from @scotts.

Main changes:

  • Add the dataclasses from the design doc, all untouched

  • Added 2 new private custom ops:

    • _get_container_json_metadata(decoder)
    • _get_stream_json_metadata(decoder, stream_index)

    This is needed because the existing get_json_metadata() just returns the stream metadata of the best stream, but we want the VideoMetadata dataclass to provide the metadata of all existing streams.

Some thoughts / remarks:

  • Some basic tests fail on FFmpeg 6 and 7. Looks like FFmpeg changed the way it computes the container metadata after FFmpeg 6. This looks eerily similar to this existing TODO which @ahmadsharif1 is investigating.
  • I'm keeping the existing get_json_metadata() C++ and Python functions untouched. This is because it's currently in use internally, and it'll be easier to migrate that internal code in a separate diff.
  • We are still in the business of manually creating a json string from C++. We may prefer doing things differently in the future but for now this is OK, and in any case revamping this isn't in scope for this PR.

Not done yet: probe_video_metadata_headers(). LMK if you prefer it to be done here, or in a follow-up PR.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 24, 2024
@NicolasHug NicolasHug changed the title [WIP] Metadata [WIP] Add get_video_metadata() and associated dataclasses Jun 24, 2024
@facebook-github-bot
Copy link
Contributor

@NicolasHug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@NicolasHug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@NicolasHug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@NicolasHug NicolasHug closed this Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants