0

I am trying to stitch two clips with AWS Elastic Transcoder CLI, but I am getting error.

My command : aws elastictranscoder create-job --pipeline-id 158182938949-p2e73l --inputs Key=movie1.mp4,movie2.mp4 --outputs Key=complete-mov.mp4,PresetId=159474848914704-fupili,Watermarks=[{PresetWatermarkId=TopLeft,InputKey=Untitled-4png.png}]

I am getting this error :

Parameter validation failed: Invalid type for parameter Inputs[0].Key, value: ['MEYD-001.mp4', 'intro.mp4'], type: <class 'list'>, valid types: <class 'str'>

How can I ADD Multiple inputs[videos] in AWS Elastic transcoder CLI ? AWS docs is lacking this.

Best Regards.

akamai
  • 1
  • 2
  • I wonder if you can do something similar to what you did for `Watermarks`? For example: `--inputs [{Key=movie1.mp4},{Key=movie2.mp4}]` – John Rotenstein Feb 21 '22 at 21:50
  • I tried what you suggested @JohnRotenstein , I am getting this error : https://i.imgur.com/QL5KYl4.png – akamai Feb 22 '22 at 08:00
  • That error is saying that it is expecting values in quotes, so perhaps try: `--inputs [{"Key":"movie1.mp4"},{"Key":"movie2.mp4"}]` (I'm just guessing here, but...) – John Rotenstein Feb 22 '22 at 23:51

1 Answers1

0

@akamai - i was wrong. ET does allow you to stitch clips in a single operation. I think your issue is your using the shortcut syntax and not passing a JSON array.

Try updating your command from

Key=movie1.mp4,movie2.mp4

to

'[{"Key"="movie1.mp4"},{"Key"="movie2.mp4"}]'

You may need some additional parameters to get the desired result. You can use the AWS command to generate a template to guide you like this: aws elastictranscoder create-job --generate-cli-skeleton. That will output a JSON string with every available property of the command. If you look at the Inputs section below, its defined as an array: "Inputs": [.

myname@mypc:~$ aws elastictranscoder create-job --generate-cli-skeleton
{
    "PipelineId": "",
    "Input": {
        "Key": "",
        "FrameRate": "",
        "Resolution": "",
        "AspectRatio": "",
        "Interlaced": "",
        "Container": "",
        "Encryption": {
            "Mode": "",
            "Key": "",
            "KeyMd5": "",
            "InitializationVector": ""
        },
        "TimeSpan": {
            "StartTime": "",
            "Duration": ""
        },
        "InputCaptions": {
            "MergePolicy": "",
            "CaptionSources": [
                {
                    "Key": "",
                    "Language": "",
                    "TimeOffset": "",
                    "Label": "",
                    "Encryption": {
                        "Mode": "",
                        "Key": "",
                        "KeyMd5": "",
                        "InitializationVector": ""
                    }
                }
            ]
        },
        "DetectedProperties": {
            "Width": 0,
            "Height": 0,
            "FrameRate": "",
            "FileSize": 0,
            "DurationMillis": 0
        }
    },
    "Inputs": [
        {
            "Key": "",
            "FrameRate": "",
            "Resolution": "",
            "AspectRatio": "",
            "Interlaced": "",
            "Container": "",
            "Encryption": {
                "Mode": "",
                "Key": "",
                "KeyMd5": "",
                "InitializationVector": ""
            },
            "TimeSpan": {
                "StartTime": "",
                "Duration": ""
            },
            "InputCaptions": {
                "MergePolicy": "",
                "CaptionSources": [
                    {
                        "Key": "",
                        "Language": "",
                        "TimeOffset": "",
                        "Label": "",
                        "Encryption": {
                            "Mode": "",
                            "Key": "",
                            "KeyMd5": "",
                            "InitializationVector": ""
                        }
                    }
                ]
            },
            "DetectedProperties": {
                "Width": 0,
                "Height": 0,
                "FrameRate": "",
                "FileSize": 0,
                "DurationMillis": 0
            }
        }
    ],
    "Output": {
        "Key": "",
        "ThumbnailPattern": "",
        "ThumbnailEncryption": {
            "Mode": "",
            "Key": "",
            "KeyMd5": "",
            "InitializationVector": ""
        },
        "Rotate": "",
        "PresetId": "",
        "SegmentDuration": "",
        "Watermarks": [
            {
                "PresetWatermarkId": "",
                "InputKey": "",
                "Encryption": {
                    "Mode": "",
                    "Key": "",
                    "KeyMd5": "",
                    "InitializationVector": ""
                }
            }
        ],
        "AlbumArt": {
            "MergePolicy": "",
            "Artwork": [
                {
                    "InputKey": "",
                    "MaxWidth": "",
                    "MaxHeight": "",
                    "SizingPolicy": "",
                    "PaddingPolicy": "",
                    "AlbumArtFormat": "",
                    "Encryption": {
                        "Mode": "",
                        "Key": "",
                        "KeyMd5": "",
                        "InitializationVector": ""
                    }
                }
            ]
        },
        "Composition": [
            {
                "TimeSpan": {
                    "StartTime": "",
                    "Duration": ""
                }
            }
        ],
        "Captions": {
            "MergePolicy": "",
            "CaptionSources": [
                {
                    "Key": "",
                    "Language": "",
                    "TimeOffset": "",
                    "Label": "",
                    "Encryption": {
                        "Mode": "",
                        "Key": "",
                        "KeyMd5": "",
                        "InitializationVector": ""
                    }
                }
            ],
            "CaptionFormats": [
                {
                    "Format": "",
                    "Pattern": "",
                    "Encryption": {
                        "Mode": "",
                        "Key": "",
                        "KeyMd5": "",
                        "InitializationVector": ""
                    }
                }
            ]
        },
        "Encryption": {
            "Mode": "",
            "Key": "",
            "KeyMd5": "",
            "InitializationVector": ""
        }
    },
    "Outputs": [
        {
            "Key": "",
            "ThumbnailPattern": "",
            "ThumbnailEncryption": {
                "Mode": "",
                "Key": "",
                "KeyMd5": "",
                "InitializationVector": ""
            },
            "Rotate": "",
            "PresetId": "",
            "SegmentDuration": "",
            "Watermarks": [
                {
                    "PresetWatermarkId": "",
                    "InputKey": "",
                    "Encryption": {
                        "Mode": "",
                        "Key": "",
                        "KeyMd5": "",
                        "InitializationVector": ""
                    }
                }
            ],
            "AlbumArt": {
                "MergePolicy": "",
                "Artwork": [
                    {
                        "InputKey": "",
                        "MaxWidth": "",
                        "MaxHeight": "",
                        "SizingPolicy": "",
                        "PaddingPolicy": "",
                        "AlbumArtFormat": "",
                        "Encryption": {
                            "Mode": "",
                            "Key": "",
                            "KeyMd5": "",
                            "InitializationVector": ""
                        }
                    }
                ]
            },
            "Composition": [
                {
                    "TimeSpan": {
                        "StartTime": "",
                        "Duration": ""
                    }
                }
            ],
            "Captions": {
                "MergePolicy": "",
                "CaptionSources": [
                    {
                        "Key": "",
                        "Language": "",
                        "TimeOffset": "",
                        "Label": "",
                        "Encryption": {
                            "Mode": "",
                            "Key": "",
                            "KeyMd5": "",
                            "InitializationVector": ""
                        }
                    }
                ],
                "CaptionFormats": [
                    {
                        "Format": "",
                        "Pattern": "",
                        "Encryption": {
                            "Mode": "",
                            "Key": "",
                            "KeyMd5": "",
                            "InitializationVector": ""
                        }
                    }
                ]
            },
            "Encryption": {
                "Mode": "",
                "Key": "",
                "KeyMd5": "",
                "InitializationVector": ""
            }
        }
    ],
    "OutputKeyPrefix": "",
    "Playlists": [
        {
            "Name": "",
            "Format": "",
            "OutputKeys": [
                ""
            ],
            "HlsContentProtection": {
                "Method": "",
                "Key": "",
                "KeyMd5": "",
                "InitializationVector": "",
                "LicenseAcquisitionUrl": "",
                "KeyStoragePolicy": ""
            },
            "PlayReadyDrm": {
                "Format": "",
                "Key": "",
                "KeyMd5": "",
                "KeyId": "",
                "InitializationVector": "",
                "LicenseAcquisitionUrl": ""
            }
        }
    ],
    "UserMetadata": {
        "KeyName": ""
    }
}
MisterSmith
  • 2,884
  • 1
  • 10
  • 13
  • Thanks, for the info, So you're saying that I have to run this command two times ? Apologies... I am guessing I am missing something, can you please elaborate a little more ? :) Thanks. – akamai Jul 15 '20 at 05:35
  • Still looking for answer :( – akamai Feb 21 '22 at 13:30