What is the best way to reference a thumbnail generated from encoding?

Anthony Metcalfe 21 Reputation points
2020-11-17T19:38:41.833+00:00

Hello,

I'm currently upgrading our AMS system from v2 to v3. We are using two transforms that point to the same output asset: one standard Adaptive Streaming one for video, and a {Best} macro thumbnail generation. It generates the thumbnail just fine, and I can access it via the portal, but there doesn't seem to be an easy way to reference it in the website we are displaying the videos.

In v2, we had generated thumbnails as a separate asset from the encoded video and were able to create a URI using that asset's locator. Now that v3 has switched to "StreamingLocator"s, however, I only see how to create references for the HLS / Dash / Smooth Streaming URIs (by following the tutorial's GetStreamingUrlsAsync function found here.

Is there a recommended best way to be able to display a thumbnail generated? We can always use blob storage services to access the file, but ideally we would be able to continue using the existing streaming URI approach.

Thank you!
Anthony

Azure Media Services
Azure Media Services
A group of Azure services that includes encoding, format conversion, on-demand streaming, content protection, and live streaming services.
316 questions
0 comments No comments
{count} votes

Accepted answer
  1. David Bristol 971 Reputation points Microsoft Employee
    2020-11-17T21:28:47.123+00:00

    If the thumbnail is in the same asset as the video, when you create the locator (publish) you would have to use the Predefinied_DownloadAndClearStreaming streaming policy to allow for the thumbnail download. Note that the 'Predefined_ClearStreamingOnly' means that only the MPEG-DASH, Smooth Streaming, or HLS protocols can be used. A download of the JPG / PNG will not work over those protocols. Keep in mind that with the DownloadAndClearStreaming policy this means that the MP4 files in the asset can be downloaded as well. Additionally, if you use content protection (DRM) on the streaming policy the download for the thumbnail will not work.

    If you would like to use separate assets for your thumbnail similar to what you had for v2, you can create a custom transform that produces just the thumbnail with the following script and the instructions on https://video2.skills-academy.com/en-us/azure/media-services/latest/custom-preset-cli-howto.

    {  
        "@odata.type": "#Microsoft.Media.StandardEncoderPreset",  
        "codecs": [  
            {  
                "@odata.type": "#Microsoft.Media.JpgImage",  
                "stretchMode": "AutoSize",  
                "start": "{Best}",  
                "quality": "70",  
                "layers": [  
                    {  
                        "width": "480",  
                        "height": "270"  
                    }  
                ]  
            }  
        ],  
        "formats": [  
            {  
                "@odata.type": "#Microsoft.Media.JpgFormat",  
                "filenamePattern": "Thumbnail-{Basename}-{Index}{Extension}"  
            }  
        ]  
    }  
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.