Adjust Video Loop Style
Loop Style
We provide 3 ways to adjust how a video loops in a scene.
loop
fit_to_scene
freeze
Let's see how these three loop styles affect video rendering.
Loop
Loop, literally, will make the video loop until the end of the video track.
Fit to scene
This will speed up or slow down the video to make sure the video duration is exactly the same as the scene duration.
Freeze
After the video has finished playing, continue to maintain the last frame of the video, until the end of the video track.
Example
Here is an example of adjusting the loop style of a video.
Template video:
add050630b74443fb9541965307b6083
Get variables:
{
"code": 100,
"data": {
"scenes": [
{
"variables": [
{
"name": "video_0",
"properties": [
{
"default": "https://surreal-product.s3.amazonaws.com/prod/movio/preset/video/origin/d9831b49b2ed4f5a8cad812f66bf4cb9.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAWTIFNQS3KRF4QRED%2F20220928%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20220928T100921Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=146601581ea23f17288a188c6c1d4428cde665eda057e3a544be1aef30b6ba07",
"name": "link"
},
{
"default": "loop",
"name": "loop_style"
}
],
"type": "video"
}
]
}
],
"template_id": "b2aebbb831884983ace89aa4175fa7e7",
"video_id": "b2aebbb831884983ace89aa4175fa7e7"
},
"message": "Success"
}
Generate video from template:
curl --location --request POST 'https://craft-api.surreal-ai.com/pacific/api/v1/template.generate' \
--header 'x-api-key: O/rgPJbuWtusgyBOfYBHytyIuL2DeGowXB7rTBwLpxY=' \
--header 'Content-Type: application/json' \
--data-raw '{
"template_id": "b2aebbb831884983ace89aa4175fa7e7",
"title": "test sub video",
"test":true,
"variables": [
{
"properties": {
"link": "https://surreal-public.s3.us-east-2.amazonaws.com/demo_video/0.mp4",
"loop_style": "fit"
},
"name": "video_0"
}
]
}'
Updated 6 months ago