CodeToVideo is a Next.js application that transforms creative prompts into cinematic product launch videos using AI and cloud rendering. It leverages OpenAI for script generation, Cloudinary for image uploads, and Editframe for video composition and rendering.
- AI-Powered Script Generation: Enter a prompt and get a structured video script (title, subtitle, body, tagline, accent color) generated by OpenAI.
- Cinematic Video Composition: Preview and render videos with dynamic animations and brand styling using Editframe.
- Image Uploads: Upload images to Cloudinary and include them in your video compositions.
- Local & Cloud Rendering: Render videos locally via the Editframe CLI or preview them instantly in the browser.
- Next.js (App Router)
- React 19
- OpenAI API (for script/content generation)
- Cloudinary (for image uploads)
- Editframe (for video rendering)
- Tailwind CSS (for design system)
- Node.js 18+
- npm or yarn
- OpenAI API key
- Cloudinary account (for image uploads)
-
Clone the repository:
git clone https://github.com/your-username/codetovideo.git cd codetovideo -
Install dependencies:
npm install # or yarn install -
Create a
.env.localfile in the root directory and add your credentials:OPENAI_API_KEY=your-openai-key CLOUDINARY_CLOUD_NAME=your-cloud-name CLOUDINARY_API_KEY=your-cloudinary-key CLOUDINARY_API_SECRET=your-cloudinary-secret
-
(Optional) Set a custom OpenAI model:
OPENAI_MODEL=gpt-4o
Start the development server:
npm run dev
# or
yarn devVisit http://localhost:3000 to use the app.
To render videos locally, ensure the dev server is running, then trigger a render from the UI. The Editframe CLI will generate an .mp4 file in public/renders/.
app/— Next.js app directory (API routes, pages, preview)components/— React components (Studio, VideoComposition)lib/— API clients and utility libraries (OpenAI, Cloudinary)public/renders/— Output folder for rendered videos
Ensure the following environment variables are set in .env.local:
OPENAI_API_KEY— Your OpenAI API keyCLOUDINARY_CLOUD_NAME— Your Cloudinary cloud nameCLOUDINARY_API_KEY— Your Cloudinary API keyCLOUDINARY_API_SECRET— Your Cloudinary API secretOPENAI_MODEL— (Optional) OpenAI model to use (default: gpt-4o)
MIT