当前位置: 首页>>代码示例>>Java>>正文


Java AudioParameters类代码示例

本文整理汇总了Java中com.amazonaws.services.elastictranscoder.model.AudioParameters的典型用法代码示例。如果您正苦于以下问题:Java AudioParameters类的具体用法?Java AudioParameters怎么用?Java AudioParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AudioParameters类属于com.amazonaws.services.elastictranscoder.model包,在下文中一共展示了AudioParameters类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: provisionPreset

import com.amazonaws.services.elastictranscoder.model.AudioParameters; //导入依赖的package包/类
private String provisionPreset() {
    String presetId = config.getProperty(ConfigProps.TRANSCODE_PRESET);

    if (presetId == null) {
    	LOG.info("Provisioning ETS Preset.");
        state = ProvisionState.PROVISIONING;
        Map<String, String> codecOptions = new HashMap<String, String>();
        codecOptions.put("Profile", "main");
        codecOptions.put("Level", "3.1");
        codecOptions.put("MaxReferenceFrames", "3");

        VideoParameters video = new VideoParameters()
            .withCodec("H.264")
            .withCodecOptions(codecOptions)
            .withKeyframesMaxDist("90")
            .withFixedGOP("false")
            .withBitRate("2200")
            .withFrameRate("30")
            .withMaxWidth("1280")
            .withMaxHeight("720")
            .withSizingPolicy("ShrinkToFit")
            .withPaddingPolicy("NoPad")
            .withDisplayAspectRatio("auto");

        AudioParameters audio = new AudioParameters()
            .withCodec("AAC")
            .withSampleRate("44100")
            .withBitRate("160")
            .withChannels("2");

        Thumbnails thumbnails = new Thumbnails()
            .withFormat("png")
            .withInterval("60")
            .withMaxWidth("500")
            .withMaxHeight("300")
            .withSizingPolicy("ShrinkToFit")
            .withPaddingPolicy("NoPad");

        CreatePresetRequest presetRequest = new CreatePresetRequest()
            .withName("amm-reinvent-preset-" + UUID.randomUUID().toString().replace("-", "").substring(0, 20).toUpperCase())
            .withDescription("Preset used by aMediaManager re:Invent 2013")
            .withContainer("mp4")
            .withVideo(video)
            .withAudio(audio)
            .withThumbnails(thumbnails);

        try {
            CreatePresetResult result = transcoderClient.createPreset(presetRequest);
            presetId = result.getPreset().getId();
            config.getConfigurationProvider().persistNewProperty(ConfigProps.TRANSCODE_PRESET, presetId);
            LOG.info("Preset {} created. Persisting to configuration provider.", presetId);
        } catch (AmazonServiceException e) {
            LOG.error("Failed creating transcoder preset {}", presetRequest.getName(), e);
            state = ProvisionState.UNPROVISIONED;
        }
    }
    return presetId;
}
 
开发者ID:awslabs,项目名称:amediamanager,代码行数:59,代码来源:ElasticTranscoderPipelineResource.java


注:本文中的com.amazonaws.services.elastictranscoder.model.AudioParameters类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。