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

Added support for Thumbnails in DASH #10793

Merged
merged 7 commits into from
Feb 1, 2023

Conversation

gorkemg
Copy link

@gorkemg gorkemg commented Nov 18, 2022

This PR enhances the DashManifest class to allow fetching Thumbnail Meta Data for a video position and with that allowing to display thumbnail images while seeking through a video, as discussed in issue #3752 by my colleague @suraneau.

This approach is similar to how dash.js handles thumbnails. Only the metadata (like the URL) for the thumbnail is provided by ExoPlayer via a new API. The tasks of loading, caching, crop/zoom and rendering of the (tile) images will be done by the external app/UI logic.

The demo app has been enhanced as well to use this new API and display thumbnail images above the seek bar. A few streams have been added for testing.

We're looking forward to your feedback.
Thank you!

Best regards,
Görkem

…for a video position and with that allowing to display thumbnail images while seeking through a video.

The demo app has beed enhanced to use this new API and display thumbnail images above the seek bar while scrubbing.
@tonihei
Copy link
Collaborator

tonihei commented Nov 21, 2022

Thanks for sharing the code in a PR!

I think the general direction doesn't yet fully align with the discussion in #3752 because it looks like your proposal is moving the entire loading and caching out of the player to let the app handle this separately. This is not ideal because it means the app has to replicate many parts of the logic that lives inside the player already (how to load data, how to cache it, find the appropriate next sample after a seek, handling adaptive switches between resolutions etc). As a first step, this may still be appropriate just to make sure an app can do this if wants to.

The app can access the DashManifest object directly by calling (DashManifest) player.getManifest(). So the goal should be to parse and represent the thumbnail segments inside the usual AdaptationSet / Representation / SegmentTemplate classes. The grid size of the thumbnail images can be set in the Format object via a new image-specific field (e.g. tileCountHorizontal, tileCountVertical). This corresponds to step 1 in #3752 (comment).
After this is done, the remaining code can live in each individual app for now until we get around to handle the other mentioned improvements.

…leCountVertical' to class Format. DashManifestParser adjusted to parse these values from an EssentialProperty tag of an Image AdaptationSet. With this change, DashManifest does not have to do any parsing inside the new getThumbnailDescriptions() method. Moreover, both classes ThumbnailDescription and ThumbnailProvider adjusted to use these two properties / naming scheme accordingly.
@gorkemg
Copy link
Author

gorkemg commented Dec 5, 2022

Hi @tonihei,

thank you for your very quick response.

As my colleague @suraneau mentioned in the discussion in #3752 , we were aiming to implement the approach similar to dash.js by offering a thumbnail API to easily fetch thumbnail information for App developers - as requested by companies in the discussion and as typically needed for DASH playback.
As you mentioned, we also understand that it makes sense to reuse logic already available in the player.
However, just like you wrote, we think this is a great first step in that direction.
With this PR merged, App developers can already start implementing the thumbnail seek bar into their apps for DASH playback, even reusing the seek bar we provided in the ExoPlayer demo application.

I looked into your suggestion for adding two new properties, tileCountHorizontal and tileCountVertical, to Format, so that the DashManifestParser can parse that information and have it available in the DashManifest by simply using representation.format.tileCountHorizontal, since this is a critical detail missing currently in the DashManifest.

I fully agree and adjusted Format accordingly by adding these two new properties in my last commit.
Additionally, DashManifestParser will now parse the EssentialProperty tag inside an Image AdaptationSet and parse these two values into Format.
With this change, our new method getThumbnailDescriptions() can simply access this data without any additional parsing.

We're again looking forward to your feedback.
Thank you!

Best regards,
Görkem

@tonihei
Copy link
Collaborator

tonihei commented Dec 21, 2022

Thanks for the updates! Could you just keep the changes to DashManifest(Parser) and Format and remove the remaining changes from the PR? As far as I see they are not needed for the initial parsing proposal and can be added/implemented by apps as required.

@gorkemg
Copy link
Author

gorkemg commented Jan 17, 2023

Hi @tonihei,
I removed the files and also merged dev-v2 again to remove a merge conflict in Format.
Looking forward to your feedback.
Thanks!

Best regards,
Görkem

@tonihei
Copy link
Collaborator

tonihei commented Jan 31, 2023

Thanks for the update! I'll merge the changes internally, but without the ThumbnailDescription part (which can be done in app code if needed).

@christosts christosts merged commit 107e0c6 into google:dev-v2 Feb 1, 2023
christosts added a commit that referenced this pull request Feb 15, 2023
PiperOrigin-RevId: 506261584
(cherry picked from commit 107e0c6)
tonihei pushed a commit that referenced this pull request Mar 2, 2023
tonihei pushed a commit that referenced this pull request Mar 2, 2023
PiperOrigin-RevId: 506261584
(cherry picked from commit c6569a3)
@google google locked and limited conversation to collaborators Apr 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants