Placeholder Image

字幕列表 影片播放

  • e had this idea.

  • And this is like super rough brainstorming.

  • Don't take this as fact or anything, but let's compute the variety, so compute the difference from the current frame to the previous frame.

  • So how are we going to do that?

  • Like Imagine if we had an array that would tell us how different this frame is from this frame.

  • If you haven't seen the first video I made on this project Go on.

  • Watch that, because this is gonna build on top.

  • But, you know, when I was doing the random edit thing, it looked pretty good, but it was still kind of random.

  • It would be much better if my algorithm was able to actually pick the frames that have the most the most difference from everything else.

  • Now, how are we supposed to calculate that?

  • Well, all I was thinking is we We look at every single pixel and we just compute the difference.

  • And if we do that for every single frame in the video, maybe I'm not saying it's gonna work.

  • Maybe way.

  • We're going outside today.

  • How strange.

  • I know we're gonna be normal and hang out with some friends, and I think they want to go to a club, which is not really my thing.

  • Theo.

  • Computer science content.

  • Hello.

  • How low?

  • Hey, guys, today it is.

  • It's a few days later the Sunday we tried to run the first test of our variety algorithm.

  • And look what it told us.

  • Picks A format must be this so it looks like this can convert like, one pixel format into another.

  • I just I don't know how it works, So I'm gonna go look it up Way realized last night that we want to do our calculation and RGB We tried to convert the RGB and now we get these super weird errors and segmentation faults and it doesn't look like it completely broke.

  • We we've lost a little bit of memory.

  • Oh, dude, it's almost like almost real time.

  • It's It's slower than real time, a little bit so we can see it looks like I've moved the camera here, and then here is like, I haven't really moved the camera.

  • Let's see, when we change clips 0.5 point 2.3 The next clip is 0.23 because it's a new scene, so we can actually mathematically detect like we think that there's a new scene here because this frame is so different from this frame.

  • When I hit, play here at 40 seconds is right.

  • 39 seconds is right at the start.

  • So this is this is this right here and then it goes back down.

  • And then, Ah, at about what is that number at 59 seconds.

  • 54 seconds.

  • 56 seconds.

  • Not much is going on.

  • Oh, it's me.

  • We're always see that.

  • So this right here is detecting the movement for me, right?

  • When you code for two hours and then you run it for the first time.

  • Yeah, that doesn't really look right.

  • I've spent so much time working, and I feel like I haven't explained what's going on, so I'm just gonna do a full run down.

  • I tried to write this function that would be able to tell the difference between one frame and another frame.

  • Really?

  • All I have to do is go through every single pixel and subtract the red.

  • If you're If you're talking about RGB, you know, subtract the Red Channel, subtract the green Channel, subtract the Blue Channel like you could see the actual code here.

  • That how simple it is because we're dividing it by 2 55 This will give us a number between 1.0, and 0.0.

  • If the two pixels are completely opposite, like black and white, then we would get a one point.

  • Oh, so we basically get the average of every pick Soul between 0.0 on one point.

  • Oh, for the Red Channel and the Green Channel and the Blue Channel.

  • And then we get the average of all three channels so you can see there's no crazy math or anything.

  • It's so simple.

  • We compare this frame to this frame and then we shift.

  • We compare this firm to this frame and then we shift.

  • And what we end up with is an array of values between 0.0 and 1.0, on that represent how different this frame is from the previous run.

  • The very first demo off this this program, this is the output file.

  • This is our source videos.

  • So it's gonna pull the videos from here.

  • The threshold is zero.

  • So that means any slight bit of emotion it's gonna pick up and make that cut around this one could be any length because it depends on how much there is in the video.

  • Uh, let me check it out.

  • So, yes, we have a loading bar on command line, so we'll say in code new file.

  • Oh, yeah.

  • New file coming in here.

  • Let's watch it back.

  • Yo.

  • Oh, yeah.

  • Oh, yeah.

  • Dude, you just cut straight multi view, bro.

  • Ah, I'm doing the tests on the same data.

  • So 57 gigs a video?

  • If you can remember, we're going to say on Lee detect things above 10% motion.

  • That is a big amount.

  • So we're just gonna be sitting here for a while.

  • Basically, I just two hours an hour and 1/2 of sitting here, and then we get a Sega fall.

  • We're gonna try and do sequence to again.

  • The one that gave me a SEG fault last time.

  • E think we fixed quite a bit of bugs.

  • I'm gonna leave this running overnight, and we're gonna come back on, see what's up.

  • Okay, let's see what our input is.

  • 2.7 hours of video and the output is like 100 seconds of video 100 seconds of video so you can see it says if we cut 98.9% out.

  • However, this is not gonna be like a good edit.

  • This is just gonna be a bunch of different scenes together.

  • So I want to see if the algorithm is capable of identifying what it thinks is different scenes.

  • Let's try to encode it.

  • New video files being created here.

  • Just finished.

  • Let's watch it back.

  • The audio's I'm gonna meet the audio, but let's is going to be first time basic scene detection, See what it did.

  • Okay, Okay.

  • I remember.

  • I remember doing that.

  • Honestly, dude, I'm kind of surprised how good it looks.

  • It is detecting a lot of motion, but it is cutting the scenes that look different from each other.

  • Honestly, I am.

  • I thought it would be worse.

  • Now this algorithm cannot tell if frame looks good or bad, But what it can do is compare the difference between all these frames and trying to pick the most different ones.

  • So we get the most variety.

  • I want to show you what the original and it looked like at this part.

  • So the one on the right is the algorithm.

  • And the one on the left was edited by me.

  • This is the original video.

  • I swear parts of the algorithm were edited better than Oh, my Oh, Mom, I'm the algorithm included more clips of in the camera store than I did because I thought it was super boring and stuff like like, look great.

  • So, like, we're like, Oh, look, camera store.

  • And then and then I just showed the tripod, But then I was at and then I was at home.

  • But look at how much Maur this algorithm found that I thought was interesting.

  • And honestly, I respect that.

  • I think this ad it looks better on the right.

  • I'm very surprised that are seeing detection kind of works.

  • It has the potential to identify very sensitive amounts of movement, like with security cameras.

  • Um, and it also has the ability to detect completely different scene changes, like you just saw in this example.

  • I just need to work a lot more at the scene detection, and I want to add a few more parameters that make it even better.

  • Wow, guys, I just finished editing, and I just kind of had a W T F moment like, what did I just edit?

  • So I hope I feel like you guys were gonna Anyways, we have a really cool sponsor in today's video.

  • Algo expert is a Web site that helps people ace their programming interviews.

  • So if you're a developer, you've probably heard of the technical interview where your interviewer well, ask you a question like, can you solve this algorithm or how would you solve this problem and do it on a white board or whatever, right?

  • Those are often the most challenging things, and I'm sure, like I would totally fail.

  • So the whole point of algo expert is they have 65 popular interview questions.

  • They've got five different programming languages.

  • They have this really cool interactive code execution environment and video explanations of every problem.

  • We've got a special code for you.

  • If you go to algo expert dot io slash Devin, you get 30% off, as you can see here, you know, welcome.

  • Devon Crawford viewers, you know, subscribe to the channel if you're new and let me know if you want to Seymour episodes of video editing automation as a series, I think it would be cool.

  • I don't know.

  • I think I'm gonna keep working on it.

  • It's just a lot of work, but it's fun.

  • All right, That's it.

  • I'm out.

e had this idea.

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

A2 初級

運動檢測算法編輯我的視頻 (Motion Detection Algorithm Edits my Videos)

  • 2 0
    林宜悉 發佈於 2021 年 01 月 14 日
影片單字