1

I'm using AWS SDK for python (boto3) and want to set the subtitle output format (i.e. SRT). When I use this code, I get the error below which mentioned parameter Subtitle is not a valid parameter but according to AWS Documentation, I should be able to pass some values in this parameter.

    s3 = boto3.client('s3', aws_access_key_id=ACCESS_KEY,aws_secret_access_key=SECRET_KEY)
    transcribe = boto3.client('transcribe',aws_access_key_id=ACCESS_KEY, 
    aws_secret_access_key=SECRET_KEY, region_name=region_name)
    job_name = "kateri1234"
    job_uri = "s3://transcribe-upload12/english.mp4"
    transcribe.start_transcription_job(TranscriptionJobName=job_name,Media{'MediaFileUri':job_uri},
    MediaFormat='mp4',
    LanguageCode='en-US', 
    Subtitles={'Formats': ['vtt']},
    OutputBucketName = "transcribe-output12"
    )
    while True:
        status = transcribe.get_transcription_job(TranscriptionJobName=job_name)
        if status['TranscriptionJob']['TranscriptionJobStatus'] in ['COMPLETED', 'FAILED']:
            break
            print("Not ready yet...")
            time.sleep(5)
            print(status)

ERROR i get is Unknown parameter in input: "Subtitles", must be one of: TranscriptionJobName, LanguageCode, MediaSampleRateHertz, MediaFormat, Media, OutputBucketName, OutputEncryptionKMSKeyId, Settings

refered the aws documentation

Leo
  • 867
  • 1
  • 15
  • 41

1 Answers1

0

I have faced a similar issue, and after some research, I have found out it is because of my boto3 and botocore versions.

I have upgraded these two packages, and it worked. My requirements.txt for these two packages:

boto3==1.20.0
botocore==1.23.54

P.S: Remember to check these two new versions are compatible with your other python packages. Especially if you are using other AWS Libraries like awsebcli. To make sure everything is working perfectly together, try running this command after upgrading these two libraries to check the errors:

pip check
Leo
  • 867
  • 1
  • 15
  • 41