Markdown to Video
Do you have a video script in markdown? We can help you turn it into a video. We will add images, colours, and animations to your video.
How it works​
Let's say you have a markdown file that looks like this:
# My first video
This is a paragraph. ![This is an image](https://picsum.photos/200/300)
## This is a heading
Here is a list:
- Item 1
- Item 2
- Item 3
> This is a blockquote
! This is a call to action
You can copy the markdown directly into the web video editor to see what it will look like.
Now let's call the API to create a video from this script.
curl -X POST "https://ENDPOINT/v1/template/markdown?api_key=API_KEY" \
-H "Content-Type: application/json" \
-d '{"markdown": "YOUR MARKDOWN HERE", "draft": true}'
Let's break down the request:
markdown
: This is the markdown script we want to turn into a videodraft
: This tells the system to create a draft video. This wont spend any of your credits. You'll get a link to the video in the response.
Here is the response we get back.
As we asked for a draft
video we get back a link to the video rather than a render.
{
"video_id": "i5RrEzLGzV",
"title": "My first video",
"editor_url": "https://ENDPOINT/editor/i5RrEzLGzV",
"created": 1616425200000
}
Rendering the video​
Now that we have tested with a draft video, let's create a rendered video. We will send the same request as before, but this time we will set draft
to false
.
We'll will also pass an example webhook_url
from https://webhook.site/
so we can see the webhook in action.
This will spend 1 credit from your account.
curl -X POST "https://ENDPOINT/v1/template/markdown?api_key=API_KEY" \
-H "Content-Type: application/json" \
-d '{"markdown": "YOUR MARKDOWN HERE", "draft": false, "webhook_url": "https://webhook.site/3855b248-f24a-4524-89f1-d991686d06b6"}'
After a few seconds we get a response back telling us that the video is being rendered.
{
"render_id": "EXOV4OHkuV",
"video_id": "Vvsx9YBcd2",
"status": "pending",
"editor_url": "https://ENDPOINT/editor/EXOV4OHkuV",
"progress": 0
}
And after a few minutes we get a webhook notification,
{
"status": "complete",
"video_id": "Vvsx9YBcd2",
"render_id": "EXOV4OHkuV",
"editor_url": "https://ENDPOINT/editor/Vvsx9YBcd2/renders/EXOV4OHkuV",
"video_url": "https://firebasestorage.googleapis.com/v0/b/storage-dev.getvidon.com/o/video%2FVvsx9YBcd2%2Frender%2FEXOV4OHkuV%2Fvideo.mp4?alt=media",
"subtitles_url": "https://firebasestorage.googleapis.com/v0/b/storage-dev.getvidon.com/o/video%2FVvsx9YBcd2%2Frender%2FEXOV4OHkuV%2Fsubtitles.srt?alt=media",
"animated_thumbnail_url": "https://firebasestorage.googleapis.com/v0/b/storage-dev.getvidon.com/o/video%2FVvsx9YBcd2%2Frender%2FEXOV4OHkuV%2Fthumbnail.gif?alt=media",
"thumbnail_url": "https://firebasestorage.googleapis.com/v0/b/storage-dev.getvidon.com/o/video%2FVvsx9YBcd2%2Frender%2FEXOV4OHkuV%2Fthumbnail.jpg?alt=media",
"metadata": {
"title": "Using video to standout on social media",
"description": "Want to learn more?\nRead the full article",
"hashtags": [],
"key_moments": [],
"cta": "Want to learn more?\nRead the full article",
"duration": 10
}
}