Making Video on Windows doesn't work
See original GitHub issueHi Marco,
I’ve encountered a problem with the Video
class: https://github.com/marcomusy/vtkplotter/blob/471ae90046f00579d6e4ad894f78a9018564224b/vtkplotter/vtkio.py#L1403
If I make a video with code similar to the one provided in the example, I get different behaviours depending on the OS:
On Mac it works fine, it creates the video and it’s all good. On Windows it creates a video where the frames are either black or messed up.
I’ve become convinced that the problem is with the ffmpeg
command in Video.close()
, but was unable to find a fix. It should be something about the codec and pixel format used, but I’m unsure about what the solution is.
I should also add that I’ve tried updating ffmpeg to the latest build but that doesn’t change anything.
I don’t know if the Video
class changed recently, but I think I was able to create videos on windows in the past, and I haven’t changed anything on my machine. The only change is that I’m using a more recent version of vtkplotter
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (7 by maintainers)
sure, this is a bunch of utility functions to create videos with opencv: https://github.com/BrancoLab/BrainRender/blob/animation/brainrender/animation/video_utils.py
And this is the brainrender class that handles creating a video (mostly builds upon the vtkplotter video class): https://github.com/BrancoLab/BrainRender/blob/animation/brainrender/animation/video.py
BasicVideoMaker.close()
uses opencv VideoCapture to create a video stream from the saved screenshots and then a VideoWriter to save them as a .mp4 or .avi video. Let me know if there’s anything that is not clear.Cool, nice stuff!