-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.yaml
67 lines (56 loc) · 2.77 KB
/
README.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: terraform-video-converter
gitlab_repo: miquido/terraform/terraform-video-converter
badges: [ ]
related: [ ]
description: |-
A solution that will generate adaptive streaming urls for videos uploaded to video-source bucket.
After conversion, videos will be available under
module.video-cdn.cf_domain_name/file_name/protocol/file_name.protocol_extension
ex. https://playground-test-video.s3.eu-central-1.amazonaws.com/IMG_6326.mov/AppleHLS1/IMG_6326.m3u8
Also there will be notifications send on endpoint under vars submit-lambda-notification-webhook and
complete-lambda-notification-webhook.
By default the solution will make 3 types of conversion: HLS, DASHIS and mp4. This can be changed by
modifiying video-source/converter-config-1/job-settings.json file.
Files should be uploaded to video-source/converter-config-1 and only .mp4, .mpg, .m4v, .mov, .m2ts
are supported (case sensitive)
Most useful fields from 'Complete lambda' notification will be probably:
```
event.detail.userMetadata.guid,
event.detail.userMetadata.filename,
event.detail.status,
```
<b>Important</b><br>
The solution assumes that a video file will be uploaded into `...video-source` bucket with a path format:<br>
`config-name/guid/.../filename`<br>
Where `guid` in the path is `guid` in the notification. For example:<br>
`myVideoConfig/user1/video2` or <br>
`converter-config-1/7269c6d9-7884-4458-9f70-f142f6879a18/feed/video/28cc892d-0118-4c4c-957e-78aa39462e92`<br>
usage: |-
```hcl
module "adaptive-video" {
source = "git::ssh://[email protected]/miquido/terraform/terraform-video-converter.git?ref=tags/..."
name = "adaptive-video"
stage = var.environment
namespace = var.project
aws_region = var.aws_region
aws_used_account_no = var.aws_used_account_no
dns_alias_enabled = true
dns_alias_name = local.videos_domain
parent_zone_id = aws_route53_zone.primary.zone_id
acm_certificate_arn = local.cdn_acm_certificate_arn
// ECS task that uploads videos
uploading_service_role = module.ecs-alb-task-main-api.task_role_name
// unique endpoint from your account
mediaconvert-endpoint = "https://xxxxxxxx.mediaconvert.us-east-1.amazonaws.com"
// sends error when can't create conversion job
submit-lambda-notification-webhook = "https://${local.main_api_domain}/submit"
// sends completed job details or error object
complete-lambda-notification-webhook = "https://${local.main_api_domain}/complete"
notification-webhook-auth-header = "Api-Key ${data.aws_ssm_parameter.main-api_JOBS_API_KEY.value}"
// optional - for signed urls on CF
trusted_key_group = aws_cloudfront_key_group.cf_keygroup.id
}
```
include:
- "docs/targets.md"
- "docs/terraform.md"