Retrieve file and thumbnail url from AWS Elastic Transcoder job

后端 未结 2 1586
难免孤独
难免孤独 2021-01-01 05:11

I have a rails app which uploads videos to an AWS S3 bucket using their CORS configuration, when this is completed and the rails video object is created an Elastic Transcode

相关标签:
2条回答
  • 2021-01-01 05:38

    It passed 4 years after last reply. New Cold War raised, there are a lot of political tensions but Amazon sill doesn't fixed this issue.

    As workaround I found another solution: usually transcoded file (video/thumbnail) are placed into the new bucket. Or at least under some prefix. I created new S3 event for ObjectCreate(All) for target bucket and specified prefix and connected it to pre-created SNS topic. This topic pings my backend's endpoint twice - first time when video transcoded and second time - when thumbnail created. Using regexp it is quite easy to distinguish what is what.

    0 讨论(0)
  • 2021-01-01 05:55

    It doesn't appear that the actual name of the thumbnails are passed back, either from SNS notifications or from the request response upon creation of a job:

    http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/create-job.html#create-job-examples

    http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/notifications.html

    Because the base path/name of your thumbnails is known, and the sequence number will always start at 00001, you can iterate from there to determine if/how many of the thumbnails exist upon job completion. Ensure you use HEAD requests against the objects in S3 to determine their presence; its about 10x cheaper than doing a LIST request.

    0 讨论(0)
提交回复
热议问题