Ask Your Question
0

How to trim a video based on a condition

asked 2018-06-29 00:30:30 -0600

papabiceps gravatar image

updated 2018-06-29 00:34:02 -0600

I have a video from drone. I want to delete the part of video that has takeoff included. I want to retain the part where the drone is flying. Can someone suggest a method in OpenCV to achieve this ?

edit retag flag offensive close merge delete

Comments

1

maybe you can use global motion

berak gravatar imageberak ( 2018-06-29 02:32:28 -0600 )edit

This media trimmer is also available.

kkmin gravatar imagekkmin ( 2020-03-20 05:50:17 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2018-06-29 02:18:16 -0600

holger gravatar image

updated 2018-06-29 02:19:17 -0600

Well opencv can read frames from video but its mainly an image processing library - not a video cut software. https://stackoverflow.com/questions/1...

  • If you want to do it the easy way and you have the timestamps when takeoff is finished, just use ffmpeg.
  • If you want to do this automatically and often for different videos - well then maybe this could be a opencv related question.
edit flag offensive delete link more

Comments

trimming the video isn't the issue, I want to automate the process using OpenCV. I want to find from which frame the drone starts to move

papabiceps gravatar imagepapabiceps ( 2018-06-29 02:20:17 -0600 )edit
2

Well you got an interesting task here, i don't know the solution but maybe i can give some ideas. The good thing is that the video is from the 1st person view of the drone.

I found this link. https://www.pyimagesearch.com/2015/05...

If i understanding this correct

  1. Get the first frame(no movent) and use it as an anchor.
  2. Do some preprocessing on that image (gray scaling, blurring)
  3. Get the next frame, do the same processing on this image
  4. Compute a diff between first frame and current frame. If the diff is bigger than a certain delta , the background changed and the drone is most likely moving.
  5. Repeat on every following screen until you detect a movement (diff >= delta)
holger gravatar imageholger ( 2018-06-29 03:46:50 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-06-29 00:30:30 -0600

Seen: 5,981 times

Last updated: Jun 29 '18