Thumbnail generation for auto-upload doesn't work unless the video has already been auto uploaded


1 comment

  • Avatar
    Stephen Doyle

    Hi Dan,

    The auto-upload mapping should trigger when you first attempt to access the asset, regardless of whether it's a derived (transformed) version of the asset, or the original URL for the asset.

    From what you've said, the reason for the error you encountered is most likely because your example URL ends with ".jpg".

    Where a requested file doesn't exist, we don't know that the corresponding file on the remote server or storage bucket is an MP4 video, and the auto-upload request to the remote URL uses the same file extension as the request that we received from you / your user. In this example case, it's .jpg and we'll try to fetch {assetName}.jpg from the remote URL, where it likely returns a 404 error to us (you may see this in the x-cld-error header of our response to you) - effectively we have no way to know from our side that the remote file isn't a jpg, or to know what extension it should be instead.

    The ways to resolve this are either to
    1) Have the file uploaded to your account first by using the API or by making another request which triggers the auto-upload mapping and which ends in .mp4 so that's included on our request to the remote server. After that first request, when the file exists in your account, the extension on the URL is only relevant for telling us which format to return the (existing) asset in, so your later requests with .jpg at the end will work as you expected.

    2) Set the .mp4 extension on the URL for the derived asset also, and add the fetch_format transformation (f_ in URLs) to request that it's returned in .jpg format instead:

    Using your example, a request like this should work first-time:{myProject}/video/upload/c_thumb,f_jpg,w_{videoSize}/{assetName}.mp4

    If not, please let us know what error you're seeing - if you want to include account information or specific URLs, you can also create a request for our team directly using the "submit a request" link on the top of the support site homepage

    Comment actions Permalink

Please sign in to leave a comment.