1

I am using aws transcribe to get the text of the video using node js. I can specify the particular destination bucket in params but not the particular folder. Can anyone help me with this ? This is my code

var params = {
        LanguageCode: "en-US", 
        Media: { /* required */
          MediaFileUri: "s3://bucket-name/public/events/545/videoplayback1.mp4"
        },
        TranscriptionJobName: 'STRING_VALUE', /* required */
        MediaFormat: "mp4", //mp3 | mp4 | wav | flac,
        OutputBucketName: 'test-rekognition',
        // }
      };
      transcribeservice.startTranscriptionJob(params, function(err, data) {
        if (err) console.log(err, err.stack); // an error occurred
        else     console.log(data);           // successful response
      });

I have specified the destination bucket name in OutputBucketName field. But how to specify a particular folder ?

Haris George
  • 291
  • 5
  • 16

2 Answers2

0

I would recommend creating a designated S3 Bucket for Transcribe output and adding a trigger with a lambda function to respond to that trigger on 'Object create (All)'. Essentially, as soon as there is a new object added to your S3 bucket, a lambda function is invoked to move/process that output by placing it in a specific 'folder' of your choice.

This doesn't solve the API issue but I hope it serves as a good workaround - you could look at this article ( https://linuxacademy.com/hands-on-lab/0e291fc6-52a4-4ed3-ad65-8cf2fd84e0df/ ) as a guide.

have a good one.

0

Very late to the party, but I just had the same issue.

It appeared that Amazon added a new parameter called OutputKey that allows you to save your data in a specific folder in your bucket :

You can use output keys to specify the Amazon S3 prefix and file name of the transcription output. For example, specifying the Amazon S3 prefix, "folder1/folder2/", as an output key would lead to the output being stored as "folder1/folder2/your-transcription-job-name.json". If you specify "my-other-job-name.json" as the output key, the object key is changed to "my-other-job-name.json". You can use an output key to change both the prefix and the file name, for example "folder/my-other-job-name.json".

Just make sure to put 'folder/' as an OutputKey (with '/' symbol at the end), otherwise it will be interpreted as a name for your file and not the folder where to store it.

Hope it'll be useful to someone.

Rikku
  • 1