title: Using kivy process in the update function make the update lag
body: <p>Im trying to make it save face image but the process of detect and saving face make the update lag in kivy. I trying to use multiprocessing but somehow im stuck. hope someone can review the code for me. It become much lag when i implement multiprocessing. It is due to bad implementation.</p>
  <pre><code>def update(self, dt):
          now = datetime.now(pytz.timezone('Asia/Kuala_Lumpur'))
          checktime = time.time()
          if(checktime - self.starttimepic &gt; 1):
              self.checkface = True
              self.starttimepic = checktime
          else:
              self.checkface = False
          if(checktime - self.starttimevid &gt; 60):
              self.starttimevid = checktime
              for i in range(self.num_camera):
                  self.vidsav[i].release()
                  self.vidsav[i] = cv2.VideoWriter(os.path.join(vidpath , str(now).replace(&quot; &quot;, &quot;-&quot;).replace(&quot;.&quot;, &quot;-&quot;).replace(&quot;:&quot;, &quot;-&quot;) + &quot;-CCTV&quot; + str(i) + &quot;.avi&quot;), cv2.VideoWriter_fourcc(*'MJPG'),
                           60, self.size[i])
          for i in range(self.num_camera):
              ret, frame = self.capture[i].read()
              self.vidsav[i].write(frame)
              imgS = cv2.resize(frame, (0, 0), None, 0.25, 0.25)
              imgS = cv2.cvtColor(imgS, cv2.COLOR_BGR2RGB)
              result = detector.detect_faces(imgS)
              for j in range(len(result)):
                  x1, y1, w, h = result[j]['box']
                  x2, y2 = x1 + w, y1 + h
                  y1, x2, y2, x1 = y1 * 4, x2 * 4, y2 * 4, x1 * 4
                  imgn = frame[y1:y2, x1:x2]
                  print(cv2.imwrite(os.path.join(imgpath , str(now).replace(&quot; &quot;, &quot;-&quot;).replace(&quot;.&quot;, &quot;-&quot;).replace(&quot;:&quot;, &quot;-&quot;) + &quot;-CCTV&quot; + str(i) + &quot;-&quot; + str(j) + &quot;.jpeg&quot;), imgn))
              # if(self.checkface):
                  # p1 = multiprocessing.Process(target = savepic, args = [frame, imgS, now, i])
                  # p1.start()
                  # p1.join()
              buf = cv2.flip(frame, 0).tostring()
              texture1 = Texture.create(size=(frame.shape[1], frame.shape[0]), colorfmt='bgr')  
              texture1.blit_buffer(buf, colorfmt='bgr', bufferfmt='ubyte')
              self.a[i].texture = texture1```
  </code></pre>