Body
-
The SID of the Group Room with the media tracks to be used as composition sources.
Minimum length is
34, maximum length is34. Format should match the following pattern:^RM[0-9a-fA-F]{32}$. -
An object that describes the video layout of the composition in terms of regions. See Specifying Video Layouts for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request
-
An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition includes all audio sources specified in
audio_sourcesexcept for those specified inaudio_sources_excluded. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example,student*includesstudentas well asstudentTeam. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request -
An array of track names to exclude. The new composition includes all audio sources specified in
audio_sourcesexcept for those specified inaudio_sources_excluded. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example,student*excludesstudentas well asstudentTeam. This parameter can also be empty. -
A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to
640x480. The string's format is{width}x{height}where:- 16 <=
{width}<= 1280 - 16 <=
{height}<= 1280 {width}*{height}<= 921,600
Typical values are:
- HD =
1280x720 - PAL =
1024x576 - VGA =
640x480 - CIF =
320x240
Note that the
resolutionimposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See Specifying Video Layouts for more info. - 16 <=
-
The container format of the composition's media files as specified in the POST request that created the Composition resource. See POST Parameters for more information.
Values are
mp4orwebm. -
The URL we should call using the
status_callback_methodto send status information to your application on every composition event. If not provided, status callback events will not be dispatched. -
The HTTP method we should use to call
status_callback. Can be:POSTorGETand the default isPOST.Values are
GETorPOST. -
Whether to clip the intervals where there is no active media in the composition. The default is
true. Compositions withtrimenabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See Specifying Video Layouts for more info.
curl \
--request POST 'https://video.twilio.com/v1/Compositions' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'Trim=true&Format=mp4&RoomSid=RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Resolution=1920x1080&VideoLayout=%7B%7D&AudioSources=RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AudioSources=user*&AudioSourcesExcluded=RTbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
{"Trim" => true, "Format" => "mp4", "RoomSid" => "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "Resolution" => "1920x1080", "VideoLayout" => "{}", "AudioSources" => ["RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "user*"], "AudioSourcesExcluded" => ["RTbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"]}
{
"sid": "CJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://video.twilio.com/v1/Compositions/CJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"size": 0,
"trim": true,
"links": {
"media": "https://video.twilio.com/v1/Compositions/CJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
},
"format": "mp4",
"status": "processing",
"bitrate": 0,
"duration": 0,
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"resolution": "1920x1080",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "2015-07-30T20:00:00Z",
"date_deleted": null,
"video_layout": {
"custom": {
"reuse": "show_oldest",
"width": 800,
"x_pos": 100,
"y_pos": 600,
"z_pos": 10,
"height": 0,
"max_rows": 0,
"max_columns": 0,
"video_sources": [
"user*"
],
"cells_excluded": [
2,
3
],
"video_sources_excluded": [
"RTcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
]
}
},
"audio_sources": [
"RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"user*"
],
"date_completed": null,
"encryption_key": null,
"status_callback": "https://mycallbackurl.com",
"audio_sources_excluded": [
"RTbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
],
"status_callback_method": "POST",
"media_external_location": null
}