Recording and writing from multiple threaded PS3Eyes

asked 2018-03-16 17:50:34 -0600

harrig gravatar image

Hello,

I am having difficulties getting a WINAPI multithreaded program using multiple PS3Eye cameras to capture, stream and write multiple videos to separate files. I have confirmation that my threading, using three threads for each camera, i.e. capture, queue, and write threads, works and successfully performs the requisite push/pop/write functions. However, when running the program it only ever successfully writes to a single file, usually the first camera object to be initialized. I just checked this by Sleep(10)ing the writer for the first thread, and this results in the second camera thread's file being written and not the first, suggesting that the only file the program can write to is the file associated with the writer thread that starts first. I am unaware if this is some facet of the cv::VideoWriter class that I am unfamiliar with, or if it is a fundamental constraint of my code or cameras. I can provide code examples if needed, but I omitted them from this post as they are long and unpretty due to the current state of debugging.

Thanks

edit retag flag offensive close merge delete

Comments

1

Test 1: Can you verify with a single threaded program that you can open all of the cameras and display even one image from each?

Test 2: Can you start each thread, launch an imshow window, sleep the thread for a bit, then end the threads and call waitKey()? Do they all show up?

Test 3: Instead of displaying or writing images, just write their size and shape to a file. One per thread. Do so for some amount of time and verify they all keep working.

Tetragramm gravatar imageTetragramm ( 2018-03-16 18:54:27 -0600 )edit