jacobpclouse / Motion-Extraction

With a very simple trick you can extract the motion of a video. Uses python and OpenCV
1 stars 0 forks source link

Add multiprocessing to speed up #3

Open jacobpclouse opened 9 months ago

jacobpclouse commented 9 months ago

To address the issue of real time conversion, i want to have this task take advantage of multiprocessing

Idea:

  1. get the length of the video and then get the number of cores/ number of available cpu units that the program can use
  2. Then divide up the video into length based on the number of cpu units (ie: 4 units then split the video into 4 chunks)
  3. Find the timestamps in the video based on the number of chunks (ie: 4 chunks, find timestamps 1/4 in, 1/2 in and 3/4 way in, we can then just use the start and end times as well).
  4. Then we can execute the inversion process in subprocesses and feed in the different timestamps to each process, it will go much faster and no need to chop up the video with moviepy