0

I looked the answer (URL for public Amazon S3 bucket) but didn't help. In my aws I have created bucket programmatically and conformed it exist and created Transcribe object and the output is correct. My objective is to create everything programmatically. My mediaFileUri is “https://s3.us-west-2.amazonaws.com/willimbarrsbucket/WillimBarrs.mp4”

using (AmazonTranscribeServiceClient transcribeServiceClient = new 
AmazonTranscribeServiceClient(Amazon.RegionEndpoint.USWest2))
{
    StartTranscriptionJobRequest requestJob = new StartTranscriptionJobRequest()
    {
         TranscriptionJobName = "willimbarrsjob",
         LanguageCode = "en-US",

         Media = new Media()
         {
              MediaFileUri = mediaFileUri
         },
         OutputBucketName = "willimbarrsbucket"
 };

            var responce = await transcribeServiceClient.StartTranscriptionJobAsync(requestJob);

I get an error “The URI that you provided doesn't point to an S3 object. Make sure that the object exists and try your request again”

I am not sure what I am doing wrong? I am using the code from https://net-immersionday.workshop.aws/4-adding-innovation-ai-ml/transcribe.html Any help will be very much appreciated.

2 Answers2

0

From Media - Amazon Transcribe:

MediaFileUri

The S3 object location of the input media file. The URI must be in the same region as the API endpoint that you are calling. The general form is:

s3://<AWSDOC-EXAMPLE-BUCKET>/<keyprefix>/<objectkey>

Therefore, you should use:

s3://willimbarrsbucket/WillimBarrs.mp4
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • Thanks for prompt reply. It is few lines of code with I have provided. Kindly you may check with an existing file With s3://willimbarrsbucket/WillimBarrs.mp4 Same error 'The URI that you provided doesn't point to an S3 object. Make sure that the object exists and try your request again.' – Agha Ahmed Shujaa Khan Sep 27 '20 at 02:07
  • Does it work if you use the Amazon Transcribe management console, and/or the AWS CLI? – John Rotenstein Sep 27 '20 at 03:51
  • Thanks for prompt reply. It works fine if I use Amazon Transcribe management console, but doesn't work if I want to work programmatically. It is only 6 lines of code. Just try. Regards Agha – Agha Ahmed Shujaa Khan Sep 27 '20 at 18:50
  • This suggests that the credentials being used by the AWS CLI and your program do not have sufficient permission, most probably relating to Amazon S3. Check the credentials being used (via `aws iam get-user`) and then find what permissions have been assigned to that IAM entity. – John Rotenstein Sep 28 '20 at 00:16
0

When you upload a file, there is a key associated with that file. use that key string mediaFileUri = $"s3-us-west-2.amazonaws.com{bucketName}/{Key}"; Now it works.