-
Notifications
You must be signed in to change notification settings - Fork 97
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
Render video only works for evenly-sized videos #958
Comments
Hi @ttunja, Thanks for creating the issue - just double checking that the log above is from your most recent try (with the latest version of SLEAP)? Thanks, |
Strange -- seems to be failing to write the images! At the end of your logs it says:
Do you see anything below the last line that says "FFMPEG STDERR OUTPUT"? |
Gotcha -- I think we'll need to troubleshoot on our end then. I think one of our recent changes to the video writer might be masking the true error in this case. Do you mind sharing your video(s) + .slp project file with us? You can send it to We'll get to the bottom of this! |
Thank you, I have sent out the email titled: "Githbub bug slp files and video." |
Hi @ttunja, Thanks for sharing the data! I found the issues. Issue 1: The rendering. The problem here is that your video resolution is not divisible 2, which is a requirement for x264 compression. SLEAP renders the visualization video at the same resolution as the source video, so it was failing when trying to write out the clip at an odd-valued video size. This is evident when trying to re-encode it in ffmpeg, which throws this error:
Unfortunately, due to #842, SLEAP wasn't displaying that error which is why we didn't catch it earlier in the logs. We'll make a note of that and maybe just account for it during rendering. In the meantime, I got around this by re-encoding your video with a 1 pixel cropping like this:
(You can also pad it instead by changing the After reencoding the video with the new size, you can go to SLEAP -> File -> Replace videos... and select the new video to replace the old one. All the poses will stay in the same place since the change in video size is from the bottom-right side. Tada: Issue 2: Labeling procedure. It looks like you're putting the landmarks in the right locations, but you're leaving them all marked "not visible" (except for the Once you've done that, you should be able to retrain and get models that detect all of the landmarks on each animal. BTW: This might actually address most of the problems that you were trying to solve by tuning the hyperparameters in #948. I'll follow up on there as well. Give these a go and let us know if you're running into any issues! Cheers, Talmo |
thank you so much for this it works. One final small step, once I export the video, its not exported with the trail length. I find this super important for a viewer to follow through. How to include trail length in the exported video? Once the coloured trail is there, is there any way to access the colour from the h5 file? |
Hi @ttunja, We currently do not overlay the trails in the video, but it is a great idea! Please post this to the ideas page if you'd like, and we will see that it gets added. The trail color is assigned in the GUI based on the user's preferred color scheme, but is not stored in the exported analysis file. Thanks, |
This feature is now available in the (pre) release 1.3.0a0, to install, first uninstall and then:
Warning: This is a pre-release! Expect bugs and strange behavior when testing. |
Bug description
When trying to render video with clip instances, I get an empty mp4 file.
Input file is .avi and it looks something like this:
I have a single video (20 seconds of mice behaviour, where I perform training and inference on) and its the same video I want to export.
Expected behaviour
I expect that I can open the .mp4 afterwards and look at the tracked instances.
Actual behaviour
Empty video gets produced (0 KB)
Your personal set up
Windows 11 Home, 64-bit operating system, x64-based processor Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz 2.59 GHz
[SLEAP v1.2.8, Python 3.7.12]
Environment packages
Logs
How to reproduce
The text was updated successfully, but these errors were encountered: