AllenNeuralDynamics / aind-behavior-video-transformation

Library to manage compression and transformation of behavior videos
MIT License
0 stars 0 forks source link

User story: Parallelize video encoding to speed up processing of videos #14

Open galenlynch opened 2 days ago

galenlynch commented 2 days ago

User story

As a user I want to see the results as soon as possible. Right now, each video is processed sequentially, with each one taking many hours to process. This can result in a delay of a day or more between doing an experiment and seeing the results.

Acceptance criteria

Sprint Ready Checklist

Notes

I think there are plenty of ways to do this with the stdlib, instead of using a heavy dependency like dask. One idea might be something like concurrent.futures.ProcessPoolExecutor to launch and monitor the subprocesses.

One place you could easily introduce this parallelism is in the transform directory function. You could imagine building a list of transform specifications (file names, ffmpeg args) while crawling over the input directory, and then at the end dispatching those transforms in a parallel way if the job requests parallel encoding.

I also think doing this on a single node would be a fine place to start.

jwong-nd commented 1 day ago

16