forked from PABannier/sam3.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideoFrameExtractor.h
More file actions
46 lines (35 loc) · 1.07 KB
/
Copy pathVideoFrameExtractor.h
File metadata and controls
46 lines (35 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef VIDEFRAMEEXTRACTOR_H
#define VIDEFRAMEEXTRACTOR_H
#include <string>
#include <vector>
#include <memory>
#include <cstdint>
namespace vfe {
struct FrameData {
int width = 0;
int height = 0;
std::shared_ptr<const std::vector<uint8_t>> pixels;
};
class VideoFrameExtractor {
public:
explicit VideoFrameExtractor(const std::string& videoPath);
~VideoFrameExtractor();
VideoFrameExtractor(const VideoFrameExtractor&) = delete;
VideoFrameExtractor& operator=(const VideoFrameExtractor&) = delete;
VideoFrameExtractor(VideoFrameExtractor&&) = delete;
VideoFrameExtractor& operator=(VideoFrameExtractor&&) = delete;
std::string getFileName() const;
std::string getContainerFormat() const;
int getWidth() const;
int getHeight() const;
int64_t getFrameCount() const;
double getDurationSec() const;
bool isOpen() const;
std::shared_ptr<const FrameData> getFrameAt(int frameIndex) const;
private:
struct LRUCache;
struct Impl;
std::unique_ptr<Impl> pImpl;
};
} // namespace vfe
#endif // VIDEFRAMEEXTRACTOR_H