aws / aws-sdk-java-v2

The official AWS SDK for Java - Version 2
Apache License 2.0
2.16k stars 833 forks source link

MediaLive SDK Archive Output Group #5202

Open cobar79 opened 4 months ago

cobar79 commented 4 months ago

Describe the bug

I have set up a MediaLive channel with a HD MediaPackage output and an archive output that I set up in the console and I am attempting to automate creation of a channel using the SDK.

The SDK 2x has little to no documentation on the archive media output. I am having an issue finding where to set the "Archive group destination A" URL to the S3 bucket. (s3ssl://media-archive/BigBuckBunny)

Best guess but makes no sense and doesn't work since it is an OutputLocationRef.destinationRefId which leads me to believe it may be an arn. However, that didn't work either.

        S3Uri s3Uri = s3Service.createArchiveFolder(liveName);
        //Add liveName to simulate s3://media-archive/liveName)
        String destinationUri = s3Uri.uri().toString() + '/' + liveName;

        Output archiveOutput = Output.builder()
            .outputName("p4csa7")
            .outputSettings(outputSettings ->
                outputSettings
                    .archiveOutputSettings(archiveOutputSettings -> archiveOutputSettings
                        .nameModifier("_Live")
                        .containerSettings(archiveContainerSettings ->
                            archiveContainerSettings.m2tsSettings(m2tsSettings -> m2tsSettings
                                    .bufferModel(M2tsBufferModel.MULTIPLEX)
                                    .audioBufferModel(M2tsAudioBufferModel.ATSC)
                                    .rateMode(M2tsRateMode.CBR)
                                    .programNum(1)
                                    .segmentationMarkers(M2tsSegmentationMarkers.NONE)
                                    .segmentationStyle(M2tsSegmentationStyle.MAINTAIN_CADENCE)
                                    .ebpPlacement(M2tsEbpPlacement.VIDEO_AND_AUDIO_PIDS)
                                    .ebpAudioInterval(M2tsAudioInterval.VIDEO_INTERVAL)
                                    .audioStreamType(M2tsAudioStreamType.DVB)
                                    .absentInputAudioBehavior(M2tsAbsentInputAudioBehavior.ENCODE_SILENCE)
                                    .audioFramesPerPes(2)
                                    .esRateInPes(M2tsEsRateInPes.EXCLUDE)
                                    .ccDescriptor(M2tsCcDescriptor.DISABLED)
                                    .patInterval(100)
                                    .pmtPid("480")
                                    .pmtInterval(100)
                                    .videoPid("481")
                                    .pcrControl(M2tsPcrControl.PCR_EVERY_PES_PACKET)
                                    .pcrPeriod(40)
                                    .audioPids("482-498")
                                    .dvbTeletextPid("499")
                                    .dvbSubPids("460-479")
                                    .scte27Pids("450-479")
                                    .scte35Control(M2tsScte35Control.NONE)
                                    .scte35Pid("500")
                                    .klv(M2tsKlv.NONE)
                                    .klvDataPids("501")
                                    .timedMetadataBehavior(M2tsTimedMetadataBehavior.NO_PASSTHROUGH)
                                    .timedMetadataPid("502")
                                    .ebif(M2tsEbifControl.NONE)
                                    .etvPlatformPid("504")
                                    .etvSignalPid("505")
                                    .arib(M2tsArib.DISABLED)
                                    .aribCaptionsPidControl(M2tsAribCaptionsPidControl.AUTO)
                                    .aribCaptionsPid("507")
                                    .nielsenId3Behavior(M2tsNielsenId3Behavior.NO_PASSTHROUGH)
                                    .build())
                                .build())
                        .build())
                    .build())
            .videoDescriptionName("video_apmblz")
            .audioDescriptionNames("audio_fbtpg")
            .build();

                return OutputGroup.builder()
            .name("archive-s3")
            .outputGroupSettings(outputGroupSettings -> outputGroupSettings
                .archiveGroupSettings(archiveGroupSettings -> archiveGroupSettings
                    .rolloverInterval(60)
                    .destination(destination -> destination.destinationRefId(destinationUri ))
                    .build())
                .build())
            .outputs(archiveOutput)
            .build();

Expected Behavior

To be able to use the SDK to replicate what was set up in the console.

Current Behavior

Object references undefined destination "s3ssl://media-archive/mli-test-01-test-01/mli-test-01-test-01" (Service: MediaLive, Status Code: 422, Request ID: 0fe6a5a6-e7cd-4770-aced-5a1e2b5400ca)

Reproduction Steps

video-service-app

Update test properties for bucket

Run MediaLiveServiceTests

You will need to manually delete the input security group since there is an issue waiting for the input to be disabled.

Possible Solution

Most everything followed console names but the archive URL is no where to be found.

Additional Information/Context

No response

AWS Java SDK version used

2.25.14

JDK version used

Corretto-17.0.7.7.1 (build 17.0.7+7-LTS)

Operating System and version

windows 10

debora-ito commented 3 months ago

@cobar79 Can you share a screenshot of the console where you're seeing "Archive group destination A"?

cobar79 commented 3 months ago

image