Create Video Narration with n8n, OpenAI & Python

This workflow automates video narration by extracting frames using Python, generating scripts with OpenAI’s GPT-4o, and converting them into voiceovers. Save hours by transforming videos into narrated audio clips effortlessly.
lmChatOpenAi
code
httpRequest
+9
Workflow Identifier: 1345
NODES in Use: Manual Trigger, HTTP Request, Code, Split Out, Split In Batches, Convert To Binary, Edit Image, Aggregate, Chain LLM, OpenAI, Wait, Google Drive
Automate video narration with n8n and OpenAI

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Automation Does

This workflow takes a video from a public link and makes a spoken narration audio automatically.
It solves the problem of writing scripts for videos which takes many hours.
You get a voiceover audio file from the video fast, with a script written by AI looking at the images.


Tools and Services Used

  • OpenAI API: For generating narration scripts and text-to-speech audio.
  • Google Drive API: To upload and store the final audio file.
  • Python with OpenCV: To extract frames evenly from the downloaded video.
  • n8n Automation Platform: To connect all steps in a workflow.
  • HTTP Request node: To download the video.

Workflow Input, Process, and Output

Inputs

  • Video file accessed from a public URL.

Processing Steps

  1. Download video using HTTP Request node.
  2. Extract up to 90 evenly spaced frames from the video using Python and OpenCV in Code node.
  3. Split frames into individual items for further processing.
  4. Batch frames into groups of 15 to fit language model token limits.
  5. Convert base64 frames to binary and resize images for AI input.
  6. Generate a continuous narration script in the style of a famous nature narrator using OpenAI’s multimodal GPT-4o LLM.
  7. Combine partial scripts into full narration text.
  8. Use OpenAI’s text-to-speech to make an MP3 voiceover from the script.
  9. Upload the final audio file to Google Drive for storage and sharing.

Output

  • MP3 audio file with a voiceover narration of the input video.

Beginner Step-by-Step: How to Use This Workflow in n8n

Download and Import

  1. Inside the n8n editor, click the Download button on this page to get the workflow file.
  2. Import the workflow file via the “Import from File” button in n8n.

Configure Credentials and Settings

  1. Add your OpenAI API Key in the credentials section to allow script generation and TTS.
  2. Add Google Drive API credentials to upload the voiceover audio.
  3. Check and update any IDs like Google Drive folder ID or email/channel fields if applicable.
  4. If URLs, prompts, or code snippets appear in the input fields, copy and paste exactly from the description to these fields.

Test the Workflow

  1. Click the Manual Trigger node (Manual Trigger) and run the workflow once.
  2. Check the output to make sure the MP3 audio has uploaded successfully.

Activate for Production

  1. Once tests pass, activate the workflow to run whenever needed or schedule runs.

This quick method lets you use and benefit from the workflow without building it from zero.


Key Workflow Details

Extracting Frames

The Code node (Python) uses OpenCV to select frames evenly spaced through the video.
It outputs a list of base64 JPEG strings representing these frames.

Batching and Image Preparation

Splitting frames into batches of 15 keeps the input size manageable for the AI model.
Frames get converted to binary and resized to 768px for better processing.

Narration Script Generation

The multimodal GPT-4o model reads image batches and produces script parts.
Scripts keep context between batches for a smooth narration.

Building the Final Audio

Partial scripts combine into a single composed text.
OpenAI’s text-to-speech service creates the MP3 file from the whole script.

Uploading and Access

The voiceover MP3 uploads to Google Drive.
The user can then easily find and share the audio file.


Common Issues and Solutions

  • Video Frame Extraction Failure: Happens if video format is unsupported or Python OpenCV is missing.
    Fix it by using MP4 videos and ensure OpenCV is installed.
  • OpenAI Rate Limit Errors: May occur when sending many requests fast.
    Use a Wait node to slow requests or upgrade the OpenAI plan.
  • Google Drive Upload Fails: Caused by expired or wrong OAuth credentials.
    Re-authenticate with Google Drive and check folder permissions.

Customization Ideas

  • Change narration style by editing prompt in the script generation node.
  • Increase or decrease frame count in the Python node for detail vs speed.
  • Adjust batch size in the frame batching node for token limit management.
  • Switch upload folder in Google Drive node or use other cloud storage.
  • Remove or modify the frame resize node depending on desired image quality.

Pre-Production Checklist

  • Confirm the video download URL is accessible and uses a supported format.
  • Run the frame extraction Python code separately first.
  • Validate OpenAI credentials including quota limits.
  • Verify Google Drive API connection and destination folder.
  • Test the workflow on a small video to check timing and outputs.
  • Backup generated files if re-running for multiple videos.

Deployment Notes

After testing the workflow, activate it in n8n editor.
You can run it manually or schedule for batch jobs.

Watch execution logs to catch API errors or slowdowns.
Use the Wait node to avoid hitting OpenAI call limits.

Consider self-host n8n for more control and stability at scale.


Summary

✓ The workflow transforms a public video URL into narrated MP3 audio.
✓ It extracts key video frames, writes AI narration scripts, and produces speech.
✓ Saves hours of manual work on scripting and voiceover creation.
✓ Outputs an MP3 stored on Google Drive for easy access.
✓ Beginners can import and configure the workflow in n8n without building it themselves.


Automate video narration with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes, any publicly accessible video URL in MP4 format that OpenCV supports can be used.
API usage depends on video length and frame batch size; more frames cost more tokens.
The audio file uploads to the linked Google Drive account in the specified folder.
Yes, increasing frames is possible but will slow processing and use more resources.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.