---
title: "Automatic video editor"
video_id: NNfYVNCjvUE
url: https://www.youtube.com/watch?v=NNfYVNCjvUE
workflow_page: https://workflows-of-ai.com/workflow/automatic-video-editor
language: en
captions: generated
---

0:01 hey there Marcus here I'm going to show
0:02 you a really cool workflow uh today so
0:05 we're going to take the Ed share on
0:07 perfect video we're going to take the
0:08 Monica Linsky I did not have sex no
0:10 sorry Bill Clinton I did not have sexual
0:13 intercourse with that woman video and
0:16 we're going to cut out for uh cut out
0:19 segments from it using uh prompting so
0:23 I'm just going to start before I I uh um
0:28 tell you the background of the and how
0:30 it works so I will just write I want all
0:34 the shots where a pizza is
0:40 featured and click save and this is
0:43 going to start processing now so what
0:46 you're seeing in front of you is Drupal
0:48 Drupal is a CMS that's open source uh
0:51 it's running something called the AI
0:53 interpolator which which is a module I
0:55 made that can chain a lot of AI
0:58 processes and work together with the
1:00 complex field types that exist in Drupal
1:02 and this is using Drupal rather as a CMS
1:05 automated tool than a cmf automated
1:08 tools so the content management
1:10 framework rather than the CMS there's
1:13 probably some editors that could use
1:15 this uh just so you know there is Json
1:18 API graphql modules uh connected to
1:20 Drupal so if you want to set this up
1:22 it's very easy after I shown you this
1:25 proof of concept I'm going to show you
1:27 how you can set this up in 15 minutes
1:29 basically using these modules uh the
1:32 only thing you need is a open AI account
1:34 so and and the cost is actually minimal
1:38 so now I got a cut here basically so I
1:41 want I we will see now basically if it
1:44 produced I want all the shots where a
1:46 pizza is
1:46 [Music]
1:51 [Applause]
1:54 feure right so you see it worked right
1:57 uh actually what I could have written
1:59 here also so this is important for video
2:01 editors you could have write that I I
2:04 want them as video Snippets and you
2:06 would get multiple videos back instead
2:08 of one video right so maybe you want to
2:11 import them into Premier Pro or
2:13 something like that so
2:17 uh Next Step then we do Bill
2:21 Clinton and uh we're going to ask then
2:27 um can you out the part where he is
2:36 refuting uh that he had six so I'm not
2:40 using his words but by context it will
2:43 be able to understand that that is
2:45 sentence that we're looking for uh I'm
2:48 going to click save this will probably
2:50 be a lot faster because it's a a short
2:52 video in bad resolution and we got
2:56 something back let's see here I'm just
2:58 going to show you the original video
2:59 video first so you see that it's uh not
3:03 just this small part but a long
3:07 video
3:09 president so you can see it's alore
3:12 talking before and so on and this is
3:13 what it cut out I did not have sexual
3:17 relations with that woman Miss
3:20 lnky so that works as well the reason I
3:24 wanted to show these two videos what was
3:26 because the first one was a proof of
3:28 concept that is using that actual uh uh
3:32 images in the video right and the second
3:34 part is that it's using the audio in the
3:37 video uh to to figure out what it should
3:41 cut uh what is important before I show
3:45 you how to set this up this is actually
3:47 not that expensive so what I'm doing in
3:50 this case is that I'm uh looking for all
3:53 the scene cuts and key frames so
3:55 basically where something changes in the
3:57 scene I take a screenshot of this
4:00 uh and then we put this into a grid
4:02 where we show nine screenshots per image
4:05 and then we're asking open AI uh how uh
4:09 basically based on this context and
4:12 getting the transcription from whisper
4:15 uh with all the time stamps and we also
4:17 put the time stamps into the images uh
4:20 you know answer whatever instructions I
4:23 have there and then we're just cutting
4:25 it out uh another thing that's important
4:28 to know before we show this is that uh
4:31 this is Drupal it's running on a normal
4:33 lamb server you can host it anywhere but
4:35 this specific functionality requires FFM
4:38 P because there's a lot of uh both video
4:41 reading and video editing uh being
4:44 done um so that's it uh proof of concept
4:48 now I'm going to show you how you can
4:49 set this up by yourself from basically
4:51 from
4:58 scratch
5:00 hey there so now I'm going to show you
5:04 basically how to set up this uh almost
5:08 from scratch so what I'm I will not show
5:10 in this case is how to set up a web
5:13 server in this case a local uh local uh
5:18 development environment so I'm using
5:20 ddev in this case uh for local en uh
5:24 development
5:25 environment what you need basically is a
5:27 lamp server right and one more thing so
5:29 what I've added in if you use ddev you
5:31 can add extra packages you have to have
5:33 FFM this is uh crucial otherwise nothing
5:38 of this workflow that we showed today
5:40 works this is a requirement
5:43 basically um so I have added that the
5:47 other thing I've added is minimum
5:49 stability Dev because we're going to be
5:51 working with modules that are still in
5:53 beta in this case so we have to allow uh
5:57 minimum stability Dev hopefully they
6:00 will be in production later I have used
6:03 the dev to install a plain standard
6:06 installation of
6:07 Drupal uh with nothing extra so it's the
6:12 standard profile this is usually what
6:14 you get when you install druple what I
6:16 will add is admin toolbar which just
6:19 makes life simpler because the toolbar
6:21 for the admin becomes a lot more
6:25 usable then uh the engine of this
6:28 workflow is the AI inator open AI so
6:31 this is a plugin of the uh family of
6:34 plugins that's AI interpolator which is
6:37 basically AI chaining mod modules but
6:40 also uh modules to create context for AI
6:44 and also extracting uh uh extracting
6:47 logic and stuff like this as well so
6:50 there's a lot of different services that
6:51 you can chain here
6:53 using uh using only GUI so I everything
6:56 I show you now will require no code at
6:59 all you you don't need to be a developer
7:02 to set this up then we need the token
7:04 module to make the prompting feel
7:06 smarter so you can dynamically load uh
7:10 uh text into the prompt basically so I'm
7:14 going to go ahead and install this so we
7:17 just copy the composer command and run
7:20 it I have to prefix it with DV because
7:23 I'm running DV and then you see it it
7:26 downloads admin toolbar in this case uh
7:29 for me so if you're from some other uh
7:32 programming language like Java you might
7:34 know Maven or uh node you know mpm so
7:38 composer is just the same thing
7:41 basically um so we're just getting these
7:46 three then the next step we do is we log
7:49 in on the
7:51 website uh and we're click going to
7:54 click manage and extend and this is
7:56 where you install these modules that we
7:58 get uh so what I need is the admin
8:02 toolbar extra tools and admin toolbar AI
8:05 interpolator open Ai and uh the token
8:09 module so we just install these it's
8:11 going to say that it's going to add the
8:13 open AI Core because that's a dependency
8:15 that it got as well so it will install
8:18 this and this will complain now that
8:20 there's no open AI key uh so we have to
8:23 have have to add one so we can add one
8:25 here we can go to configuration open AI
8:28 settings then I just open where you get
8:31 the API keys from the open AI uh web
8:35 page so you just log in and get
8:36 something uh and go to API keys there
8:39 basically uh so we take video testing
8:42 how we call this copy this
8:45 key paste it in here and we are all set
8:49 if I reload the error is gone now right
8:52 so the next thing we're going to do is
8:55 uh since I'm not doing any coding in
8:57 this case I'm just going to use
8:58 something called content types in druple
9:00 so this are usually for the CMS part of
9:03 druple but if you want to use this
9:05 functionality or anything else in the
9:08 workflows that I've done so shout out
9:10 workflows of ai.com so workflows Dash
9:14 wait let me show you instead flows of
9:18 ai.com it's this web page right so you
9:21 can find all the different workflows you
9:23 can use this chaining tools for um if
9:27 you want to use anything of it uh you
9:31 can set it up without any code
9:35 and uh it's also important to know if
9:38 you just want this as a headless service
9:40 API or something there is a Json API uh
9:43 module you can just click extend it part
9:45 of core and then you have a API
9:48 interface where you can basically send
9:50 the video in the prompt and you get the
9:51 videos back so we're going to do video
9:55 extractor we're going to call this
9:57 content type I just clicked save as I
9:59 said this is just CMS stuff that I just
10:02 want to get rid of some stuff and then
10:04 we also get rid of the body field which
10:06 is a typical wi wig field we don't care
10:08 about this create a new field that we
10:11 call the origin video origin video which
10:15 is file upload and a file so these are
10:19 the field types that basically triggers
10:22 I mean you use them in druple for uh
10:24 creating complex entity types content
10:27 types with a a interpolator is basically
10:30 saying that from one field type to
10:32 another you can do something so uh this
10:36 is what the AI interpolator does so we
10:38 take origin video and we say this should
10:40 be MP4 and it should be required because
10:42 you need to upload something right and
10:45 then the next thing we do is take a
10:47 plain text text plane long which is just
10:49 a text area which is the
10:52 prompt create this uh this is also
10:56 required both of these are limited to uh
11:00 adding one right so with the video in
11:03 theory you could actually add
11:05 multiple uh and it would extract from
11:09 all those videos but that would take
11:11 forever so I um it's better to just keep
11:14 one video the last thing we need to do
11:17 is add another uh file field that is the
11:20 destinate oh have it there destination
11:23 video right so this is where the
11:25 generated video is going to end up since
11:27 we can ask for snip instead of one
11:30 concatenated video we're going to set
11:32 unlimited here so we can say that hey
11:35 create multiple videos here if you want
11:37 it's also going to be MP4 and then we
11:39 have the thing that the AI interpolator
11:42 does and this is just we're saying
11:43 enable Ai interpolator and here we can
11:45 choose different rules depending on what
11:48 the origin uh origin field is and what
11:52 the field we're trying to generate this
11:54 right so but in this case there is only
11:56 open AI video extract extraction
11:59 so we're using base mode and we're
12:01 getting from the origin
12:03 video and then we put a cutting prompt
12:06 here but since we want this to be
12:08 flexible so you can write a different
12:09 prompt for different videos you
12:11 upload uh we're going to use from the
12:14 token module that we installed so these
12:16 are the tokens that exist and these we
12:18 can put here so I can take the node get
12:22 the prompt and I can just click here and
12:24 this is going to pre fill out so instead
12:27 of hardcoding some prompt here it's
12:29 going to fetch from this field
12:31 now uh advanced settings is uh if you're
12:36 going to set this up for real you should
12:37 run this on the Chrome job right but now
12:40 I I have a long timeout so I'm fine with
12:43 running it
12:45 directly when you have a chain of of uh
12:49 prompts you can also do the batch mode
12:52 so you chain them using JavaScript so
12:54 you don't get
12:56 timeouts uh we save this and and believe
12:59 it or not we are set up so let's try
13:03 this in action now then so I'm just
13:05 going to take uh another thing here baby
13:08 shark so this is the famous baby shark
13:11 video right uh and I write cut out the
13:16 video
13:18 that cut out the
13:20 scenes where there are visual
13:25 confirmation that you should Subs
13:30 subscribe so that's it basically there's
13:33 in the end of the video there is like I
13:35 think 10 seconds or something where it
13:37 says like subscribe to us so right now
13:40 it's just going on the visual part
13:42 right uh and hopefully this will work
13:46 and we have set it up and it yeah how
13:49 long have I been recording 8 minutes so
13:52 you can set this up extremely extremely
13:55 fast and setting up Json API takes
13:57 another 10 minutes maybe and then you
14:00 have this as a service uh
14:04 running uh and then we have the
14:05 destination video we try
14:08 it baby
14:11 shark baby
14:13 shark
14:17 babyar so you see it uh cut out the 10
14:21 seconds of the video that was the
14:23 Subscribe we have it working that's it
14:27 you can you know build a whole product
14:30 out of this I'm going to expand this
14:32 later so it actually also can
14:36 um uh reformat the resolution so maybe
14:39 you want a mobile video 69 then there's
14:42 going to be another prompt where you can
14:44 basically say uh so if you take the Ed
14:47 shm video focus on the pizza all the
14:50 time so basically the camera moves
14:52 around and focus on the pizza so this is
14:55 uh a future add-on I'm going to add
15:00 soon uh and that's it thank you for
15:04 watching
