Files
StarPilot/selfdrive/loggerd/video_writer.h
T
George Hotz b872fe92ab loggerd: Separate writer from encoder (#24257)
* seperate writer from encoder

* video writer in release

* confirm loggerd on PC works, add YUV option to compressed_vipc

* make raw_logger use video_writer

* put this back to master

* close codec

* put this back

* use unique_ptr

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 8d2465578707022ca4a54defe171103955026a65
2022-04-20 14:51:24 -07:00

25 lines
546 B
C++

#pragma once
#include <string>
extern "C" {
#include <libavformat/avformat.h>
}
class VideoWriter {
public:
VideoWriter(const char *path, const char *filename, bool remuxing, int width, int height, int fps, bool h265, bool raw);
void write(uint8_t *data, int len, long long timestamp, bool codecconfig, bool keyframe);
~VideoWriter();
AVCodecContext *codec_ctx;
private:
std::string vid_path, lock_path;
FILE *of = nullptr;
AVFormatContext *ofmt_ctx;
AVStream *out_stream;
bool remuxing, raw;
bool wrote_codec_config;
};