23#include <opencv2/core/version.hpp>
24#include <opencv2/videoio.hpp>
Thread-safe synchronized producer/consumer queue.
Video output to a movie file, using OpenCV video encoding.
virtual ~MovieOutput()
Virtual destructor for safe inheritance.
void run()
Use a thread to encode and save frames.
virtual void streamOff() override
Stop streaming.
int itsFileNum
File number, gets incremented on each streamOff() to avoid overwriting previous files.
virtual void send(RawImage const &img) override
Send an image out.
std::string itsFilebase
Current file base to save video to.
std::atomic< bool > itsSaving
True when we are saving to file.
std::atomic< bool > itsRunning
True when our run() thread should keep running.
VideoMapping itsMapping
Our current video mapping, we resize the input to the mapping's camera dims.
virtual void setFormat(VideoMapping const &m) override
Set the video format and frame rate.
jevois::BoundedBuffer< cv::Mat, jevois::BlockingBehavior::Block, jevois::BlockingBehavior::Block > itsBuf
Buffer of frames to encode and write to file.
std::string itsFilename
Current file name to save video to.
std::shared_ptr< VideoBuf > itsBuffer
Our single video buffer.
virtual void streamOn() override
Start streaming.
virtual void get(RawImage &img) override
Get a pre-allocated image so that we can fill the pixel data and later send out using send()
std::future< void > itsRunFut
Future for our run() thread.
virtual void abortStream() override
Abort streaming.
A raw image as coming from a V4L2 Camera and/or being sent out to a USB Gadget.
Base class for video output. Gadget, MovieOutput, VideoDisplay, and VideoOutputNone derive from it.
@ Block
Block until operation can be completed.
Main namespace for all JeVois classes and functions.
Simple struct to hold video mapping definitions for the processing Engine.