NAV Navbar
Logo
XML JSON

Introduction

Welcome to the WeVideo video creation API! You can use our API to access WeVideo API endpoints that can render videos based on XML/JSON timeline templates.

You can view code examples in the dark area to the right.

API Calls

Authentication

For all API calls you must include your API secret in the authorization header like this:

Authorization: WEVSIMPLE <YOUR API SECRET>

Make sure to also set the Content-Type header to application/json for all POST requests.

Create video

POST /api/3/videos/create

Creates and queues a new video. POST data should be a JSON object with the following properties:
* version: Schema version. Only valid value at the moment is “1”
* content: XML string as specced in version1.xsd
* resolution (optional): 240p, 360p, 480p, 720p, 1080p or 2160p. Defaults to 480p. All of these will render a video with 16:9 aspect ratio, but you can also send in the resolution as a widthxheight string. For example 1000x1000 or 720x1280
* thumbnailTime (optional): A timestamp in milliseconds for where to generate the thumbnail.
* crf (optional): Sets the visual quality of the video. A lower value will result in higher quality, but also a large file size and longer processing time. Defaults to 20. See https://trac.ffmpeg.org/wiki/Encode/H.264 for more information.
* fps (optional): Sets the frame rate of the export, defaults to 25
* startTime (optional) and endTime (optional): Timestamps in milliseconds. Allows for rendering only a subset of the entire timeline, for example from 2000ms to 3000ms

Publishing to Youtube

You can publish your videos directly to Youtube. In order to do this you first need to log in to your WeVideo account, and connect to Youtube at https://www.wevideo.com/hub#account. Make sure your Youtube account has a channel created, otherwise the upload will fail. Then you can add a youtube property to the /api/3/videos/create call. This should be an object with the following optional fields:
* title: The title on Youtube
* description: The description on Youtube
* categoryId: The numeric category ID. 22 is for example People & Blogs
* keywords: A comma-separated list of keywords associated with the video. For example
* privacy: The privacy status: public, private, or unlisted

Get video status

GET /api/3/videos/status/{jobId}

Returns the status of a job. If completed a URL to the finished file will be included as well as the URL to the video thumbnail

Get thumbnail

GET /api/3/videos/thumbnail/{jobId}

If the processing has completed this will redirect to the video thumbnail.

Convert an editor video

POST /api/3/videos/convert/{timelineId}

Attempts to convert a timeline created in the editor to the API XML format. This method only supports a relatively small subset of the features available in the editor.

XML format

XML is a useful format for creating videos due to its flexibility and readability.

Layers

Layers are the platform that contain your media elements. The priority of the layers is top down. The first layer encountered in the XML is the top layer, last layer is the bottom layer. Keep this in mind when overlapping layers for which layer you want on top. At least one layer required.

Elements

Common attributes

Attribute nameDescription
durationThe items duration on the timeline in milliseconds
inPointWhere in the file to start playback. A video with inPoint 2000 will start the playback 2 seconds into the file.
loopable(Videos only). Default value is true. By setting this to false a video will not loop, even if the video file itself has a shorter duration than the video tag.

Media

A media element is represented by a <video>, <image> or <audio> tag. They all require a src attribute that should be a URL pointing to the file itself.

We scale the size up/down to fit inside the frame, and place it in the center.

#A very basic video with a single image lasting for 5 seconds
<timeline version="1">
    <layers>
        <layer>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/goldenGate.jpg" duration="5000" />
        </layer>
    </layers>
</timeline>
#Rendering seconds 2-4 of the input video
<timeline version="1">
    <layers>
        <layer>
            <video src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4" duration="2000" inPoint="2000" />
        </layer>
    </layers>
</timeline>

Size and position

You can use the left, top, right, bottom, width and height attributes to position and scale a media item.

#Scale and position
<timeline version="1">
    <layers>
        <layer>
            <video duration="520" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4" />
            <video duration="520" width="960" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4" />
            <video duration="520" width="960" height="960" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4" />
            <video duration="520" width="960" height="960" left="-480" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4" />
            <video duration="520" width="960" height="960" left="960" top="120" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4" />
            <video duration="520" width="1920" height="540" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4" />
        </layer>
    </layers>
</timeline>

Text

Simple text

<text> tag. Duration is required. Optional attributes:

NameDescriptionDefault valueAllowed values
widthThe width of the text area in pixels1920
heightThe height of the text area in pixels1080
left0
top0
alignHorizontal alignment of the textcenterleft | center | right
valignVertical alignment of the textcentertop | center | bottom
fontSizeSize of the text in pixels172
fontFontRobotoTODO
colorFont colorwhiteAny valid CSS color value
backgroundColorThe background color of the text areanone (transparent)Any valid CSS color value

#Basic text example
<timeline version="1">
    <layers>
        <layer>
            <text duration="3000">Simple text</text>
        </layer>
        <layer>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/goldenGate.jpg" duration="3000" />
        </layer>
    </layers>
</timeline>

HTML text

You can also include HTML directly in the text content.

#Using custom HTML
<timeline version="1">
    <layers>
        <layer>
            <text duration="3000"><![CDATA[<span style="font-size: 135px;">NORMAL <i>ITALIC</i> <u>UNDERLINE</u><br />And a new line</span>]]></text>
        </layer>     
    </layers>
</timeline>

Text encoding

If you’re using any kind of special characters in your text, make sure to send the XML string as a UTF-8 string. Alternatively you can set the encoded attribute of the text element to true and URL encode the content (window.encodeURIComponent in JavaScript, URLEncode.encode in Java etc.).

#Encoded text
<timeline version="1">
    <layers>
        <layer>
            <text duration="1000" encoded="true">%3Cstrong%3ETHIS%20IS%20MY%20ENCODED%20STRING%20WITH%20FANCY%20LETTERS%3A%20%C3%86%C3%98%C3%85%E6%97%A5%E6%9C%AC%E8%AA%9E%3C%2Fstrong%3E</text>
        </layer>
    </layers>
</timeline>

Included fonts

Our included fonts are: 2Dumb, 3Dumb, AlfaSlabOne, Alike, AnticSlab, Asap, BEARPAW, Bangers, Cabin, CantataOne, Cinzel, College, Distant Galaxy, DoppioOne, Electrolize, Existence Stencil, Existence, Flux Architect, Habibi, LearningCurve, Neo Retro, PROMESH, Playball, Roboto, Secret Typewriter, True Crimes

#Included fonts
<timeline version="1">
    <layers>
        <layer>
            <text duration="1000" font="2Dumb">2Dumb</text>
            <text duration="1000" font="3Dumb">3Dumb</text>
            <text duration="1000" font="AlfaSlabOne">AlfaSlabOne</text>
            <text duration="1000" font="Alike">Alike</text>
            <text duration="1000" font="AnticSlab">AnticSlab</text>
            <text duration="1000" font="Asap">Asap</text>
            <text duration="1000" font="BEARPAW">BEARPAW</text>
            <text duration="1000" font="Bangers">Bangers</text>
            <text duration="1000" font="Cabin">Cabin</text>
            <text duration="1000" font="CantataOne">CantataOne</text>
            <text duration="1000" font="Cinzel">Cinzel</text>
            <text duration="1000" font="College">College</text>
            <text duration="1000" font="Distant Galaxy">Distant Galaxy</text>
            <text duration="1000" font="DoppioOne">DoppioOne</text>
            <text duration="1000" font="Electrolize">Electrolize</text>
            <text duration="1000" font="Existence Stencil">Existence Stencil</text>
            <text duration="1000" font="Existence">Existence</text>
            <text duration="1000" font="Flux Architect">Flux Architect</text>
            <text duration="1000" font="Habibi">Habibi</text>
            <text duration="1000" font="LearningCurve">LearningCurve</text>
            <text duration="1000" font="Neo Retro">Neo Retro</text>
            <text duration="1000" font="PROMESH">PROMESH</text>
            <text duration="1000" font="Playball">Playball</text>
            <text duration="1000" font="Roboto">Roboto</text>
            <text duration="1000" font="Secret Typewriter">Secret Typewriter</text>
            <text duration="1000" font="True Crimes">True Crimes</text>
        </layer>
    </layers>
</timeline>

Custom fonts

You can use custom fonts (.ttf files only) by including a list of font elements in your XML.

#Custom font
<timeline version="1">
    <fonts>
        <font name="MyTestFont" src="https://s3.amazonaws.com/wevideo-static/APIdocs/VideoCreationAPI/assets/MyCustomFont.ttf" />
    </fonts>
    <layers>
        <layer>
            <text duration="3000" font="MyTestFont">Hello world</text>
        </layer>
    </layers>
</timeline>

Google fonts

Google fonts (from https://fonts.google.com/) are also supported (note the href instead of the src attribute in the example to the right).

#Google font
<timeline version="1">
    <fonts>
        <font name="Ravi Prakash" href="https://fonts.googleapis.com/css?family=Ravi+Prakash" />
    </fonts>
    <layers>
        <layer>
            <text duration="3000" font="Ravi Prakash">A Google Font</text>
        </layer>
    </layers>
</timeline>

HTML

You can render pure HTML by using the HTML tag. The HTML will be rendered on a 1920x1080 screen.

#HTML
<timeline version="1">
    <layers>
        <layer>
            <html duration="5000"><![CDATA[<html> <head><style>body{background:green;}</style></head><body><h1>Hello world</h1><img src="https://d3tvj3lw2y3r4c.cloudfront.net/webpage/prod3/img/bannerImages/EditorScreenshot.png" /></body></html>]]></html>
        </layer>     
    </layers>
</timeline>

Motion titles

A motion title entry

{
    "thumbnail": "https://s3.amazonaws.com/wevideo-test-thumbnails/1motiontitles/apr2017final/LineWipe.jpg",
    "id": 87405583,
    "title": "Line wipe - Title",
    "lines":     [
          {
      "text": "Primary text",
      "colors": [0],
      "font": "AlfaSlabOne",
      "size": 105,
      "uppercase": true
     },
          {
      "text": "Secondary text",
      "colors": [0],
      "font": "AnticSlab",
      "size": 75,
      "uppercase": false
     }
    ],
    "colors":     {
     "1": "rgba(255,200,30,1)",
     "0": "rgba(255,255,255,1)"
    },
    "introDuration": 2000,
    "outroDuration": 2000,
    "textFields": 2
   }

Motion titles are predefined text animations with some customizable elements. The available motion titles are listed at /api/3/videos/content/motiontitles, and the same motion titles are also available in the WeVideo editor.

FieldDescription
idThe ID of the motion title, you’ll need to include this in your XML
introDuration/outroDurationThe duration of the intro and outro animations. The duration of the motion title item should not be shorter than the sum of these values
linesThis array has an entry for each text field in the motion title. Each line can have a different font, font size and color
colorsThese are the colors used in the motion title. They are used both by the text itself and by other animation elements such as backgrounds and transitions
#A basic motion title using mostly default values
<timeline version="1">
    <layers>
        <layer>
            <motionTitle duration="5000" id="87405583">
                <lines>
                    <line>First line</line>
                    <line>Second line</line>
                </lines>
            </motionTitle>
        </layer>
    </layers>
</timeline>
#The same motion title with customized values
<timeline version="1">
    <layers>
        <layer>
            <motionTitle duration="10000" id="87405583">
                <lines>
                    <line font="Bangers" fontSize="150">First line</line>
                    <line font="Helvetica" fontSize="50">Second line</line>
                </lines>
                <colors>
                    <color key="0" value="rgba(255,0,0,1)"/>
                    <color key="1" value="rgba(255,0,255,1)"/>
                </colors>
            </motionTitle>
        </layer>
    </layers>
</timeline>

Transitions

Transitions are designed to be place in between two images or videos. Transitions will shorten the connected clips to create the transition effect, whether it be a cross-fade or other transition effect. If you want the audio in the videos next to transition to fade to silent through the transition, set the attribute fadeAudio to true for the transition item.

All the examples below are based on the same template, just with different type attributes.

#Transition template
<timeline version="1">
    <layers>
        <layer>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/goldenGate.jpg" duration="1000" />
            <transition type="wipeRight" duration="2000"/>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/field.jpg" duration="1000" />
        </layer>
    </layers>
</timeline>
TypeExample
wipeLefthttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_616431de-3c68-4dbb-b5b6-46eade77595d
patternSquarehttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_47b81d9c-0177-4bdb-b5c1-4130847cedab
flyEyehttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_3836e735-85fc-4bab-aa69-ea2f5c52a243
patternDotLargehttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_dc10ecdd-b4f7-4630-bbf3-d05b6856292f
radialhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_5fc72fc1-ecbd-4ac7-aeb4-6efdbd2e5a26
gridCirclehttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_39ee92eb-7935-4215-8989-c7e93943dbe5
animationBirdshttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_b0bf036f-13ee-408e-bbd2-f270f752d275
animationRainbowhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_2d277836-0286-4cdd-aed3-7d340bf11ebd
animationOrnamentalFormhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_3bdddec8-3da4-4aff-af29-e766d01d3c10
crossFadehttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_383b0856-da8f-458c-8c72-7056141119e8
3dTileHorizontalhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_615a3128-c8f2-4bc7-9b67-8f769e647a78
patternStarehttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_54425700-930d-4cbf-a168-554eedd09e55
swaphttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_77125a1e-b292-43bb-abdd-8393c2362103
3dFlipVerticalhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_5e38d70d-603a-4e9b-a3c4-2ad09fff9a52
fadeThroughWhitehttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_292b515e-b0d6-48d0-af63-92504191dfe1
animationCurtainshttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_76e0a7d3-e42d-4c5c-b81e-fcdb44b629e6
gridSlidinghttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_71c3db75-8263-401c-adc7-0a006580470b
patternCrosshttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_24f03f9f-18ee-4c05-a0e6-2356fec2a3cb
crossHatchhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_ad3f4cef-d449-4a3b-9596-62d771ba0074
animationParasolhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_8668c6df-a43e-4f66-8420-de1e7a0ac271
ripplehttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_767a891b-4399-4c82-9f57-6df9f4bb47d4
slidehttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_0da32801-c0df-4432-a727-8b5dcc861faa
gridSequentialhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_ecc81025-5182-439b-8987-90207177a91a
gridFallinghttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_f087ffa6-7d80-42bf-88ad-3efff5532791
patternBubblehttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_ec2d3145-09fd-41ac-9c8c-0c5c96757e8f
3dFlipHorizontalhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_6c4161be-1f05-4539-b91f-bf3bce548e33
patternDiamondhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_586cb872-c1b5-4bfa-896e-a4bb4225b355
puzzleRighthttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_f3c1a6e0-2715-4636-8e01-671d6735b39f
directionalWipehttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_843d3e5c-c720-4592-bba5-70f876d6b5ac
patternBlockhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_8cc4c79f-78b4-4325-a913-b16a80ddb03b
wipeUphttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_adc9b7ee-c5bb-44bc-bb6f-eeca6f62bf38
patternOrientalhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_164cc03f-56b6-491a-b5fe-dc462f4fdda7
animationFilmstriphttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_bd63eccd-a8a2-4af0-8737-a8f26ee10340
gridDiagonalhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_f066ff37-ffe4-460e-a9d2-359eb43d3844
atmospherichttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_09ca194e-6c1b-4a85-923e-9f30731b3ba7
fadeThroughBlackhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_ed4bb99a-3808-4144-982c-45f90c8065d3
patternLinehttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_c7c785dc-68c6-433f-8639-3349a27f260f
mosaichttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_f9bd17d6-832f-44a3-a6bc-96915602535a
animationPaperPlanehttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_f3010561-8d77-40ee-b018-cced88e639ae
3dCubeHorizontalhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_82299f06-78cf-44ac-8754-8c12fec20d4a
crossDissolvehttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_e7336cc8-2d3d-4c58-a019-aae34ee4a8b6
wipeDownhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_e38a3369-55b3-4739-a861-b82613090834
gridRandomhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_83e7717c-7524-4986-a1e3-5d1a777049fa
burnhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_679d522c-da8a-4428-a0ca-6b0d1c9f4071
wipeRighthttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_5fec6d67-4745-40db-984a-188546d435f9
3dCubeVerticalhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_f7e1aabe-b66c-43b1-8e0c-97a96d36a1c7
pageCurlhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_6225aea9-6fd7-4a01-ade1-4e08b0fe0249
3dTileVerticalhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_41dbdd19-c3ae-4a86-94b1-989fbb808952
patternDotSmallhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_5b302926-c792-477b-bdfa-720e9458310a
crossZoomhttp://d39dw27uwzzx6j.cloudfront.net/2017_02_21_8e833258-f72b-4c11-bc1b-f135d42a755e

Filters

Color correction

Colors can be tweaked by the color correction filter. Available parameters:
* brightness: -100 to 100
* saturation: -100 to 100
* contrast: -100 to 100
* hue: -180 to 180
* temperature: 3000 to 25000. Defaults to 6500
* tint: -100 to 100

#Color correction
<?xml version="1.0" encoding="UTF-8"?>
<timeline version="1">
    <layers>
        <layer>
            <video begin="0" duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4">
                <filter brightness="24" contrast="0" hue="-76" saturation="0" type="colorCorrection" />
            </video>
        </layer>
    </layers>
</timeline>

Blur

Adds a blur effect to the clip. Available parameters:
* strength: The amount of blurring. Default value is 0.03

#Blur
<timeline version="1">
    <layers>
        <layer>
            <video duration="1000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4" />
            <video duration="1000" inPoint="1000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4" >
                <filter type="blur" strength="0.015"/>
            </video>
            <video duration="1000" inPoint="2000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4" >
                <filter type="blur"/>
            </video>
            <video duration="1000" inPoint="3000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4" >
                <filter type="blur" strength="0.1"/>
            </video>
        </layer>
    </layers>
</timeline>

Sepia

#Sepia
<?xml version="1.0" encoding="UTF-8"?>
<timeline version="1">
    <layers>
        <layer>
            <video begin="0" duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4">
                <filter type="sepia" />
            </video>
        </layer>
    </layers>
</timeline>

Sharpen

#Sharpen
<?xml version="1.0" encoding="UTF-8"?>
<timeline version="1">
    <layers>
        <layer>
            <video begin="0" duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4">
                <filter type="sharpen" />
            </video>
        </layer>
    </layers>
</timeline>

Black and white

#Black and white
<?xml version="1.0" encoding="UTF-8"?>
<timeline version="1">
    <layers>
        <layer>
            <video begin="0" duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4">
                <filter type="blackAndWhite" />
            </video>
        </layer>
    </layers>
</timeline>

Vignette

Available parameters:
* alpha:Default value is 0.5
* radius:Default value is 0.75
* softness:Default value is 0.45

#Vignette
<?xml version="1.0" encoding="UTF-8"?>
<timeline version="1">
    <layers>
        <layer>
            <video begin="0" duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4">
                <filter type="vignette" />
            </video>
        </layer>
    </layers>
</timeline>

Scanlines

#Scanlines
<?xml version="1.0" encoding="UTF-8"?>
<timeline version="1">
    <layers>
        <layer>
            <video begin="0" duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4">
                <filter type="scanlines" />
            </video>
        </layer>
    </layers>
</timeline>

Invert colors

#Invert colors
<?xml version="1.0" encoding="UTF-8"?>
<timeline version="1">
    <layers>
        <layer>
            <video begin="0" duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4">
                <filter type="invertColors" />
            </video>
        </layer>
    </layers>
</timeline>

Dream

#Dream
<?xml version="1.0" encoding="UTF-8"?>
<timeline version="1">
    <layers>
        <layer>
            <video begin="0" duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4">
                <filter type="dream" />
            </video>
        </layer>
    </layers>
</timeline>

Audio ducking (beta)

Ducking is an effect that lowers the volume on other tracks when the volume/loudness on the ducked item reaches a threshold value. Available parameters, all optional:
* threshold: The loudness level to reach before the ducking kicks in. Defaults to 50
* duckingLevel: The volume level the other tracks will be lowered to. 0 to 1 (where 0 is completely muted and 1 is the original volume)
* attack: The time in milliseconds it takes for the volume to be reduced to the target level. Defaults to 520
* decay: The time in milliseconds it takes for the volume to return to the normal level. Defaults to 520
* sensitivity: The minimum interval between two ducking periods. Defaults to attack + decay

#Ducking
<timeline version="1">
    <layers>
        <layer>
            <video duration="9000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/justdoit.mp4">
                <filter type="audioDucking"/>
            </video>
        </layer>
        <layer>
            <audio duration="9000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/audio/typisk.wav"/>
        </layer>
    </layers>
</timeline>

Speed

You can adjust the playback speed of a video clip by using the speed filter. Supported values are 0.1 to 10. Remember to adjust the duration of the video item as well. A 5 seconds long video will only have enough content for 0.5 seconds of 10x speed.

#Speed
<timeline version="1">
  <layers>
    <layer>
      <video duration="20000" src="http://wevideo-test-original-videos.s3.amazonaws.com/2017_07_27_92464996-c7bd-492c-9b5d-a6cd5193fb3b">
        <filter speed="0.25" type="speed"/>
      </video>
    </layer>
  </layers>
</timeline>

Color overlay

The color overlay filter allows you to add a color on top of an image or a video. The color will be blended with the image/video using the specified blending method. Parameters:
* color: A hex RGB(A) value
* blendingMode: normal, multiply, screen, overlay, darken, lighten, colordodge, colorburn, hardlight, softlight, difference or exclusion.

#Color overlay
<timeline version='1'>
    <layers>
        <layer>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/colors.png" duration="1000">
            </image>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/colors.png" duration="1000">
                <filter color="#FF0000FF" type="colorOverlay" blendingMode="normal"/>
            </image>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/colors.png" duration="1000">
                <filter color="#FF0000FF" type="colorOverlay" blendingMode="multiply"/>
            </image>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/colors.png" duration="1000">
                <filter color="#FF0000FF" type="colorOverlay" blendingMode="screen"/>
            </image>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/colors.png" duration="1000">
                <filter color="#FF0000FF" type="colorOverlay" blendingMode="overlay"/>
            </image>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/colors.png" duration="1000">
                <filter color="#FF0000FF" type="colorOverlay" blendingMode="darken"/>
            </image>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/colors.png" duration="1000">
                <filter color="#FF0000FF" type="colorOverlay" blendingMode="lighten"/>
            </image>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/colors.png" duration="1000">
                <filter color="#FF0000FF" type="colorOverlay" blendingMode="colordodge"/>
            </image>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/colors.png" duration="1000">
                <filter color="#FF0000FF" type="colorOverlay" blendingMode="colorburn"/>
            </image>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/colors.png" duration="1000">
                <filter color="#FF0000FF" type="colorOverlay" blendingMode="hardlight"/>
            </image>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/colors.png" duration="1000">
                <filter color="#FF0000FF" type="colorOverlay" blendingMode="softlight"/>
            </image>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/colors.png" duration="1000">
                <filter color="#FF0000FF" type="colorOverlay" blendingMode="difference"/>
            </image>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/colors.png" duration="1000">
                <filter color="#FF0000FF" type="colorOverlay" blendingMode="exclusion"/>
            </image>
        </layer>
    </layers>
</timeline>

Animations

Certain properties can be animated.

Position

The position of an element can be animated through the left, right, top and bottom animations.

#Moving a video across the screen
<timeline version="1">
    <layers>
        <layer>
            <video duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4">
                <animation type="left" startValue="-1920" endValue="1920"/>
                <animation type="top" startValue="-1080" endValue="1080"/>
            </video>
        </layer>
    </layers>
</timeline>

Scale

The size of an element can be animated with the scale animation.

The easiest way to do this is to just set a startValue and endValue. After being scaled to fit the screen, like all media, the size will be multiplied by these values.

#Basic scaling
<timeline version="1">
    <layers>
        <layer>
            <video duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4">
                <animation type="scale" startValue="0.5" endValue="2"/>
            </video>
        </layer>
    </layers>
</timeline>

You can also scale each dimension separately.

#Width and height scaling 
<timeline version="1">
    <layers>
        <layer>
            <video duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4">
                <animation type="scale" startWidth="0.5" endWidth="1" startHeight="2" endHeight="1"/>
            </video>
        </layer>
    </layers>
</timeline>

Or define the values in pixels instead of relative to the input size.

#Values defined in pixels
<timeline version="1">
    <layers>
        <layer>
            <video duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4">
                <animation type="scale" startValue="500" endValue="1000" unit="px"/>
            </video>
        </layer>
    </layers>
</timeline>

By default the scaled image will be centered, but you can change this by setting the gravity attribute to one of the following values: NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast.

#Gravity attribute
<timeline version="1">
    <layers>
        <layer>
            <video duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4">
                <animation type="scale" startValue="1" endValue="0.3" gravity="SouthEast"/>
            </video>
        </layer>
    </layers>
</timeline>

Easing functions

Each animated property can have a different easing function (if no easing attribute is provided it will default to linear). Below is a table of the supported easing functions, with an example video of a clip moving across the screen.

#Easing example
<timeline version="1">
    <layers>
        <layer>
            <video duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4">
                <animation type="left" startValue="0" endValue="1920" easing="linear"/>
            </video>
        </layer>
    </layers>
</timeline>
TypeExample
linearhttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_afd86cd7-7328-48b7-8db9-998704301d9f
bounceEaseInhttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_7b10eaba-ab2a-41e1-a8f0-d7de398e0118
bounceEaseOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_759c5792-4391-4bfb-8926-6e71c3dbdc0b
bounceEaseInOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_8ca1c4bb-df24-4563-9ddc-34bdbd0068d7
backEaseInhttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_5b785ee4-3217-4b4e-ad48-85edd2acff46
backEaseOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_98b7870d-f860-4d74-ab83-f3554c860e99
backEaseInOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_4ca85a9f-e427-470c-a068-44ec490ff59a
circEaseInhttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_b95a33a0-39f7-4ab5-bce4-7b5e75e71a71
circEaseOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_9a7d4316-e529-42d2-8e44-8a754fe50f15
circEaseInOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_54af9e2b-0a9c-48a1-9f54-b3afb3fe55a5
cubicEaseInhttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_ba2ac7c0-e9fd-4956-be4e-84af91cfb67d
cubicEaseOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_a8f9acd0-8a09-4e00-8d97-55c1ce3f47c9
cubicEaseInOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_ae218f75-7264-4867-9ca7-9f4a668a4fa1
elasticEaseInhttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_ccbe5076-5ec2-4d1d-a9a1-13d4c02dbe4d
elasticEaseOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_d5669b66-33e1-4803-a407-eb2f06e125dc
elasticEaseInOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_8383f5db-2501-4a65-9c7e-903488a14f93
expoEaseInhttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_6216a202-908a-42bc-b3a9-ea1456887007
expoEaseOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_68524e7a-da42-449e-88bd-a1a77d9be2c9
expoEaseInOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_faaa09bc-e425-4dc6-ba77-e93e28dd00f3
quadEaseInhttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_8ea45ced-9ba2-441b-8621-55c59f6bf78a
quadEaseOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_ad18f3ce-f64a-49c1-aa3c-cb619d29d118
quadEaseInOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_0aa35837-ca9d-4283-8d08-f680539f0386
quartEaseInhttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_6b8c30ee-4a9f-44dd-bd45-1096b63f566c
quartEaseOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_dc1d9709-80a3-4576-84a5-f0aeb0a18fa0
quartEaseInOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_df2308e8-50b8-43a8-9c13-94968fcf8df0
quintEaseInhttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_a5a43aed-189e-4b9b-8dd3-1e7b0d6d557d
quintEaseOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_a827a71b-3682-4654-913e-ee34f3d048f4
quintEaseInOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_a87e2907-b45f-4c41-8a1a-3a9b98f509b1
sineEaseInhttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_9221106b-3814-46db-ac47-ca38539abb1a
sineEaseOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_463fc9c2-fd14-4469-959c-63cd10867937
sineEaseInOuthttp://d39dw27uwzzx6j.cloudfront.net/2017_03_06_5610fa0a-25b9-4f26-ac6f-ed9ff0278dd1

Opacity

You can also adjust the opacity of an item by including a list of opacity entry elements. The opacity will scale linearly between each of these timestamps.

#Controlling opacity
<timeline version="1">
    <layers>
        <layer>
            <image duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/goldenGate.jpg">
                <opacity>
                    <entry time="0" value="0" />
                    <entry time="1000" value="1" />
                    <entry time="1500" value="0.5" />
                    <entry time="4000" value="0.5" />
                    <entry time="5000" value="0" />
                </opacity>
            </image>
        </layer>
        <layer>
            <video duration="5000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/frameCounter.mp4" />
        </layer>
    </layers>
</timeline>


Examples

Single Image

<!-- Single Image -->
<timeline version="1">
    <layers>
        <layer>
            <image src="http://wevideo-test-images.s3.amazonaws.com/2017_01_30_97ee7dda-ad24-4fd9-bfb7-76fe001de476" duration="1000" />
        </layer>
    </layers>
</timeline>


Image, pause then video

<!-- Image, pause then video -->
<timeline version="1">
    <layers>
        <layer>
            <image src="http://wevideo-test-images.s3.amazonaws.com/2016_12_02_ed64dc5c-d14c-4499-ab4a-611abe3a4433" duration="2000" />
            <video src="http://wevideo-test-proxy-videos.s3.amazonaws.com/2017_01_17_38613d64-73f4-4c42-aab2-aac6728d5e2f" duration="2000" begin="3000" inPoint="2000"/>
        </layer>
    </layers>
</timeline>


Image on top of video, with music

<!-- Image on top of video, with music -->
<timeline version="1">
    <layers>
        <layer>
            <image src="http://wevideo-test-images.s3.amazonaws.com/2016_12_02_ed64dc5c-d14c-4499-ab4a-611abe3a4433" duration="5000" />
        </layer>
        <layer>
            <video src="http://wevideo-test-proxy-videos.s3.amazonaws.com/2017_01_17_38613d64-73f4-4c42-aab2-aac6728d5e2f" duration="5000" />
        </layer>
        <layer>
            <audio src="http://wevideo-test-audio.s3.amazonaws.com/2016_10_31_e7c7fbd0-ed48-49dc-91d9-6647107bd25d" duration="5000" />
        </layer>
    </layers>
</timeline>


Transition

<!-- Transition -->

<timeline version="1">
    <layers>
        <layer>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/goldenGate.jpg" duration="1000" />
            <transition type="wipeRight" duration="2000"/>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/field.jpg" duration="1000" />
        </layer>
    </layers>
</timeline>


Basic text

<!-- Basic text -->

<timeline version="1">
    <layers>
        <layer>
            <text duration="3000">Simple text</text>
        </layer>
        <layer>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/goldenGate.jpg" duration="3000" />
        </layer>
    </layers>
</timeline>

Super basic text with a default size, color, font and position


Styled text

<!-- Styled text -->

<timeline version="1">
    <layers>
        <layer>
            <text left="100" top="100" height="880" width="1720" duration="3000" font="Bangers" fontSize="180" backgroundColor="red" fadeIn="1000" fadeOut="1000">Styled and fading text</text>
        </layer>
        <layer>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/goldenGate.jpg" duration="3000" />
        </layer>
    </layers>
</timeline>

Styled text that fades in and out


HTML text

<!-- HTML text -->

<timeline version="1">
    <layers>
        <layer>
            <text duration="3000"><![CDATA[<span style="font-size: 36px;">NORMAL <i>ITALIC</i> <u>UNDERLINE</u><br />And a new line</span>]]></text>
        </layer>     
    </layers>
</timeline>

You can also include HTML directly in the text content


SVG text

#Using custom HTML with SVG
<timeline version="1">
    <layers>
        <layer>
            <html duration="1000"><![CDATA[
                <html>
                    <head>
                        <style>
                            body {
                                margin: 0;
                                padding: 0;
                                display: flex;
                                align-items: center;
                                justify-content: center;
                                height: 100vh;
                                font-family: 'Open Sans', sans-serif;
                            }

                            svg {
                                width: 1000px;
                                height: 200px;
                            }

                            svg #overlay {
                                fill: white;
                                opacity: 0.7;
                            }

                            svg #text {
                                font-size: 100px;
                                font-weight: bold;
                                text-anchor: middle;
                            }

                            svg #r {
                                fill: white;
                                mask: url(#mask);
                            }
                        </style>
                    </head>

                    <body>
                        <svg>
                            <defs>
                                    <mask id="mask" x="0" y="0" width="100%" height="100%">
                                <rect id="overlay" x="0" y="0" width="100%" height="100%" />
                                <text id="text" x="50%" y="0" dy="130px">HELLO SVG</text>
                            </mask>
                        </defs>
                        <rect id="r" x="0" y="0" width="100%" height="100%" />
                        </svg>
                    </body>
                </html>
            ]]></html>
        </layer>
        <layer>
            <image src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/images/goldenGate.jpg" duration="1000" />
        </layer>
    </layers>
</timeline>

SVG elements can be used to achieve things that are difficult to do with pure HTML, such as having a knockout text effect that is transparent to the layer below.

Volume

#Volume
<timeline version="1">
    <layers>
        <layer>
            <text duration="3000">Simple text</text>
        </layer>
        <layer volume="1">
            <video volume="0" src="https://s3.amazonaws.com/wevideo-static/jontest/0428_011.mov" duration="5000"/>
        </layer>
    </layers>
</timeline>

Both layers and media items can have a volume attribute. 1 is full volume and the default value, 0 is muted. The final volume for a media item is the layer volume multiplied with the item volume.

Volume graphs

#Volume
<timeline version="1">
    <layers>
        <layer>
            <image duration="10000" src="http://wevideo-test-images.s3.amazonaws.com/2017_01_30_97ee7dda-ad24-4fd9-bfb7-76fe001de476" />
        </layer>
        <layer>
            <audio duration="10000" src="http://wevideo-test-audio.s3.amazonaws.com/2016_05_25_4da4e694-cb70-4157-8590-b6d575743fc0">
                <volume>
                    <entry time="0" value="0" />
                    <entry time="1000" value="1" />
                    <entry time="2000" value="0" />
                    <entry time="3000" value="1" />
                    <entry time="9000" value="0" />
                </volume>
            </audio>
        </layer>
    </layers>
</timeline>

You can also control the volume by including a list of volume entry elements. The volume will scale linearly between each of these timestamps.

Keying and Masking

Keying

Keying out a color is very useful for composing a variety of different videos such as making a news clip or weather forecast or just to add special effects to a background.

<!-- Keying out the Green background -->
<timeline version="1">
    <layers>
        <layer>
            <video duration="9000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/justdoit.mp4">
                <filter type="chromaKey" color="#599c6a" />
            </video>
        </layer>
        <layer>
            <video duration="9000" src="https://s3.amazonaws.com/wevideo-static/assets/apidemo/videos/purptiles.mp4" />
        </layer>
    </layers>
</timeline>
<!-- Masking -->
<timeline version="1">
    <layers>
        <layer>
            <video duration="4000" src="http://wevideo-test-proxy-videos.s3.amazonaws.com/2016_12_09_f22f56c8-acc2-4d98-90f4-b2028361250d">
                <filter type="mask" src="https://s3.amazonaws.com/wevideo-exporter-files/transitions/v2/transition_grid_sequential.mov" />
            </video>
        </layer>
        <layer>
            <image duration="4000" src="http://wevideo-test-images.s3.amazonaws.com/2016_05_24_69ac6d6c-8327-4c2d-ad94-84832cdfbb0a" />
        </layer>
    </layers>
</timeline>

When keying out a color, the API automatically generates the mask when rendering on-the-fly. All you have to do is simply define the color that is being keyed out.

In our example video justdoit.mp4 the color of the background is #599c6a so we set that filter for chromaKey.

We place the desired background video in a layer beneath the chromakey layer to follow layer priority. In this case, our background video is purptiles.mp4


Masking

Mask should be a black and white image or video. Optional parameter to the filter: invert=true to invert the mask.

Errors

The WeVideo Video Creation API uses the following error codes:

Error Code Meaning
400 Bad Request – Check your authorization and method of sending HTTP calls. Check your JSON/XML for any errors.
401 Unauthorized – Your API key is wrong.
405 Method Not Allowed – You tried to access with an invalid method.
406 Not Acceptable – You requested a format that is invalid.
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarially offline for maintanance. Please try again later.

Preview tool

You can use this basic preview tool to quickly test API functionality.