Skip to content

Write a VideoWrite.py Class that writes a buffer to disk in another thread #7

@Greendogo

Description

@Greendogo

I noticed that no other samples of OpenCV VideoWriter online really go into multithreading nor, more importantly, do they adequately solve for smooth video playback speeds.

More often than not, they don't deal with write-to-disk time AND they put the reading and writing in the same thread as each other and as the same thread as main. This can effect playback speed.

I wrote a simple version based off of the examples here:
https://github.com/codingforentrepreneurs/OpenCV-Python-Series/blob/master/src/lessons/record-video.py
which is referenced in the blog post here:
https://www.codingforentrepreneurs.com/blog/how-to-record-video-in-opencv-python

However, before I post it here, I just wanted to lay this out as a proposal to you of some additional classes for your Computer-Vision/Multithread project:
VideoWrite.py - Similar to VideoShow.py and VideoGet.py, which could be used to measure the effects of multi-threading on video writing.
VideoConvert.py - Again, similar, but doing cvtColor (generally, VideoConvert would be an interesting place to show that you can thread any frame manipulations, such as cvtColor, flip, resize, putText/Rectangle/etc., color mapping, etc, etc etc)

If you're interested, at least, in the VideoWrite code I wrote, let me know. I can attach it here and you can morph it to your liking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions