Creating a Simple Movie Template

FXTemplateClient tmpl = FXTemplateClient.builder()
        .withProvider(new StaticCredentialsProvider("apikey", "apisecret"))
        .withRegion(Regions.EU_WEST_1)
        .build();

VideoParams.Builder vparams = VideoParams.newBuilder()
        .setWidth(640)
        .setHeight(360);

StreamParams.Builder params = StreamParams.newBuilder()
        .setVparams(vparams);

Color.Builder red = Color.newBuilder()
        .setRed(255)
        .setAlpha(255);

ImageProvider.Builder background = ImageProvider.newBuilder()
        .setType(ImageProvider.Type.emptyimage)
        .setColor(red);

VisualTrack.Builder backgroundTrack = VisualTrack.newBuilder()
        .setContent(background);

Color.Builder green = Color.newBuilder()
        .setGreen(255)
        .setAlpha(255);

ImageProvider.Builder text = ImageProvider.newBuilder()
        .setType(ImageProvider.Type.textsimple)
        .setFontsize(50)
        .setColor(green)
        .setText(StringVariable.newBuilder()
                .setType(StringVariable.Type.map)
                .setKey("textblock1"));

VisualTrack.Builder foregroundTrack = VisualTrack.newBuilder()
        .setContent(text);

Scene.Builder scene = Scene.newBuilder()
        .setNumframes(100)
        .addTracks(backgroundTrack)
        .addTracks(foregroundTrack);

Movie.Builder movie = Movie.newBuilder()
        .setParams(params)
        .addScenes(scene);

Movie m = movie.build();

String result = tmpl.createTemplate(prjuid, "testmovie", m.toByteArray());
System.out.println(result);        

Terms of Use | © 2017, Impossible Software, or its affiliates. All rights reserved.