I want to change the background of a video. Is this possible?
There are two ways to change the background of a video:
- Default background colour of the viewport
- Specific background colour at specific timestamp
Default background colour of the viewport
{
"timeline": {
"soundtrack": {
"src": "https://shotstack-assets.s3-ap-southeast-2.amazonaws.com/music/freepd/advertising.mp3"
},
"background": "#45dae8",
"tracks": [
{
"clips": [
{
"asset": {
"type": "html",
"html": "<p>HELLO CYAN</p>",
"css": "p { font-family: \"Montserrat ExtraBold\"; color: #ffffff; font-size: 64px; text-align: center; }",
"width": 1280,
"height": 720,
"background": "transparent"
},
"start": 1,
"length": 5,
"transition": {
"in": "fade",
"out": "fade"
}
}
]
}
]
},
"output": {
"format": "mp4",
"resolution": "hd"
}
}
Specific background colour at specific timestamp
{
"timeline": {
"soundtrack": {
"src": "https://shotstack-assets.s3-ap-southeast-2.amazonaws.com/music/freepd/advertising.mp3"
},
"background": "#FFFFFF",
"tracks": [
{
"clips": [
{
"asset": {
"type": "html",
"html": "<p>HELLO CYAN</p>",
"css": "p { font-family: \"Montserrat ExtraBold\"; color: #ffffff; font-size: 64px; text-align: center; }",
"width": 1280,
"height": 720,
"background": "transparent"
},
"start": 1,
"length": 5,
"transition": {
"in": "fade",
"out": "fade"
}
},
{
"asset": {
"type": "html",
"html": "<p>HELLO PINK</p>",
"css": "p { font-family: \"Montserrat ExtraBold\"; color: #ffffff; font-size: 64px; text-align: center; }",
"width": 1280,
"height": 720,
"background": "transparent"
},
"start": 8,
"length": 5,
"transition": {
"in": "fade",
"out": "fade"
}
}
]
},
{
"clips": [
{
"asset": {
"type": "html",
"html": "<p></p>",
"width": 1280,
"height": 720,
"background": "#45dae8"
},
"start": 0,
"length": 7
},
{
"asset": {
"type": "html",
"html": "<p></p>",
"width": 1280,
"height": 720,
"background": "#da8afc"
},
"start": 7,
"length": 7
}
]
}
]
},
"output": {
"format": "mp4",
"size": {
"width": 1280,
"height": 720
}
}
}
I have completed this section and my background is still not showing throughout the video. Any suggestions?
Can you share your JSON?