question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Making Video on Windows doesn't work

See original GitHub issue

Hi 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:closed
  • Created 3 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
FedeClaudicommented, Apr 9, 2020

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.

0reactions
FedeClaudicommented, Apr 16, 2020

Cool, nice stuff!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best Solutions to Videos Not Playing on Windows 10 Computer
Various reasons can lead to 'video not playing in windows 10' errors on your computer. Some of the reasons may include: Corruption in...
Read more >
Camera doesn't work in Windows - Microsoft Support
Select Start > Settings > Privacy & security > Camera . Allow access to the camera on this device · Make sure Camera...
Read more >
Computer Won't Play Videos | How to Fix Videos Not Playing
What to do if your computer won't play videos · Way #1. Convert the videos to supported formats · Way #2. Install new...
Read more >
How to fix videos not playing on Windows 10/ 11 | Stellar
Methods to fix videos not playing on Windows 10/ 11 · 1. Restart your video player · 2. Uninstall and reinstall the Display...
Read more >
How To FIX Camera NOT Working on Windows 10 Problem
Meant for all current Windows versions: XP, Vista, Windows 7, 8, 8.1, and of course Windows 10. Make sure to watch the entire...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found