Unable to get thumbnail for custom approach on Android TV

In AndroidTV, custom approach, Unable to get the thumbnail via “player.source?.getThumbnail(time)”, getting null for the given

   bundle.putString("URL","https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd")
                bundle.putString("thumbnailtrack","https://bitmovin-a.akamaihd.net/content/MI201109210084_1/thumbnails/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.vtt")

              

Hi @malviya.software ,

Thanks for your query. I tested with following source config and am able to see thumbnail information as expected. Can you please check in BasicPlaybackKotlin or BasicPlaybackTVKotlin sample application and check if this works for you?

SourceConfig

       val sourceURL = "https://bitmovin-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd"
        var sourceConfig = SourceConfig(sourceURL, SourceType.Dash)
        sourceConfig.thumbnailTrack = ThumbnailTrack("https://bitmovin-a.akamaihd.net/content/MI201109210084_1/thumbnails/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.vtt")

        player.load(sourceConfig)

Checking thumbnails in TimeChanged event

    private fun onTimeChanged(event: PlayerEvent.TimeChanged) {
        var thumbnail = player.source?.getThumbnail(player.currentTime)
        Log.d("BasicPlaybackTVKotlin", "onTimeChanged: currentTime=" + player.currentTime + ", thumbnail=" + thumbnail)
    }

Get following logs

D/BasicPlaybackTVKotlin: onTimeChanged: currentTime=9.731, thumbnail=Thumbnail(start=5.0, end=10.0, x=120, y=0, width=120, height=67, uri=https://bitmovin-a.akamaihd.net/content/MI201109210084_1/thumbnails/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.jpg, text=f08e80da-bf1d-4e3d-8899-f0f6155f6efa.jpg#xywh=120,0,120,67)
D/BasicPlaybackTVKotlin: onTimeChanged: currentTime=9.933, thumbnail=Thumbnail(start=5.0, end=10.0, x=120, y=0, width=120, height=67, uri=https://bitmovin-a.akamaihd.net/content/MI201109210084_1/thumbnails/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.jpg, text=f08e80da-bf1d-4e3d-8899-f0f6155f6efa.jpg#xywh=120,0,120,67)
D/BasicPlaybackTVKotlin: onTimeChanged: currentTime=10.151, thumbnail=Thumbnail(start=10.0, end=15.0, x=240, y=0, width=120, height=67, uri=https://bitmovin-a.akamaihd.net/content/MI201109210084_1/thumbnails/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.jpg, text=f08e80da-bf1d-4e3d-8899-f0f6155f6efa.jpg#xywh=240,0,120,67)
D/BufferPoolAccessor2.0: bufferpool2 0xb4000078d29637d8 : 5(40960 size) total buffers - 5(40960 size) used buffers - 1/7 (recycle/alloc) - 6/507 (fetch/transfer)
D/BasicPlaybackTVKotlin: onTimeChanged: currentTime=10.359, thumbnail=Thumbnail(start=10.0, end=15.0, x=240, y=0, width=120, height=67, uri=https://bitmovin-a.akamaihd.net/content/MI201109210084_1/thumbnails/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.jpg, text=f08e80da-bf1d-4e3d-8899-f0f6155f6efa.jpg#xywh=240,0,120,67)

Hi @malviya.software , just checking in if you are able to get thumbnails successfully as demonstrated in previous comment or if you have further questions on this topic.

Thanks and Regards,
Lucky Goyal

Hi Lucky,
thanks for your reply. I tried per described approach. I am getting sprite instead of a frame.

Can you please tell, me how to get the frame for the given “player.currentTime”?

I have attached the video. Please have a look.

> Thumbnail log:
[You can see the thumbnail video here]

Hi @malviya.software ,

thanks for sharing the video recording as well as log file, makes much easier to understand the question.

2023-02-13 04:51:28.182 D/PlayerUI: showThumbnail Thumbnail(start=75.0, end=80.0, x=120, y=134, width=120, height=67, uri=https://bitmovin-a.akamaihd.net/content/MI201109210084_1/thumbnails/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.jpg, text=f08e80da-bf1d-4e3d-8899-f0f6155f6efa.jpg#xywh=120,134,120,67)

The specific image within the sprite image is defined by xywh co-ordinates. For example, in the above log statement for thumbnail information, there are 2 components

Bitmap.createBitmap(
                    thumbnailSpriteImage,
                    thumbnail.x,
                    thumbnail.y,
                    thumbnail.w,
                    thumbnail.h
                )

Additionally, some basic cache mechanism may be used to avoid re-downloading sprite image as each sprite image contains multiple thumbnail images.

I hope this information is helpful. Please do let us know if there are any further questions.

Thanks and Regards,
Lucky Goyal

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.