MediaLive Java SDK: How do I use "Channel template" in SDK as in Console

0

On the console I used Live Event (Media Package) template which created an HD (MediaPackage) OutputGroup with 4 Outputs. I am unable to find this template or replicate the CreateChannelRequest to match.

Enter image description here

This feels like a very strange association of encoder settings and destinations?

CreateChannelRequest
	.builder()
	.name(channelRequest.getName())
	.roleArn(mediaLiveConfig.getAccessRoleArn())
	.channelClass(liveRequest.getChannelRequest().getChannelClass())
	.inputAttachments(buildAttachment(inputResponse))
	.inputSpecification(buildInputSpecifications())
	.encoderSettings(buildMediaPackageOutput(mediaPackageChannelId))
	.destinations(buildOutputDestination(mediaPackageChannelId))
	.build();
	private EncoderSettings buildMediaPackageOutput(String mediaPackageChannelId) {
		return EncoderSettings.builder()
			.audioDescriptions(
				buildAudioDescription(AUDIO_1),
				buildAudioDescription(AUDIO_2),
				buildAudioDescription(AUDIO_3),
				buildAudioDescription(AUDIO_4)
			)
			.videoDescriptions(
				buildVideoDescription(VIDEO_1080P_30, 1920, 1080, 5000000, 50),
				buildVideoDescription(VIDEO_720P_30, 1280, 720, 3000000, 100),
				buildVideoDescription(VIDEO_480P_30, 640, 480, 1500000, 100),
				buildVideoDescription(VIDEO_240P_30, 320, 240, 750000, 100)
			)
			.outputGroups(
				createMediaPackageOutputGroup(mediaPackageChannelId)
			)
			.timecodeConfig(timecode -> timecode.source(TimecodeConfigSource.EMBEDDED).build())
			.build();
	}
}
	private OutputGroup createMediaPackageOutputGroup(String mediaPackageChannelId) {
		Output output1 = Output.builder()
			.outputName("1080p30").videoDescriptionName(VIDEO_1080P_30).audioDescriptionNames(AUDIO_1)
			.outputSettings(outputSettings -> outputSettings.mediaPackageOutputSettings(SdkBuilder::build))
			.build();
		Output output2 = Output.builder()
			.outputName("720p30").videoDescriptionName(VIDEO_720P_30).audioDescriptionNames(AUDIO_2)
			.outputSettings(outputSettings -> outputSettings.mediaPackageOutputSettings(SdkBuilder::build))
			.build();
		Output output3 = Output.builder()
			.outputName("480p30").videoDescriptionName(VIDEO_480P_30).audioDescriptionNames(AUDIO_3)
			.outputSettings(outputSettings -> outputSettings.mediaPackageOutputSettings(SdkBuilder::build))
			.build();
		Output output4 = Output.builder()
			.outputName("240p30").videoDescriptionName(VIDEO_240P_30).audioDescriptionNames(AUDIO_4)
			.outputSettings(outputSettings -> outputSettings.mediaPackageOutputSettings(SdkBuilder::build))
			.build();
		return OutputGroup.builder()
			.name("HD")
			.outputGroupSettings(outputGroupSettings ->
				outputGroupSettings.mediaPackageGroupSettings(mediaPackageGroupSettings ->
						mediaPackageGroupSettings.destination(outputLocationRef -> outputLocationRef.destinationRefId(mediaPackageChannelId).build())
							.build())
					.build())
			.outputs(output1, output2, output3, output4)
			.build();
	}


Seems odd I am setting the HLS settings in order to tie to the media package ingest. Why wouldn't it just tie together with the MediaPackage ChannelID?

Am I even close to duplicating what I did in the Console with the Live Event (MediaPackage) template?

cobar79
gefragt vor einem Monat83 Aufrufe
1 Antwort
0

Successfully wired up the Media Package Output Group. Still having issues with the Archive Output Group, specifically the S3 destination (OutputLocationRef) value.

Object references undefined destination "s3://osint-media-archive/mli-test-01-test-01/mli-test-01-test-01" (Service: MediaLive, Status Code: 422
cobar79
beantwortet vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen