• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CreateJobOutput类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createGifJob

import com.amazonaws.services.elastictranscoder.model.CreateJobOutput; //导入依赖的package包/类
public CreateJobResult createGifJob(String pipelineId, String inputKey) {
	JobInput input = new JobInput().withKey(inputKey);
    	    
    List<CreateJobOutput> gifJobOutputs = new ArrayList<>();
    
    Iterator<String> gifPresetKeys = gifPresets.keySet().iterator();
    while (gifPresetKeys.hasNext()) {
    	String gifPresetKey = gifPresetKeys.next(); 
	    CreateJobOutput gifJob = new CreateJobOutput()
        .withKey(gifPresetKey)
        .withPresetId((String)gifPresets.get(gifPresetKey));		    
	    gifJobOutputs.add(gifJob);
    }
    
    // Create the job.
    CreateJobRequest createJobRequest = new CreateJobRequest()
        .withPipelineId(pipelineId)
        .withInput(input)
        .withOutputKeyPrefix(inputKey + "/")
        .withOutputs(gifJobOutputs);

    return transcoderClient.createJob(createJobRequest);		
}
 
开发者ID:TimShi,项目名称:s3_video,代码行数:24,代码来源:AWSAdapter.java


示例2: createElasticTranscoderJob

import com.amazonaws.services.elastictranscoder.model.CreateJobOutput; //导入依赖的package包/类
/**
 * Creates a job in Elastic Transcoder using the configured pipeline, input
 * key, preset, and output key prefix.
 *
 * @return Job ID of the job that was created in Elastic Transcoder.
 * @throws Exception
 */
private String createElasticTranscoderJob(String inputUrl) throws Exception
{
    JobInput input = new JobInput().withKey(inputUrl);
    List<CreateJobOutput> outputs = new ArrayList<>();

    for(Map.Entry<String, String> entry : GlobalParams.VIDEO_PRESETS.entrySet()) {
        String suffix = entry.getKey();
        String preset = entry.getValue();

        String outputUrl = createSuffixUrl(inputUrl, suffix);
        if(!outputUrl.isEmpty()) {
            CreateJobOutput out = new CreateJobOutput();
            out.withKey(outputUrl);
            out.withPresetId(preset);
            if(suffix.equals(STREAM)) {
                out.withSegmentDuration("1");
            }
            outputs.add(out);
        }
    }

    CreateJobRequest createJobRequest = new CreateJobRequest()
            .withPipelineId(PIPELINE_ID)
            .withInput(input)
            .withOutputs(outputs);
    return amazonElasticTranscoder.createJob(createJobRequest).getJob().getId();
}
 
开发者ID:webinerds,项目名称:s3-proxy-chunk-upload,代码行数:35,代码来源:VideoConverter.java


示例3: createVideoPreview

import com.amazonaws.services.elastictranscoder.model.CreateJobOutput; //导入依赖的package包/类
@Override
public void createVideoPreview(Video video) {
	String pipelineId = config.getProperty(ConfigProps.TRANSCODE_PIPELINE);
	String presetId = config.getProperty(ConfigProps.TRANSCODE_PRESET);
	if (pipelineId == null || presetId == null) {
		return;
	}
	CreateJobRequest encodeJob = new CreateJobRequest()
			.withPipelineId(pipelineId)
			.withInput(
					new JobInput().withKey(video.getOriginalKey())
							.withAspectRatio("auto").withContainer("auto")
							.withFrameRate("auto").withInterlaced("auto")
							.withResolution("auto"))
			.withOutputKeyPrefix(
					"uploads/converted/" + video.getOwner() + "/")
			.withOutput(
					new CreateJobOutput()
							.withKey(UUID.randomUUID().toString())
							.withPresetId(presetId)
							.withThumbnailPattern(
									"thumbs/"
											+ UUID.randomUUID().toString()
											+ "-{count}"));

	try {
		CreateJobResult result = transcoderClient.createJob(encodeJob);
		video.setTranscodeJobId(result.getJob().getId());
		video.setThumbnailKey("static/img/in_progress_poster.png");
		save(video);
	} catch (AmazonServiceException e) {
		LOG.error("Failed creating transcode job for video {}",
				video.getId(), e);
	}
}
 
开发者ID:awslabs,项目名称:amediamanager,代码行数:36,代码来源:VideoServiceImpl.java


示例4: transcode

import com.amazonaws.services.elastictranscoder.model.CreateJobOutput; //导入依赖的package包/类
public TranscodingJob transcode( final TranscodeRequest transcodeRequest )
{
    final String inputKey = transcodeRequest.getInputKey();
    final String outputKey = transcodeRequest.getOutputKey();

    // Extract TranscodingService
    logger.info( "Transcoding {} to {}.", inputKey, outputKey );
    final JobInput jobInput =
            new JobInput().withKey( inputKey ).withAspectRatio( "auto" ).withContainer( "auto" )
                    .withFrameRate( "auto" ).withInterlaced( "auto" ).withResolution( "auto" );
    final CreateJobOutput createJobOutput =
            new CreateJobOutput().withKey( outputKey ).withPresetId( ETS_PRESET_1080P ).withRotate( "auto" )
                    .withThumbnailPattern( "" );
    final CreateJobRequest jobRequest =
            new CreateJobRequest().withInput( jobInput ).withOutputs( createJobOutput )
                    .withPipelineId( MOV_TO_MP4_PIPELINE_ID );

    CreateJobResult jobResult;
    try
    {
        jobResult = this.elasticTranscoder.createJob( jobRequest );
    }
    catch ( final AmazonClientException e )
    {
        logger.error( "Error creating ElasticTranscoder Job!", e );
        return null;
    }

    if ( jobResult.getJob() == null )
    {
        logger.error( "Job is null.  Something went wrong!" );
        return null;
    }
    final Job job = jobResult.getJob();
    logger.info( "Job {} is {}.", job.getId(), job.getStatus() );
    return new TranscodingJob( job.getId(), transcodeRequest.getInputPath(), transcodeRequest.getOutputPath() );
}
 
开发者ID:stevenmhood,项目名称:transcoder,代码行数:38,代码来源:TranscodingService.java


示例5: createTranscodeJob

import com.amazonaws.services.elastictranscoder.model.CreateJobOutput; //导入依赖的package包/类
public CreateJobResult createTranscodeJob(String pipelineId, String inputKey) throws TranscodeException {
	JobInput input = new JobInput().withKey(inputKey);
    
	boolean isThumbnailConfigured = false;
	
    List<CreateJobOutput> hlsJobOutputs = new ArrayList<>();
    Iterator<String> hlsPresetKeys = hlsPresets.keySet().iterator();
    List<String> hlsJobKeys = new ArrayList<>();	    		
    while (hlsPresetKeys.hasNext()) {
    	String hlsPresetKey = hlsPresetKeys.next();
    	String hlsJobKey = "hls/" + hlsPresetKey;
    	
	    CreateJobOutput hlsJob = new CreateJobOutput()
        .withKey(hlsJobKey)
        .withPresetId((String)hlsPresets.get(hlsPresetKey))
        .withSegmentDuration(segmentDuration);
	    
	    if (!isThumbnailConfigured) {
	    	hlsJob.withThumbnailPattern(THUMBNAIL_PATTERN);
	    	isThumbnailConfigured = true;
	    }
	    
	    hlsJobKeys.add(hlsJobKey);
	    hlsJobOutputs.add(hlsJob);		    
    }
    
    // Setup master playlist which can be used to play using adaptive bitrate.
    CreateJobPlaylist playlist = new CreateJobPlaylist()
        .withName("hls") 
        .withFormat("HLSv3")
        .withOutputKeys(hlsJobKeys);
    
    List<CreateJobOutput> webmJobOutputs = new ArrayList<>();
    Iterator<String> webmPresetKeys = webmPresets.keySet().iterator();
    while (webmPresetKeys.hasNext()) {
    	String webmPresetKey = webmPresetKeys.next(); 
	    CreateJobOutput webmJob = new CreateJobOutput()
        .withKey(webmPresetKey)
        .withPresetId((String)webmPresets.get(webmPresetKey));		    

	    if (!isThumbnailConfigured) {
	    	webmJob.withThumbnailPattern(THUMBNAIL_PATTERN);
	    	isThumbnailConfigured = true;
	    }

	    webmJobOutputs.add(webmJob);
    }

    List<CreateJobOutput> outputs = new ArrayList<>();
    outputs.addAll(hlsJobOutputs);
    outputs.addAll(webmJobOutputs);
    
    // Create the job.
    CreateJobRequest createJobRequest = new CreateJobRequest()
        .withPipelineId(pipelineId)
        .withInput(input)
        .withOutputKeyPrefix(inputKey + "/")
        .withOutputs(outputs)
        .withPlaylists(playlist);

    return transcoderClient.createJob(createJobRequest);
}
 
开发者ID:TimShi,项目名称:s3_video,代码行数:63,代码来源:AWSAdapter.java


示例6: execute

import com.amazonaws.services.elastictranscoder.model.CreateJobOutput; //导入依赖的package包/类
public cfData execute( cfSession _session, cfArgStructData argStruct ) throws cfmRunTimeException{
	AmazonKey amazonKey	= getAmazonKey(_session, argStruct);
	AmazonElasticTranscoder et = getAmazonElasticTranscoder(amazonKey);

	CreateJobRequest cjr	= new CreateJobRequest();

	cjr.setPipelineId( getNamedStringParam(argStruct, "pipelineid", null) );
	if ( cjr.getPipelineId() == null || cjr.getPipelineId().isEmpty() )
		throwException(_session, "please provide a valid pipelineid");

	cjr.setOutputKeyPrefix( getNamedStringParam(argStruct, "outputkeyprefix", null) );
	if ( cjr.getOutputKeyPrefix() != null && cjr.getOutputKeyPrefix().isEmpty() )
		throwException(_session, "please provide a valid outputkeyprefix");
	
	
	// Handle the input
	cfStructData	input	= getNamedStructParam( _session, argStruct, "input", null );
	if ( input == null )
		throwException(_session, "please provide a 'input'");
	
	JobInput jobinput	= new JobInput();
	
	if ( input.containsKey("aspectratio") )
		jobinput.setAspectRatio( input.getData("aspectratio").getString() );
	
	if ( input.containsKey("container") )
		jobinput.setContainer( input.getData("container").getString() );
	
	if ( input.containsKey("framerate") )
		jobinput.setFrameRate( input.getData("framerate").getString() );
	
	if ( input.containsKey("interlaced") )
		jobinput.setInterlaced( input.getData("interlaced").getString() );
	
	if ( input.containsKey("key") )
		jobinput.setKey( input.getData("key").getString() );
	
	if ( input.containsKey("resolution") )
		jobinput.setResolution( input.getData("resolution").getString() );
	
	if ( input.containsKey("encryption") )
		jobinput.setEncryption( getEncryption( (cfStructData)input.getData("encryption") ) );
		
	cjr.setInput(jobinput);
	
	
	// Set the output
	cfArrayData	outputArr	= getNamedArrayParam( _session, argStruct, "outputs", null );
	if ( outputArr == null )
		throwException(_session, "please provide 'outputs'");
	
	List<CreateJobOutput>	outputs	= new LinkedList();
	for ( int x=0; x < outputArr.size(); x++ )
		outputs.add( getCreateJobOutput( (cfStructData)outputArr.getData(x+1) ) );
	
	cjr.setOutputs(outputs);
	
	
	// Now after collection all that; create the actual pipeline
	try{
		CreateJobResult cpres = et.createJob(cjr);
		return new cfStringData( cpres.getJob().getId() ); 
	}catch(Exception e){
		throwException(_session, "AmazonElasticTranscoder: " + e.getMessage() );
		return cfBooleanData.TRUE;
	}
}
 
开发者ID:OpenBD,项目名称:openbd-core,代码行数:68,代码来源:Create.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GCInterface类代码示例发布时间:2022-05-23
下一篇:
Java FastqReader类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap