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
Add option to synchronize videos on import #379
Conversation
I've added a checkbox to synchronize videos, and added a handling function that just prints whether the button is checked or not to verify if it works. I tried adding another page, but what we're calling a "wizard" is actually just a QDialog, and I haven't found anything on adding another page to a QDialog. I tried making it a real wizard, but ran into the trouble of dealing with the click connect on line The takeaway is we either need to put some work into making a real wizard, or I can add all of the synchronize options onto the main window. Currently there aren't really options, so I can just have it run skelly synchronize on the folder when you click continue |
Also, I thought my last post mentioned this but if the synchronization button is clicked, it will run skelly synchronize on the videos before importing them, so this PR is minimally viable |
I've changed the layout by putting all of the synchronization information in an hbox. Let me know @jonmatthis if there are any other aesthetic changes to make. (Ignore the coloring, I'm using changes from the recoloring PR because the dialog currently doesn't show up on my computer without them) I've also added proper error handling to skelly_synchronize if videos don't have an audio file. |
…cap/freemocap into philip/synchronize_videos
Skelly_synchronize now outputs a debug plot. Because opencv's videowriter does not support audio, the synchronized videos do not have audio files. So what is being displayed in the "After Cross Correlation" section is the audio files from the raw videos trimmed according to the same process as the videos. This isn't ideal, but it's better than no debug, and there are checks to make sure the videos are trimmed properly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…cap/freemocap into philip/synchronize_videos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woo!
* Add space to readme * remove dummy commit on readme * rename import videos wizard * synchronize videos by audio checkbox * synchronizing, but to wrong place * working messy synchronization * working dummy synchronize parameters * better naming+desrciptions in parameter dialog * disambiguate synchronize video function * change message, remove dummy variable addition * remove debugging print statements * add skelly_synchronize to pyproject dependencies * Change synchronize layout in import videos dialog * Remove unnecessary QWidget import * synchronize videos directly into session folder * Separate button message and label with parentheses * make synchronization run in a thread * pin aniposelib and toml versions * Make sure active recording is set after synching * DRYing _handle_import_videos * move debug plotting out of thread * remove mediapip pin to conform to main * Add word wrap to synchronization message * remove unnecessary import --------- Co-authored-by: jonmatthis <jonmatthis@gmail.com>
This PR is to add an option to the
Import Videos" wizard that will run the imported videos through the
SkellySynchronize` code that will synchronize them by cross corrolating their audio streams and clipping them so they are synchronized and have the exact same number of frames.We'll know it works when a user can load
freemocap
select 'import videos' and load in a folder full of (say) GoPro videos that get synchronized and saved to asycnhronzied_videos
folder to be processed just like any other freemocap recording.Tasks to be done for this to work :
freemocap side
synchronize videos by their audio track
checkbox (or parameter tree?) or a paramter tree pops up after they click "import" if that button is checked?) to theImport Videos
wizard.SkellySynchronize side
skelly_synchronize repo: https://github.com/freemocap/skelly_synchronize
this would close #385