aws-samples / aws-media-services-vod-automation

Sample code and CloudFormation scripts for automating Video on Demand workflows on AWS
Apache License 2.0
136 stars 112 forks source link

Preserve folder structure on watchfolder ouput repository (same as input folder repository) #33

Open juansss opened 4 years ago

juansss commented 4 years ago

Hi! First of all thanks for the script and docs. It's working really well

I'm using MediaConvert-WorkflowWatchFolderAndNotification. All the files outputs goes to the Default folder of the OutputBucketS3 So.. i want to have the same folder structure For example InputBucket / TestFolder / Video.mp4 OutputBucket / TestFolder / Video.mp4 (Now is going to OutputBucket / Video.mp4)

Any suggestions? Thanks!

aburkleaux-amazon commented 4 years ago

Output object S3 key paths are constructed in convert.py. They have the following structure:

<basename(input S3 key) > / <basename(Job Settings filename) or "Default">/ <key from job settings['OutputGroupSettings']['FileGroupSettings']['Destination']> /

This path structure ensures unique output key paths are generated if you have multiple job settings, multiple output groups and/or multiple outputs defined for your MediaConvert jobs.

If you have a single job, single output group and single output, then you should be able to modify the code in convert.py to use the object key path from the input as the path for the output.