Parallel VideoReader Image processing
Afficher commentaires plus anciens
Hey,
I am trying to look at each frame inside a video and do some processing on it. Is there a way to do this in parallel? I am attempting to do the same thing to every 12th frame, and I assume it should be independent because each frame is independent of each other. However, I have come across issues with VideoReader and it's read function inside a parfor loop. Please point me to some resources if you know any! I have looked for ways to do this on the GPU as well, but I could't find much, so let me know if you know anything about that either. Thank you in advance!
-Tim
Réponses (1)
Walter Roberson
le 9 Mar 2016
0 votes
If you were to open the object once and send the reader to the workers and ask them to read different frames, then that would be expected to have problems.
If you were to open the file in every worker then they would not interfere with each other. However using read() with an index is discouraged and will go away soon, and instead readFrame multiple times is the method for frame accurate extraction. The alternative is to set the CurrentTime field by time, which can present difficulties in getting an exact spacing between frames for variable framerate videos.
What I would suggest in your case is that you have a single loop that reads frames one by one with readFrame and throws away most of them but takes every 12th and parfeval() the processing work, which submits it to the queue for asynchronous processing. Eventually you collect the results. The number to leave outstanding uncollected depends on your available memory.
1 commentaire
Timothy Chu
le 9 Mar 2016
Catégories
En savoir plus sur GPU Computing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!