|
56 | 56 | }, |
57 | 57 | } |
58 | 58 |
|
| 59 | + av1Preset = db.Preset{ |
| 60 | + Name: "yet_another_preset_name", |
| 61 | + Description: "test_desc", |
| 62 | + Container: "mp4", |
| 63 | + TwoPass: false, |
| 64 | + Video: db.VideoPreset{ |
| 65 | + Width: "300", |
| 66 | + Height: "400", |
| 67 | + Codec: "av1", |
| 68 | + Bitrate: "400000", |
| 69 | + GopSize: "120", |
| 70 | + GopUnit: "frames", |
| 71 | + InterlaceMode: "progressive", |
| 72 | + }, |
| 73 | + } |
| 74 | + |
59 | 75 | defaultJob = db.Job{ |
60 | 76 | ID: "jobID", |
61 | 77 | ProviderName: Name, |
@@ -236,7 +252,7 @@ func Test_mcProvider_CreatePreset_fields(t *testing.T) { |
236 | 252 | p.Video.GopSize = "gop" |
237 | 253 | return p |
238 | 254 | }, |
239 | | - wantErrMsg: `generating video preset: building h264 codec settings: parsing gop size "gop" to int64: strconv.ParseFloat: parsing "gop": invalid syntax`, |
| 255 | + wantErrMsg: `generating video preset: building h264 codec settings: parsing gop size "gop" to float64: strconv.ParseFloat: parsing "gop": invalid syntax`, |
240 | 256 | }, |
241 | 257 | { |
242 | 258 | name: "unrecognized rate control mode returns an error", |
@@ -515,6 +531,75 @@ func Test_mcProvider_Transcode(t *testing.T) { |
515 | 531 | }, |
516 | 532 | }, |
517 | 533 | }, |
| 534 | + { |
| 535 | + name: "a valid av1 video-only mp4 transcode job is mapped correctly to a mediaconvert job input", |
| 536 | + job: &db.Job{ |
| 537 | + ID: "jobID", |
| 538 | + ProviderName: Name, |
| 539 | + SourceMedia: "s3://some/path.mp4", |
| 540 | + Outputs: []db.TranscodeOutput{{Preset: db.PresetMap{Name: av1Preset.Name}, FileName: "file1.mp4"}}, |
| 541 | + }, |
| 542 | + preset: av1Preset, |
| 543 | + destination: "s3://some/destination", |
| 544 | + wantJobReq: mediaconvert.CreateJobInput{ |
| 545 | + Role: aws.String(""), |
| 546 | + Queue: aws.String(""), |
| 547 | + Settings: &mediaconvert.JobSettings{ |
| 548 | + Inputs: []mediaconvert.Input{ |
| 549 | + { |
| 550 | + AudioSelectors: map[string]mediaconvert.AudioSelector{ |
| 551 | + "Audio Selector 1": { |
| 552 | + DefaultSelection: mediaconvert.AudioDefaultSelectionDefault, |
| 553 | + }, |
| 554 | + }, |
| 555 | + FileInput: aws.String("s3://some/path.mp4"), |
| 556 | + VideoSelector: &mediaconvert.VideoSelector{ |
| 557 | + ColorSpace: mediaconvert.ColorSpaceFollow, |
| 558 | + }, |
| 559 | + }, |
| 560 | + }, |
| 561 | + OutputGroups: []mediaconvert.OutputGroup{ |
| 562 | + { |
| 563 | + OutputGroupSettings: &mediaconvert.OutputGroupSettings{ |
| 564 | + Type: mediaconvert.OutputGroupTypeFileGroupSettings, |
| 565 | + FileGroupSettings: &mediaconvert.FileGroupSettings{ |
| 566 | + Destination: aws.String("s3://some/destination/jobID/m"), |
| 567 | + }, |
| 568 | + }, |
| 569 | + Outputs: []mediaconvert.Output{ |
| 570 | + { |
| 571 | + NameModifier: aws.String("file1"), |
| 572 | + ContainerSettings: &mediaconvert.ContainerSettings{ |
| 573 | + Container: mediaconvert.ContainerTypeMp4, |
| 574 | + }, |
| 575 | + VideoDescription: &mediaconvert.VideoDescription{ |
| 576 | + Height: aws.Int64(400), |
| 577 | + Width: aws.Int64(300), |
| 578 | + RespondToAfd: mediaconvert.RespondToAfdNone, |
| 579 | + ScalingBehavior: mediaconvert.ScalingBehaviorDefault, |
| 580 | + TimecodeInsertion: mediaconvert.VideoTimecodeInsertionDisabled, |
| 581 | + AntiAlias: mediaconvert.AntiAliasEnabled, |
| 582 | + CodecSettings: &mediaconvert.VideoCodecSettings{ |
| 583 | + Codec: mediaconvert.VideoCodecAv1, |
| 584 | + Av1Settings: &mediaconvert.Av1Settings{ |
| 585 | + MaxBitrate: aws.Int64(400000), |
| 586 | + GopSize: aws.Float64(120), |
| 587 | + QvbrSettings: &mediaconvert.Av1QvbrSettings{ |
| 588 | + QvbrQualityLevel: aws.Int64(7), |
| 589 | + QvbrQualityLevelFineTune: aws.Float64(0), |
| 590 | + }, |
| 591 | + RateControlMode: mediaconvert.Av1RateControlModeQvbr, |
| 592 | + }, |
| 593 | + }, |
| 594 | + }, |
| 595 | + Extension: aws.String("mp4"), |
| 596 | + }, |
| 597 | + }, |
| 598 | + }, |
| 599 | + }, |
| 600 | + }, |
| 601 | + }, |
| 602 | + }, |
518 | 603 | } |
519 | 604 |
|
520 | 605 | for _, tt := range tests { |
|
0 commit comments