Skip to content

agiletelescope/opencv-media-controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Opencv Media Controller

A drop-in one-file python library for opencv VideoCapture to provide media control capabilities

demo-gif

What is this

  • It's a wrapper around opencv VideoCapture
  • It offers basic media controls like pausing, fast-forwarding, rewind, restart etc.

Why use this

Often times when processing a video using opencv VideoCapture, there's a possibility that you may need to re-process a frame, or skip to a portion in the video you want to process instead of waiting for the frame to arrive, or worse there's also a possibility of missing out on observing a frame you are interested in, that's when omc will come in handy.

Usage

# Copy the file 'omc.py' to your project and import the library
from omc import OpenMediaController

# Minimal Usage, 
# Display the default camera stream in a window
with OpencvMediaController() as omc:
    for frame in omc.get_frames():  # 'omc.get_frames()' can be replaced with just 'omc'
        omc.show_frame()

# Utility Functions
# - omc.put_text(message)   => Show text with a background
# - omc.show_frame()        => Display the current frame in a window
# - Colors                  => Pre-defined set of colors

Default Hotkeys

Functions Hotkey
Pause/Resume Spacebar
Forward d
Rewind a
Restart r
Quit q

About

A drop-in one-file python library for opencv VideoCapture to provide media control capabilities

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages