← All N8N workflows
AI & researchAggregateChain LLMCodeConvert To FileEdit Image

🚨 PERFORMANCE WARNING!

Configured with Aggregate, Chain LLM, Convert To File, Edit Image, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
AI & modelsOpenAI Chat ModelOpenAI Chat ModelCodeCapture FramesCodeTransformSplit Out FramesSplit OutWeb / APIDownload VideoHTTP RequestTransformConvert to BinaryConvert To FileTriggerWhen clicking ‘Testworkflow’Manual TriggerTransformCombine ScriptAggregateFiles / mediaUpload to GDriveGoogle DriveWaitStay Within ServiceLimitsWaitRoutingFor Every 15 FramesLoop Over ItemsFiles / mediaResize FrameEdit ImageTransformAggregate FramesAggregateAI & modelsUse Text-to-SpeechOpen AiAI & modelsGenerate NarrationScriptChain LLM

Node categories in this workflow

  • AI & models
  • Code
  • Transform
  • Web / API
  • Trigger
  • Files / media
  • Wait
  • Routing

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
OpenAI Chat ModelAI & modelsOpenAI Chat ModelSee node parameters
Capture FramesCodeCodeSee node parameters
Split Out FramesTransformSplit OutSee node parameters
Download VideoWeb / APIHTTP RequestSee node parameters
Convert to BinaryTransformConvert To FiletoBinary
When clicking ‘Test workflow’TriggerManual TriggerSee node parameters
Combine ScriptTransformAggregateSee node parameters
Upload to GDriveFiles / mediaGoogle DriveSee node parameters
Stay Within Service LimitsWaitWaitSee node parameters
For Every 15 FramesRoutingLoop Over ItemsSee node parameters
Resize FrameFiles / mediaEdit Imageresize
Aggregate FramesTransformAggregateSee node parameters
Use Text-to-SpeechAI & modelsOpen Aiaudio
Generate Narration ScriptAI & modelsChain LLMSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • googleDriveOAuth2Api
  • openAiApi

Workflow notes

Try It Out!

Try It Out!

This n8n template takes a video and extracts frames from it which are used with a multimodal LLM to generate a script. The script is then passed to the same multimodal LLM to generate a voiceover clip.

This template was inspired by Processing and narrating a video with GPT's visual capabilities and the TTS API

  • Video is downloaded using the HTTP node.
  • Python code node is used to extract the frames using OpenCV.
  • Loop node is used o batch the frames for the LLM to generate partial scripts.
  • All partial scripts are combined to form the full script which is then sent to OpenAI to generate audio from it.
  • The finished voiceover clip is uploaded to Google Drive.

Sample the finished product here: https://drive.google.com/file/d/1-XCoii0leGB2MffBMPpCZoxboVyeyeIX/view?usp=sharing

Need Help?

Join the Discord or ask in the Forum!

1. Download Video

1. Download Video

Learn more about the HTTP Request node

In this demonstration, we'll download a stock video from pixabay using the HTTP Request node. Feel free to use other sources but ensure they are in a format support by OpenCV (See docs)

2. Split Video into Frames

2. Split Video into Frames

Learn more about the Code node

We need to think of videos are a sum of 2 parts; a visual track and an audio track. The visual track is technically just a collection of images displayed one after the other and are typically referred to as frames. When we want LLM to understand videos, most of the time we can do so by giving it a series of frames as images to process.

Here, we use the Python Code node to extract the frames from the video using OpenCV, a computer vision library. For performance reasons, we'll also capture only a max of 90 frames from the video but ensure they are evenly distributed across the video. This step takes about 1-2 mins to complete on a 3mb video.

🚨 PERFORMANCE WARNING!

🚨 PERFORMANCE WARNING!

Using large videos or capturing a large number of frames is really memory intensive and could crash your n8n instance. Be sure you have sufficient memory and to optimise the video beforehand!

3. Use Vision AI to Narrate on Batches of Frames

3. Use Vision AI to Narrate on Batches of Frames

Read more about the Basic LLM node

To keep within token limits of our LLM, we'll need to send our frames in sequential batches to represent chunks of our original video. We'll use the loop node to create batches of 15 frames - this is because of our max of 90 frames, this fits perfectly for a total of 6 loops. Next, we'll convert each frame to a binary image so we can resize for and attach to the Basic LLM node. One trick to point out is that within the Basic LLM node, previous iterations of the generation are prepended to form a cohesive script. Without, the LLM will assume it needs to start fresh for each batch of frames.

A wait node is used to stay within service rate limits. This is useful for new users who are still on lower tiers. If you do not have such restrictions, feel free to remove this wait node!

4. Generate Voice Over Clip Using TTS

4. Generate Voice Over Clip Using TTS

Read more about the OpenAI node

Finally with our generated script parts, we can combine them into one and use OpenAI's Audio generation capabilities to generate a voice over from the full script. Once we have the output mp3, we can upload it to somewhere like Google Drive for later use.

Have a listen to the finished product here: https://drive.google.com/file/d/1-XCoii0leGB2MffBMPpCZoxboVyeyeIX/view?usp=sharing

Sticky Note6

The video used in this demonstration is © Coverr-Free-Footage via Pixabay

🚨 PERFORMANCE WARNING!

🚨 PERFORMANCE WARNING!

Purpose and structure

This folder contains the 🚨 PERFORMANCE WARNING! workflow. Its executable nodes use aggregate, chainLlm, code, convertToFile, editImage, googleDrive, httpRequest, lmChatOpenAi, manualTrigger, openAi, splitInBatches, splitOut, wait. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

When clicking ‘Test workflow’

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Wait/0603_Wait_Splitout_Create_Webhook.json MIT; preserve source notices.

More in AI & research