mf
Media Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
video_exporter.h
Go to the documentation of this file.
1 #ifndef MF_VIDEO_EXPORTER_H_
2 #define MF_VIDEO_EXPORTER_H_
3 
4 #include <string>
5 #include "frame_exporter.h"
6 #include "../color.h"
7 #include "../opencv.h"
8 
9 namespace mf {
10 
12 
13 class video_exporter : public frame_exporter<2, rgb_color> {
15 
16 private:
17  cv::VideoWriter writer_;
18 
19 public:
21  const std::string& filename,
22  const ndsize<2>& frame_shape,
23  float frame_rate = 25.0,
24  const std::string& format = "mp4v"
25  );
26 
27  void write_frame(const ndarray_view<2, rgb_color>&) override;
28  void close() override;
29 };
30 
31 }
32 
33 #endif
void write_frame(const ndarray_view< 2, rgb_color > &) override
Definition: video_exporter.cc:20
Mapping between coordinates, indices, and addresses of multi-dimensional data.
Definition: ndarray_view.h:16
video_exporter(const std::string &filename, const ndsize< 2 > &frame_shape, float frame_rate=25.0, const std::string &format="mp4v")
Definition: video_exporter.cc:8
void close() override
Definition: video_exporter.cc:26
Frame exporter, abstract base class.
Definition: frame_exporter.h:12
Vector of n-dimensional coordinates.
Definition: ndcoord.h:18
const ndsize< Dim > & frame_shape()
Definition: frame_exporter.h:27
Frame exporter which writes video file.
Definition: video_exporter.h:13