Files
vimix/Recorder.h
Bruno f5da4c8bc2 Recording: support for NVIDIA nvenc and improved stability
Let gstreamer appsrc generate PTS automatically (seems to fix crash of encoding after long duration). Added test for GPU encoders and switch if enabled and available.
2021-08-14 13:41:53 +02:00

64 lines
1.3 KiB
C++

#ifndef RECORDER_H
#define RECORDER_H
#include <vector>
#include <gst/pbutils/pbutils.h>
#include <gst/app/gstappsrc.h>
#include "FrameGrabber.h"
class PNGRecorder : public FrameGrabber
{
std::string filename_;
public:
PNGRecorder();
protected:
void init(GstCaps *caps) override;
void terminate() override;
void addFrame(GstBuffer *buffer, GstCaps *caps) override;
};
class VideoRecorder : public FrameGrabber
{
std::string filename_;
void init(GstCaps *caps) override;
void terminate() override;
public:
typedef enum {
H264_STANDARD = 0,
H264_HQ,
H265_REALTIME,
H265_ANIMATION,
PRORES_STANDARD,
PRORES_HQ,
VP8,
JPEG_MULTI,
DEFAULT
} Profile;
static const char* profile_name[DEFAULT];
static const char* hardware_encoder[DEFAULT];
static const std::vector<std::string> profile_description;
static const std::vector<std::string> hardware_profile_description;
static const char* buffering_preset_name[6];
static const guint64 buffering_preset_value[6];
static const char* framerate_preset_name[3];
static const int framerate_preset_value[3];
VideoRecorder();
std::string info() const override;
};
#endif // RECORDER_H