I want to create thumbnails of a video folder, but I am not shure how to approach this…
Using a loop and pausing it while processing is what I did in VVVV.
Or do I create objects that have the conversion functionality already implemented, generate them in a control patch… have them delete themselves after finishing?
This would also be a opportunity for async regions, so multiple instances of ffmpeg could run at the same time.
yes that works, but it still opens too many ffmpeg instances at the same time.
I fixed it by having the thread sleep for some ms, but is there a way to wait for the executioner to finish - and then allow the loop to go to the next iteration?
you chose the probably most complex. in this case i’d say yes, this would be an option:
ie. thinking it once again like a particle system. each particle would be converting one file using an Executor inside an asynctask) and die when it is finished. the particle system has a max-amount of active particles that you decide and whenever a particle dies a slot is freed for a new particle…
this should work out of the box as you did initially (AsyncTask around foreach), when the Executor gets a blocking option. if you need it right now, you can easily make a local copy of the Executor and add a Process.WaitForExit().
otherwise watch this space for an update, when i added it and new alpha is up…
there is nothing holding you back putting an AsyncTask region into a ForEach region in another AsyncTask.
to have a nicer patch structure i would make a Process that deals with the inner stuff (AsycTask in ForEach) and then put that process node into the outer AsyncTask and link the file list into it.
latest alphas now have “Time to Wait for Exit” input on Executor. by setting this value high (up to maxint) you can essentially have the operation blocking.