Social Media content generation tool for Earth App
rain is the official content generation tool for Earth App. It uses the Earth App API to fetch data about activities, events, prompts, and articles, and generates images with the content formatted in a visually appealing way.
bun run photo:<type>Where <type> is one of activity, event, prompt, or article.
bun run video:promptThis command generates a vertical short-form video at out/prompt.mp4.
Pipeline:
- Fetch one random prompt from the Earth API.
- Read the prompt aloud with Cloudflare TTS.
- Generate an answer with Granite 4.0 H Micro using the Cloud system prompt.
- Read the answer aloud with Cloudflare TTS.
- Build timed captions from prompt and answer text.
- Animate cloud variants while narration is active.
- Render with Remotion over a random Minecraft background window.
Additional outputs:
out/prompt.props.json: Render props passed into Remotion.out/prompt.manifest.json: Generation metadata (durations, assets, text).src/assets/generated/prompt-*/: Generated narration audio files.
- Target format:
1080x1920at30fps. - Timing flow: prompt narration -> short pause -> answer narration.
- Duration policy:
- Hard maximum:
90s. - Hard minimum:
30s. - Preferred range:
60s+, with attempts centered around80-85s.
- Hard maximum:
- Captions: phrase-level closed captions tuned for spoken pacing.
- Background: random 75-90 second window sampled from
src/assets/minecraft.mp4. - Watermark: persistent Earth App logo at bottom-right.
Implementation approach (research-aligned):
- Use
OffthreadVideofor stable frame-accurate background extraction. - Use dynamic composition duration (
calculateMetadata) so renders end with narration. - Keep generation side effects out of the composition by precomputing all timing data in Bun.
- Use deterministic render props (
prompt.props.json) for reproducible output/debugging.
Contributions are welcome! Please open an issue or submit a pull request with your changes.
Licensed under the Apache License, Version 2.0. See LICENSE for more information.