Docs
Publishing a video
How to get a finished video onto a platform, by uploading it yourself or by posting it from explainroo.
Which files do I publish?
Run render for the finished video, then verify to check its sound and picture. Upload the full-size MP4. Keep drafts for reviewing your work.
A normal render gives you these files in out/:
| File | What it is for |
|---|---|
video.mp4 |
the video to upload |
video.srt, video.vtt |
captions viewers can turn on and off |
video.cover.jpg |
a cover image without captions |
video.chapters.txt |
chapter times for a YouTube description, when your script names chapters |
If you use --out, the extra files share that name. A video without narration gets no subtitle files. A partial render with --from or --to leaves out the chapters and the cover.
For one platform, a package is the quicker way. It holds the video at that platform’s size and the words for the post.
Which sizes can a video have?
Set "size" in video.json to the place the video goes. explainroo sizes lists the sizes. Before explainroo 0.6, that list was explainroo formats, which now lists the formats.
| Size | Pixels | For |
|---|---|---|
youtube (or 16:9) |
1920 x 1080 | YouTube and other wide players |
shorts |
1080 x 1920 | YouTube Shorts |
tiktok |
1080 x 1920 | TikTok |
reels |
1080 x 1920 | Instagram and Facebook Reels |
vertical |
1080 x 1920 | one file for Shorts, TikTok and Reels |
instagram |
1080 x 1350 | Instagram and Facebook feed posts |
linkedin |
1080 x 1350 | the LinkedIn feed |
square (or 1:1) |
1080 x 1080 | square posts on X, LinkedIn and Facebook |

9:16, 4:5 and any size written as WIDTHxHEIGHT with even numbers also work. The default is 16:9.
Shorts, TikTok and Reels put their own buttons, the account name and the post text on top of the video. Each app covers a slightly different part of the screen. With shorts, tiktok, reels and vertical, explainroo keeps text and the captions out of those spots. It moves the watermark to the top right, and check warns about any text the app could cover. With "defaults": "0.6", pictures and backgrounds may fill the whole frame, also behind the app’s buttons. See filling the frame. A plain 9:16 video has no such margins.
The frame rate is 30 frames per second unless you set "fps" to 24, 25, 50 or 60.
How do I use one project in several sizes?
Use --size on the commands that draw the video, which the commands page lists. It changes the size for that run and leaves video.json alone. Narration and word times are shared, unless a size has a pace of its own. Captions set to "auto" follow the chosen size.
npx --yes explainroo check videos/dns --size youtube
npx --yes explainroo sheet videos/dns --size youtube
npx --yes explainroo render videos/dns --size youtube
npx --yes explainroo check videos/dns --size tiktok
npx --yes explainroo sheet videos/dns --size tiktok
npx --yes explainroo render videos/dns --size tiktok
Check each size and look at its sheet before rendering. Use s.safe, s.cx, s.cy, s.row, s.col and s.grid for positions. s.portrait tells you when to stack things in a tall frame. Size text from the short side of s.safe, like Math.min(s.safe.w, s.safe.h) / 100, so it fits wide and tall frames alike. See drawing scenes and the scene reference.
Outputs get size names, such as out/video-tiktok.mp4 and matching subtitles, cover and chapters. Stills go in out/stills-tiktok/, and the sheet is out/sheet-tiktok.jpg. Ratios use a hyphen, such as video-9-16.mp4. --out still picks your own name.
verify videos/dns --size tiktok checks out/video-tiktok.mp4. With --out, pass the file to verify with --file.
How do I give one size its own settings?
"sizes" in video.json gives one size settings of its own. A block can set these settings, with the same values as at the top of the file:
captionscoverpacewatermarktargetSeconds
Here the TikTok version gets bold captions and a quicker pace, and the wide version stays as it is:
{
"size": "16:9",
"sizes": {
"tiktok": { "captions": "bold", "pace": 1.2 }
}
}
explainroo set videos/dns sizes.tiktok.pace 1.2 writes one setting of a block for you. render --size tiktok and a TikTok package use the block, and a plain render doesn’t. A block follows its exact size name, so a block for 16:9 doesn’t apply to --size youtube. The block of a size wins over the top of the file and over the block of a language.
A size whose block sets another pace gets narration of its own, and a paid voice buys it once at that pace. explainroo voice videos/dns --size tiktok makes that narration. Check such a video with verify videos/dns --size tiktok, which reads the scene times of that size.
How do I upload subtitles?
render writes SRT and VTT files even when captions is false. These files let viewers choose captions. Captions drawn into the video stay visible all the time.
On YouTube, upload the video, then add video.srt under its subtitles in YouTube Studio. Choose the video’s language and upload it with timing. On LinkedIn, add video.srt as the caption file while preparing your video post. Use the subtitle file from the same render as the video, so the times match.
VTT is useful for web players. The exported player includes subtitles and a CC button.
How do I add chapters?
Name a chapter in a scene heading, such as ## resolver {chapter="How the resolver finds it"}. It starts at that scene and lasts until the next chapter. See writing the script for the full rules.
render puts chapters in the MP4 and writes video.chapters.txt. Paste the file’s text into your YouTube description. YouTube needs at least three chapters, each at least ten seconds long. check gives hints when they do not meet those rules.
How do I choose the cover?
By default, cover is "auto", and the cover is a full-size JPEG without captions. In a project with "defaults": "0.5", auto takes the frame of the first scene with the most elements fully there, and a frame with a picture in it comes first. Code that is still typing and a number that is still counting don’t count as there yet. With "defaults": "0.6", it looks in the first scene that shows a picture, like a recording or a clip. A project without a defaults line takes the end of the first scene, or 1 second into it on the sizes for short vertical videos. Choose another moment in video.json:
"cover": "resolver@2.4"
A number such as 12.5 is seconds into the whole video. "intro" or "intro@end" picks a scene’s end, and "intro@start" picks its start. A new cover needs no new render. When only the cover changed, render and package keep the video and write only the new cover, and they say so. check gives a hint when the cover shows only text on an empty background, and with "defaults": "0.5" when it shows something half typed or half counted. Use the JPEG wherever the upload form lets you choose a cover.
Some feeds use the video’s first frame. Give an opening title enter: "none" so that frame has something to show. Changing cover changes the JPEG, so also check which frame the platform uses.
How do I make a GIF?
Use a GIF for a short example in a README or post:
npx --yes explainroo render videos/dns --format gif --from 2 --to 8
This writes out/video.gif. GIFs are silent, run at 15 frames per second and have a long side of at most 960 pixels. --out demo.gif picks another file name. Its ending must match the format. verify checks video files, so review the GIF yourself.
How do I put a diagram over filmed footage?
Render a transparent video for your editor:
npx --yes explainroo render videos/dns --transparent --format mov
npx --yes explainroo still videos/dns --transparent
npx --yes explainroo verify videos/dns --file videos/dns/out/video.mov
MOV uses ProRes 4444 for editors. Use --format webm for VP9 on the web. MP4 and GIF do not support --transparent. Without the flag, MOV and WebM have an opaque background.
The look’s background texture is left out. Anything you paint stays, including s.bg(), s.ui.backdrop(), cards, captions and the watermark. Use a card or text’s bg option when it needs to read over footage. Slide, wipe and brush transitions become fades. The cover stays an opaque JPEG.
still --transparent saves PNG frames with alpha. verify --file checks the finished video and skips black-frame checks for transparent video.
How do I embed the web player?
Use export for a video on your website. It draws the scenes at the screen’s resolution, so text stays sharp as the player grows:
npx --yes explainroo export videos/dns
It writes out/player/ with everything the player needs, its subtitles included. It makes the voice first if needed. --out <dir> chooses another folder, and --size tiktok writes the TikTok size to out/player-tiktok/.
Copy the whole folder to your site and serve it with a static web server. Keep its files together. It can live in a subfolder and needs no explainroo server. Opening index.html as a local file does not work.
For a wide video, embed it like this. Match the aspect ratio to your video’s width and height:
<div style="aspect-ratio: 1920 / 1080; width: 100%">
<iframe
src="/videos/dns/index.html"
title="How DNS finds a website"
style="width: 100%; height: 100%; border: 0"
allow="autoplay; fullscreen"
allowfullscreen
></iframe>
</div>
Add ?autoplay=1&muted=1 for muted autoplay, subject to the browser’s rules. ?t=12.5 starts at 12.5 seconds. Click the picture, Space or K to play or pause. Arrow keys seek five seconds. F opens fullscreen and M mutes. CC turns text captions on and off and remembers the choice. Captions drawn in the scenes stay visible.
Clips use the browser’s video decoder, so choose a format that browser can play. Clip timing can differ a little from the MP4. Math is included as typeset paths. Project modules must use relative local imports. The export leaves out project dotfiles, JSON and text files. Use the MP4 when uploading to video platforms.
How do I make a package for a platform?
A package is a folder with everything you need to post a video on one platform:
npx --yes explainroo package videos/dns --platform tiktok
Each platform gets its own size:
| Platform | Size | Watermark |
|---|---|---|
youtube |
youtube, 1920 x 1080 |
as set in video.json |
shorts |
shorts, 1080 x 1920 |
as set in video.json |
tiktok |
tiktok, 1080 x 1920 |
off |
reels |
reels, 1080 x 1920 |
as set in video.json |
linkedin |
linkedin, 1080 x 1350 |
as set in video.json |
x |
square, 1080 x 1080, or another with --size |
as set in video.json |
When "sizes" has a block for the platform’s size, the package uses it. A project whose own size gives the same frame keeps its size, so a 16:9 project goes to YouTube as it is.
The folder is out/package/<platform>/. It holds the video at the platform’s size and description.txt, the words for the platform’s text box, ready to paste. Next to them are the subtitle files and the cover, and on YouTube the chapters. credits.txt has one credit per line, and post.json has everything that was settled for this platform. report.json is the verify report of the video.
First package checks the layout at the platform’s size, and an error stops it with the same messages as check. A video you already rendered is copied when it is this exact video. That means a final of the whole video at full scale, with the same settings and the same version of explainroo. A draft never counts. Otherwise package renders the video, and it names the render command whose file it could copy next time. Then it runs verify on the file. Fix any error before you post. Package one platform at a time, because two runs at once in one project get in each other’s way.
How do I look at a platform’s version first?
Render that version, look at it, and then package it. The package copies the file instead of rendering it again:
npx --yes explainroo check videos/dns --platform tiktok
npx --yes explainroo render videos/dns --platform tiktok
npx --yes explainroo package videos/dns --platform tiktok
--platform sets up a run of check or render the way that platform’s package is made, and still and sheet take it too. It uses the platform’s size and its block in "sizes", and it also follows the platform’s watermark rule. For TikTok that is the same as --size tiktok --no-watermark.
What goes into the words of a post?
Write post.json next to video.json. Every field is optional:
{
"title": "How DNS finds a website",
"description": "Your browser asks a resolver for the address of a site. This video shows each step it takes.",
"hashtags": ["#dns", "#networking"],
"platforms": {
"tiktok": {
"description": "How your browser finds a website, step by step."
}
}
}
The title is the video’s title unless you set one. A block under platforms wins over the top of the file for that platform, and the matching flags on package, like --title, win over both. package warns until there is a description. It also warns when a text is longer than the platform takes, or the video is longer than it allows. It never stops on these, because platforms change them.
YouTube has its own field for the title. So on YouTube and Shorts, description.txt holds the description with the chapters and the hashtags. Every other platform has one text field. There description.txt holds the description, or the title when there is none, followed by the hashtags. For YouTube, post.json can also set made_for_kids, which is false by default. category is YouTube’s category id, and the default 27 is Education.
Does the post say that AI made it?
package works that out from the project. The label is on when the voice is synthetic, or when the project bought AI clips or images. ai_reasons in the package’s post.json says why, like "voice: Kokoro". A video with a recorded voice and no AI files gets no label. Set ai_label in your post.json to change it either way.
The credits name these:
- the voice
- the music, with the
creditfromvideo.jsonfor a music file - the model of each clip and image the project bought
- “Made with explainroo”
Both read the project’s record, so a clip that you bought counts even when no scene uses it. A video made from a format also names the format’s author.
A video with an AI presenter always gets the label, with the presenter named in its reasons and its credits. "ai_label": false can’t turn it off there, and package says so. Add more credits with credits in post.json. Credits stay in credits.txt and post.json, and they never go into the text of a post by themselves.
Why does the TikTok file have no watermark?
TikTok’s Content Sharing Guidelines say that apps and integrations “should not superimpose or otherwise include any brand name, logo, watermark, other promotional branding, link or promotional text, on or in any content which is shared to TikTok”. A TikTok package is made to be posted by such an app, so its file has no “explainroo.com” in the corner. The same rule is why credits never go into the text of a post by themselves.
Without the watermark, s.safe starts a little higher on TikTok. check --platform tiktok and still --platform tiktok show the frames the way they will be packaged.
How do I post a video from explainroo?
explainroo publish posts a package with your own account. It posts to YouTube directly, or through Buffer and Blotato for the other platforms. It never renders, so make the package first. It stops when the package is missing or out of date, and when verify found errors in it. Run it with --dry-run first:
npx --yes explainroo publish videos/dns --via youtube --dry-run
The dry run reads your account and your channels. It prints the exact post and sends nothing. The plan shows the account and the channel, and the title and the text with the hashtags. It also says when a post goes public right away. A run without --dry-run prints the same plan first. In a terminal you have to type yes. Without a terminal it needs --yes, and your agent adds that only after you said yes.
This is where each package can go:
| Package | --via youtube |
--via buffer |
--via blotato |
|---|---|---|---|
youtube, shorts |
your channel | a YouTube channel | a YouTube account |
tiktok |
no | a TikTok channel | a TikTok account |
reels |
no | an Instagram channel | an Instagram account |
linkedin |
no | a LinkedIn channel | your own LinkedIn profile |
x |
no | an X channel | an X account |
Some places let you choose who sees the post:
| Where it goes | Without --privacy |
With --privacy |
|---|---|---|
| YouTube, on any route | private | private, unlisted or public |
| TikTok through Blotato | private, only you can see it | private or public |
| everywhere else | public right away | refused |
A value a place can’t honour stops the run before anything is sent. publish has no scheduler and no queue. A post goes out when the command runs, unless --draft saves it as a draft in Buffer.
The same file can’t go to the same channel twice by accident, and --new posts it again on purpose. A request that makes a post is never sent again by itself, because nobody can tell whether the first one worked. When a run stopped, the same command reads the post’s stage in history/ and goes on only where that is safe. After the post, publish reads the status back and prints it with the link.
How do I post to YouTube?
YouTube signs in with a Google client that you make in your own Google Cloud project:
- Open console.cloud.google.com and make a project, or pick one of yours.
- Turn on the YouTube Data API v3 for that project.
- Set up the OAuth consent screen, and add your own Google account as a test user.
- Under Credentials, make an OAuth client ID of the type Desktop app. Copy its client id and client secret.
- Run
explainroo connect youtubeand paste them when it asks.
Then connect prints a link. Open it and approve the sign-in. The browser then goes to an address on 127.0.0.1 and shows an error page, because nothing runs there. That is expected. Copy the whole address from the address bar and give it to connect:
npx --yes explainroo connect youtube --callback-url '<the address>'
While your Google project is in testing, Google ends the login after 7 days. Then run connect youtube again. Without --platform, publish --via youtube takes the youtube package.
YouTube gets the file from your computer. When an upload breaks off, publish goes on from where it stopped, in the same run or the next one. YouTube gets no cover and no captions from publish. They are in the package folder, as video.cover.jpg and video.srt, for you to add in YouTube Studio. Posts to YouTube don’t notify your subscribers.
How do I post through Buffer?
Buffer signs in with a client that comes with explainroo, so you don’t make one yourself. Run explainroo connect buffer, open the link it prints and approve. Then give the address the browser lands on to explainroo connect buffer --callback-url '<the address>'.
Buffer has no upload, so it needs a public https link to the package’s own file, like out/package/tiktok/video.mp4. Put that file on a host you choose, like your own site or server, and give the link with --media-url. Putting the file there makes the video public. The dry run asks for this link:
npx --yes explainroo publish videos/dns --via buffer --platform tiktok --media-url https://example.com/dns-tiktok.mp4 --dry-run
Before the post, publish asks that link for the size of its file. When the size differs from the package’s video, it stops and sends nothing, because Buffer would post whatever the link leads to. Buffer fetches the video when it posts it, so the link has to work until the post goes out. A link to out/video.mp4 doesn’t count for a TikTok package, because the package has its own file. When your Buffer account has more than one channel on that network, the plan lists them, and --channel <id> picks one.
How do I save a draft in Buffer?
Add --draft, and the post is saved as a draft in your Buffer. Nothing is published:
npx --yes explainroo publish videos/dns --via buffer --platform tiktok --media-url https://example.com/dns-tiktok.mp4 --draft --dry-run
When you want it to go out, open Buffer and schedule it there. The link to the video has to work until Buffer posts it. A draft counts as the post of this file to that channel, so publishing the same package again sends nothing. --new --draft saves another draft, and --new alone posts the file. Only Buffer takes --draft.
How do I post through Blotato?
Blotato uses an API key. Creating one ends Blotato’s free trial and starts its paid Starter plan on your account, so decide that first. Then run explainroo connect blotato and paste the key. Some keys end in =, and that is part of the key.
npx --yes explainroo publish videos/dns --via blotato --platform reels --dry-run
explainroo uploads the file to Blotato’s own storage first, unless you give a link with --media-url. When your Blotato account has more than one account on that network, --account <id> picks one.
Can explainroo give me a link to share?
Not today. explainroo share is meant to upload a finished video to explainroo.com and give back a page that anyone with the link can watch. That hosted service does not run yet. Until it does, share sends nothing at all and says so. Once the service runs, the video file and its title go to explainroo.com, and only when you run share.
To put a video online now, export writes a web player for your own site, and a package is a folder you can upload yourself.