Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke Recording Video Frames to Disk via Multiprocessing #110

Open
jmdelahanty opened this issue Jul 15, 2022 · 4 comments
Open

Invoke Recording Video Frames to Disk via Multiprocessing #110

jmdelahanty opened this issue Jul 15, 2022 · 4 comments
Assignees

Comments

@jmdelahanty
Copy link
Contributor

Having the program write the video to disk as a subprocess would be a better way of making sure that parts of the software are running independently from one another. When this should be done isn't something I'm sure about, but it would be good to do.

@annie444 annie444 self-assigned this Jul 20, 2022
@jmdelahanty jmdelahanty changed the title Invoke Recording Video Frames to Disk via Subprocess Invoke Recording Video Frames to Disk via Multiprocessing Dec 1, 2022
@jmdelahanty
Copy link
Contributor Author

After spending some time thinking about this/chatting with a couple people, instead of using a subprocess I should use multiprocessing for this. Wbo knows if I'll ever get to do this...

@jmdelahanty
Copy link
Contributor Author

This is now potentially happening with just a couple lines of code thanks to the folks on the Autopilot Discussions here and here.

It's in the video_multiprocessing branch currently and an initial test seems to have it working which is pretty cool!

@jmdelahanty
Copy link
Contributor Author

This might not actually be working like I thought it was. Could be due to bad output triggers from Bruker's TTL manager, many extra frames were taken during my tests. I'm probably using multiprocessing wrong and causing some strangeness with how video is actually recorded to disk or something.

After some initial testing in the develop branch to make sure that the number of frames in each video is the same as what was scheduled for recording, there's about a 1/3rd more number of frames available for some reason. Might actually be sorta hard to figure out what's happening there....

@jmdelahanty
Copy link
Contributor Author

It's likely this is having trouble because I'm starting a process not through __main__`` but in experiment_utils.py` which the documentation says you shouldn't do. A different reason for this being a problem is also that for some reason on the most updated version of Windows 10 on this machine (Bruker) appears to suddenly spawn a Search bar program when you login that uses a lot of the network at once and causes severe frame drops.

To refactor things to be running in __main__ wouldn't actually be that hard to do since experiment_utils could effectively just be main instead, but I don't know if/when I'll have time to properly do that. This is going to be a pretty low priority for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants