Use different matrix for actions: painting, detecting and video
writing(in future)
Add async video writer
Fix segfault