0

I'm trying to use AWS's Elastic Transcoder to implement http live streaming for an iPad app. Suppose that I have an output bucket called "output". I want Elastic Transcoder to decode a video and to put the .ts files for each hls output in their own folder, inside a folder called "camera", inside a folder called "tutorials". The resulting directory structure would look like:

output/tutorials/camera/hls20M/.ts output/tutorials/camera/hls15M/.ts output/tutorials/camera/hls10M/*.ts etc.

The master playlist would go in the /camera folder: output/tutorials/camera/index.m3u8

I'm having trouble figuring out how to set up the "output key prefix" and the "output key" in my job in order to achieve this structure.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470

2 Answers2

0

I think this is the gist of it:

CreateJob

{
    ...
    "Outputs": [
        {
            "Key": "hls20M/fileName"
        },
        {
            "Key": "hls15M/fileName"
        },
        {
            "Key": "hls10M/fileName"
        }
    ],
    "OutputKeyPrefix": "output/tutorials/camera/",
    "Playlists": [
        {
            "Name": "index"
        }
    ]
}

All outputs (including the master playlist) are prefixed by the OutputKeyPrefix. Then you put each output under the desired subfolder within that.

Dasmowenator
  • 5,505
  • 5
  • 36
  • 50
0

You basically need to do something like this:

    elastic_transcoder.create_job(pipeline_id=PIPELINE_ID,input_name=input_obj
ect,outputs=output_objects)
#where output_objects is as under:
output_objects = [
    {
        'Key': '%s/video/%s_1080.mp4'%(project_name,video_id),
        'PresetId': '1351620000001-000001',
        'Rotate': 'auto',
        'ThumbnailPattern': '',
    },
    {
        'Key': '%s/video/%s_720.mp4'%(project_name,video_id),
        'PresetId': '1351620000001-000010',
        'Rotate': 'auto',
        'ThumbnailPattern': '',
    },
    {
        'Key': '%s/video/%s_480.mp4'%(project_name,video_id),
        'PresetId': '1351620000001-000020',
        'Rotate': 'auto',
        'ThumbnailPattern': '',
    },
    {
        'Key': '%s/video/%s_360.mp4'%(project_name,video_id),
        'PresetId': '1351620000001-000040',
        'Rotate': 'auto',
        'ThumbnailPattern': '',
    }
]

Moreover the preset_id mentioned here are for different versions one outputs one of them could be your ipad version too.

for a detailed outlook how to setup output and input check this post It explains in detail about the whole process.Hope it helps someone

Aameer
  • 1,366
  • 1
  • 11
  • 30