LongCut logo

How to Analyze Videos with AI for Free (NoCode N8N)

By Ricardo Taipe

Summary

Topics Covered

  • Gemini Outperforms OpenAI for Video Content
  • The Hidden Step: Downloading Before Uploading
  • AI Video Analysis Is Now Free With Gemini
  • Build Free Video Analysis Into Any Workflow

Full Transcript

okay right now I'm creating an AI agent on NN that can analyze the data from Facebook ads library to get some insights on what copy is working what creative is working and so on and the

thing is that some ads are actually videos so in this case using tools like the open AI API would not work and after a bit of research I found out that most Gemini models can actually analyze

videos but when I was reading their documentation it wasn't really clear on how to use this with HTTP requests so after a bit of playing around I found out how to do it and I said why not make

a video about it to make the lives easier for everyone else and yeah without further Ado I'm just going to try it out so here I got this video for a Facebook ad with the keyword CAD GPT and it's just two girls talking about

how to make money with AI so I'm just going to copy that URL right here and I'm going to put it into this first step and then if I click on test workflow then it'll analyze the whole video and

do its whole process and it just finished and in this case I instructed Gemini to to explain what's happening in the video and this is its response so you can see that it's talking about two young women having a conversation

outside the woman is holding a microphone it's also telling us the actual script with the timestamps and you can see that this is a very detailed description and before I actually teach

you how to make this a step by step I just want to plug in our new school community and here you'll have access to all of the blueprints that I talk about on my YouTube channel and right now we have an early birth prize for the first

25 members so if you're you're really serious about AI agents and automation then you're invited to join but anyways here I'm in Ai studio. goole.com and

this is where you can test out all of the Gemini models so in this case I'm using Gemini 2.0 flash image generation experimental and I just uploaded a video of another Facebook ad and I think this

one talks about an AI tool so now I just ask it to give me a detailed description of what's happening in this video and what's being seen or said and if I just click on run here then you can see that it described it perfectly so it's say

that the video features a close-up shot of a man from the chest up that he has a MAG AI or mag ey um text in his shirt which is this one magy it also says that he has a long wavy brown hair and a

neatly trimmed beard and of course that's correct as well and then it also just gives out the transcription with the time stamps and yeah this works amazingly and this is the exact model

we're going to use for the API to make it work inside nhhn so to do this you first have to get your API key so in the top left just click on get API key and then click on create API key and here

you'll first have to select a Google Cloud project so if you don't have one yet you can just go to console.

cloud.google.com and right here in the top left you'll see a button to create a new project or it could be right here as well so when you have it you can just select it from this drop down and then

you'll see your API key right here and once you do that then now we're ready to get inside n8n so where the magic happens is in this note right here where we just called The Gemini model to to

actually analyze the video but before that you actually have to do two steps so first Gemini doesn't actually accept URL so beforehand you actually have to download it and when you download it

then you have to upload that video to the Gemini server so that it can be accessed by Gemini and that's exactly what these two notes are doing so this first one it's a simple HTTP get request

so you just put in the video URL right here and change the method to get and then you'll get the binary data of the actual video as you can see right here so once you have the video downloaded in

your n instance then you can now actually upload it to the Gemini servers so here we're just using a post method and for the URL we're using this end pointer right here and at the end you

have to put in your API key that you got from your Google AI studio so just copy it right here and then for the headers you just specify headers as using Fields below and just put in these names and

values in this case this first one will always be the same so just copy and paste it then this second one will actually specify the size of the video in this case I'm grabbing it from

binary. data. file size which is this

binary. data. file size which is this data right here but I don't think it matters because at the end it automatically just gets the size and then for these last two we just put in

video/ MP4 because this will always be a video but if not then you can also just map in this file extension from the binary data in this case you can't just drag and drop it so you just have to put

an expression of binary dot data because this is called data and then do file extension because this is the file extension right here but then you can just enable send body and in this case

for the body content type just put it as NN binary file because we're using a binary file and for the input data field name you just have to put in whatever it's named right here in this case it's

called Data so I named it data and then once you run this request you'll see an output similar to this one as you can see it says that the source is uploaded but what actually matters is the state

it has to be set as active and in this case it's still set as processing so for this we actually use a weight node in my case I'm just using 5 seconds and that'll be enough time to change the

state from processing to active and here of course you can also use an if Loop to check if it's ready or not but I think 5 seconds is plenty for this operation so that's why I'm just keeping it as that

but anyways now for the most important node here again we're just setting the method as post then for the URL we're using this endpoint right here and we're using the same API we got from Google AI

studio and this is where you actually specify the Gemini model you're using and after that for the headers just a specify using Fields below and the name should be content type and the value

should be application is/ Json and then just enable send body and make sure that it's using Json so here you're going to use this exact Json schema and it's just like any other message a model call so

in this case we're prompting it to describe what you see in this video and what's being said so that's the prompt but of of course for the video we need to add another section which is this one right here for the file URI you just map

in the file URI that's here which is just called URI and just map it and for the type you just map in this one right here which is video/ MP4 and here for some extra settings then I'm just

setting the temperature as 1.4 which in my opinion is the most balanced one and you can also change the top K or top P to whatever values you want and for the response I'm just setting it as text

because I just want the response to be some text so now when you run this whole request then you'll get an output like this one with the response and the total amount of tokens as you can see the text

prompt is really cheap so we just used 15 tokens the audio one is pretty cheap as well but the most expensive one is where it actually analyzes the video so be sure to keep that in mind and boom

that's basically how you can analyze any video using AI inside n81 and all for free so now you can use this for your workflow or for your agent if it needs to analyze a video and remember that

I'll be leaving this exact workflow in the description so you can just download it for free and if you're really really interested in learning no code AI agents and automation then I highly recommend you to subscribe to not miss out on any

of the videos I will post and be sure to check out our previous videos and if you have any questions regarding this workflow then leave a comment below again the spots here are limited and you'll get your early birth pricing for

life so for example in the near future where we offer more features and this library is packed with more agent and automations then instead of paying for that soon to be price you're just locked in with your early birth pricing that

will never change so that's it thank you for watching and I'll see you in the next video

Loading...

Loading video analysis...