-
First and foremost, fantastic project! Looking very much forward to GA! As an exercise, I'm trying to create and submit an Elemental MediaConvert job programmatically from the SDK. I managed to define the client with the custom endpoint: let config = aws_config::load_from_env().await;
let media_local_config = aws_sdk_mediaconvert::config::Builder::from(&config)
.endpoint_resolver(aws_sdk_mediaconvert::Endpoint::immutable(Uri::from_static(
,custom_endpoint
)))
.build();
let media_convert_client = aws_sdk_mediaconvert::Client::from_conf(media_local_config); Now I'm trying to actually send the job to be processed by MediaConvert: let _ = media_convert_client
.create_job()
.role(&media_convert_role)
.settings(template_settings)
.send()
.await However, I can't figure out how to generate a valid template_settings object to run the job. I've tried defining a Struct from scratch, and even serializing some JSON strings with serde_json, but I can't seem to find a correct builder or Struct format that is actually valid. The mock settings (as a string literal in JSON format) that I'm trying to test are the following: let settings_json = format!(
"{{
\"Inputs\": [
{{
\"FileInput\": \"{input}\",
\"AudioSelectors\": {{
\"Audio Selector 1\": {{
\"SelectorType\": \"TRACK\",
\"Tracks\": [
1
]
}}
}}
}}
],
\"OutputGroups\": [
{{
\"Name\": \"File Group\",
\"Outputs\": [
{{
\"Preset\": \"System-Generic_Hd_Mp4_Avc_Aac_16x9_1920x1080p_24Hz_6Mbps\",
\"Extension\": \"mp4\",
\"NameModifier\": \"_16x9_1920x1080p_24Hz_6Mbps\"
}}
],
\"OutputGroupSettings\": {{
\"Type\": \"FILE_GROUP_SETTINGS\",
\"FileGroupSettings\": {{
\"Destination\": \"{output}\"
}}
}}
}}
]
}}
"
); Thank you very much in advance! And I apologize if for some reason the question is not that clear or unsuitable for this forum; I'd be happy to clarify any points! Best Regards! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I'm not familiar with MediaConvert, so I can't say if this will work or not, but this is what that given JSON snippet looks like in the Rust SDK's builder pattern: use aws_sdk_mediaconvert::model::*;
let input = Input::builder()
.file_input("{input}")
.audio_selectors("Audio Selector 1",
AudioSelector::builder()
.selector_type(AudioSelectorType::Track)
.tracks(1)
.build()
)
.build();
let output_group = OutputGroup::builder()
.name("File Group")
.outputs(
Output::builder()
.preset("System-Generic_Hd_Mp4_Avc_Aac_16x9_1920x1080p_24Hz_6Mbps")
.extension("mp4")
.name_modifier("_16x9_1920x1080p_24Hz_6Mbps")
.build()
)
.output_group_settings(
OutputGroupSettings::builder()
.r#type(OutputGroupType::FileGroupSettings)
.file_group_settings(FileGroupSettings::builder().destination("{output}").build())
.build()
)
.build();
let settings = JobSettings::builder()
.inputs(input)
.output_groups(output_group)
.build();
let response = media_convert_client
.create_job()
.role(&media_convert_role)
.settings(settings)
.send()
.await; |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
I'm not familiar with MediaConvert, so I can't say if this will work or not, but this is what that given JSON snippet looks like in the Rust SDK's builder pattern: