split out codec and encoder, allowing one to specify which encoder to use
This commit is contained in:
parent
84b42ef4d7
commit
c443168389
|
@ -710,7 +710,8 @@ CREATE TABLE `Monitors` (
|
||||||
`Deinterlacing` int(10) unsigned NOT NULL default '0',
|
`Deinterlacing` int(10) unsigned NOT NULL default '0',
|
||||||
`SaveJPEGs` TINYINT NOT NULL DEFAULT '3' ,
|
`SaveJPEGs` TINYINT NOT NULL DEFAULT '3' ,
|
||||||
`VideoWriter` TINYINT NOT NULL DEFAULT '0',
|
`VideoWriter` TINYINT NOT NULL DEFAULT '0',
|
||||||
`OutputCodec` enum('h264','mjpeg','mpeg1','mpeg2'),
|
`OutputCodec` int(10) unsigned NOT NULL default 0,
|
||||||
|
`Encoder` enum('auto','h264','h264_omx','mjpeg','mpeg1','mpeg2'),
|
||||||
`OutputContainer` enum('auto','mp4','mkv'),
|
`OutputContainer` enum('auto','mp4','mkv'),
|
||||||
`EncoderParameters` TEXT,
|
`EncoderParameters` TEXT,
|
||||||
`RecordAudio` TINYINT NOT NULL DEFAULT '0',
|
`RecordAudio` TINYINT NOT NULL DEFAULT '0',
|
||||||
|
|
|
@ -176,8 +176,10 @@ BEGIN
|
||||||
WHERE Id=OLD.MonitorId;
|
WHERE Id=OLD.MonitorId;
|
||||||
END IF;
|
END IF;
|
||||||
END IF;
|
END IF;
|
||||||
ELSEIF ( NEW.Archived AND diff ) THEN
|
ELSE
|
||||||
UPDATE Events_Archived SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id;
|
IF ( NEW.Archived AND diff ) THEN
|
||||||
|
UPDATE Events_Archived SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id;
|
||||||
|
END IF;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF ( diff ) THEN
|
IF ( diff ) THEN
|
||||||
|
@ -185,7 +187,6 @@ BEGIN
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
END;
|
END;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
delimiter ;
|
delimiter ;
|
||||||
|
|
|
@ -190,7 +190,7 @@ Event::Event(
|
||||||
if ( monitor->GetOptVideoWriter() != 0 ) {
|
if ( monitor->GetOptVideoWriter() != 0 ) {
|
||||||
std::string container = monitor->OutputContainer();
|
std::string container = monitor->OutputContainer();
|
||||||
if ( container == "auto" || container == "" ) {
|
if ( container == "auto" || container == "" ) {
|
||||||
if ( monitor->OutputCodec() == "h264" ) {
|
if ( monitor->OutputCodec() == AV_CODEC_ID_H264 ) {
|
||||||
container = "mp4";
|
container = "mp4";
|
||||||
} else {
|
} else {
|
||||||
container = "mkv";
|
container = "mkv";
|
||||||
|
|
|
@ -249,7 +249,8 @@ Monitor::Monitor(
|
||||||
int p_colours,
|
int p_colours,
|
||||||
VideoWriter p_videowriter,
|
VideoWriter p_videowriter,
|
||||||
std::string &p_encoderparams,
|
std::string &p_encoderparams,
|
||||||
std::string &p_output_codec,
|
int p_output_codec,
|
||||||
|
std::string &p_encoder,
|
||||||
std::string &p_output_container,
|
std::string &p_output_container,
|
||||||
bool p_record_audio,
|
bool p_record_audio,
|
||||||
const char *p_event_prefix,
|
const char *p_event_prefix,
|
||||||
|
@ -292,6 +293,7 @@ Monitor::Monitor(
|
||||||
videowriter( p_videowriter ),
|
videowriter( p_videowriter ),
|
||||||
encoderparams( p_encoderparams ),
|
encoderparams( p_encoderparams ),
|
||||||
output_codec( p_output_codec ),
|
output_codec( p_output_codec ),
|
||||||
|
encoder( p_encoder ),
|
||||||
output_container( p_output_container ),
|
output_container( p_output_container ),
|
||||||
record_audio( p_record_audio ),
|
record_audio( p_record_audio ),
|
||||||
label_coord( p_label_coord ),
|
label_coord( p_label_coord ),
|
||||||
|
@ -1761,7 +1763,7 @@ void Monitor::ReloadLinkedMonitors( const char *p_linked_monitors ) {
|
||||||
|
|
||||||
#if ZM_HAS_V4L
|
#if ZM_HAS_V4L
|
||||||
int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose purpose ) {
|
int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose purpose ) {
|
||||||
std::string sql = "select Id, Name, ServerId, StorageId, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, SaveJPEGs, VideoWriter, EncoderParameters, OutputCodec, OutputContainer, RecordAudio, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour, Exif from Monitors where Function != 'None' and Type = 'Local'";
|
std::string sql = "select Id, Name, ServerId, StorageId, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, SaveJPEGs, VideoWriter, EncoderParameters, OutputCodec, Encoder, OutputContainer, RecordAudio, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour, Exif from Monitors where Function != 'None' and Type = 'Local'";
|
||||||
;
|
;
|
||||||
if ( device[0] ) {
|
if ( device[0] ) {
|
||||||
sql += " AND Device='";
|
sql += " AND Device='";
|
||||||
|
@ -1826,7 +1828,8 @@ int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose
|
||||||
int savejpegs = atoi(dbrow[col]); col++;
|
int savejpegs = atoi(dbrow[col]); col++;
|
||||||
VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++;
|
VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++;
|
||||||
std::string encoderparams = dbrow[col] ? dbrow[col] : ""; col++;
|
std::string encoderparams = dbrow[col] ? dbrow[col] : ""; col++;
|
||||||
std::string output_codec = dbrow[col] ? dbrow[col] : ""; col++;
|
int output_codec = dbrow[col] ? atoi(dbrow[col]) : 0; col++;
|
||||||
|
std::string encoder = dbrow[col] ? dbrow[col] : ""; col++;
|
||||||
std::string output_container = dbrow[col] ? dbrow[col] : ""; col++;
|
std::string output_container = dbrow[col] ? dbrow[col] : ""; col++;
|
||||||
bool record_audio = (*dbrow[col] != '0'); col++;
|
bool record_audio = (*dbrow[col] != '0'); col++;
|
||||||
|
|
||||||
|
@ -1907,6 +1910,7 @@ int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose
|
||||||
videowriter,
|
videowriter,
|
||||||
encoderparams,
|
encoderparams,
|
||||||
output_codec,
|
output_codec,
|
||||||
|
encoder,
|
||||||
output_container,
|
output_container,
|
||||||
record_audio,
|
record_audio,
|
||||||
event_prefix,
|
event_prefix,
|
||||||
|
@ -1955,7 +1959,7 @@ int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose
|
||||||
#endif // ZM_HAS_V4L
|
#endif // ZM_HAS_V4L
|
||||||
|
|
||||||
int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const char *port, const char *path, Monitor **&monitors, Purpose purpose ) {
|
int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const char *port, const char *path, Monitor **&monitors, Purpose purpose ) {
|
||||||
std::string sql = "select Id, Name, ServerId, StorageId, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, RTSPDescribe, SaveJPEGs, VideoWriter, EncoderParameters, OutputCodec, OutputContainer, RecordAudio, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'Remote'";
|
std::string sql = "select Id, Name, ServerId, StorageId, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, RTSPDescribe, SaveJPEGs, VideoWriter, EncoderParameters, OutputCodec, Encoder, OutputContainer, RecordAudio, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'Remote'";
|
||||||
if ( staticConfig.SERVER_ID ) {
|
if ( staticConfig.SERVER_ID ) {
|
||||||
sql += stringtf( " AND ServerId=%d", staticConfig.SERVER_ID );
|
sql += stringtf( " AND ServerId=%d", staticConfig.SERVER_ID );
|
||||||
}
|
}
|
||||||
|
@ -2001,7 +2005,8 @@ int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const c
|
||||||
int savejpegs = atoi(dbrow[col]); col++;
|
int savejpegs = atoi(dbrow[col]); col++;
|
||||||
VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++;
|
VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++;
|
||||||
std::string encoderparams = dbrow[col] ? dbrow[col] : ""; col++;
|
std::string encoderparams = dbrow[col] ? dbrow[col] : ""; col++;
|
||||||
std::string output_codec = dbrow[col] ? dbrow[col] : ""; col++;
|
int output_codec = dbrow[col] ? atoi(dbrow[col]) : 0; col++;
|
||||||
|
std::string encoder = dbrow[col] ? dbrow[col] : ""; col++;
|
||||||
std::string output_container = dbrow[col] ? dbrow[col] : ""; col++;
|
std::string output_container = dbrow[col] ? dbrow[col] : ""; col++;
|
||||||
bool record_audio = (*dbrow[col] != '0'); col++;
|
bool record_audio = (*dbrow[col] != '0'); col++;
|
||||||
|
|
||||||
|
@ -2096,6 +2101,7 @@ int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const c
|
||||||
videowriter,
|
videowriter,
|
||||||
encoderparams,
|
encoderparams,
|
||||||
output_codec,
|
output_codec,
|
||||||
|
encoder,
|
||||||
output_container,
|
output_container,
|
||||||
record_audio,
|
record_audio,
|
||||||
event_prefix,
|
event_prefix,
|
||||||
|
@ -2143,7 +2149,7 @@ int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const c
|
||||||
}
|
}
|
||||||
|
|
||||||
int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose purpose ) {
|
int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose purpose ) {
|
||||||
std::string sql = "select Id, Name, ServerId, StorageId, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, SaveJPEGs, VideoWriter, EncoderParameters, OutputCodec, OutputContainer, RecordAudio, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'File'";
|
std::string sql = "select Id, Name, ServerId, StorageId, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, SaveJPEGs, VideoWriter, EncoderParameters, OutputCodec, Encoder, OutputContainer, RecordAudio, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'File'";
|
||||||
if ( file[0] ) {
|
if ( file[0] ) {
|
||||||
sql += " AND Path='";
|
sql += " AND Path='";
|
||||||
sql += file;
|
sql += file;
|
||||||
|
@ -2185,7 +2191,8 @@ int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose pu
|
||||||
int savejpegs = atoi(dbrow[col]); col++;
|
int savejpegs = atoi(dbrow[col]); col++;
|
||||||
VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++;
|
VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++;
|
||||||
std::string encoderparams = dbrow[col]; col++;
|
std::string encoderparams = dbrow[col]; col++;
|
||||||
std::string output_codec = dbrow[col]; col++;
|
int output_codec = dbrow[col] ? atoi(dbrow[col]) : 0; col++;
|
||||||
|
std::string encoder = dbrow[col]; col++;
|
||||||
std::string output_container = dbrow[col]; col++;
|
std::string output_container = dbrow[col]; col++;
|
||||||
bool record_audio = (*dbrow[col] != '0'); col++;
|
bool record_audio = (*dbrow[col] != '0'); col++;
|
||||||
|
|
||||||
|
@ -2250,6 +2257,7 @@ int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose pu
|
||||||
videowriter,
|
videowriter,
|
||||||
encoderparams,
|
encoderparams,
|
||||||
output_codec,
|
output_codec,
|
||||||
|
encoder,
|
||||||
output_container,
|
output_container,
|
||||||
record_audio,
|
record_audio,
|
||||||
event_prefix,
|
event_prefix,
|
||||||
|
@ -2298,7 +2306,7 @@ int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose pu
|
||||||
|
|
||||||
#if HAVE_LIBAVFORMAT
|
#if HAVE_LIBAVFORMAT
|
||||||
int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose purpose ) {
|
int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose purpose ) {
|
||||||
std::string sql = "select Id, Name, ServerId, StorageId, Function+0, Enabled, LinkedMonitors, Path, Method, Options, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, SaveJPEGs, VideoWriter, EncoderParameters, OutputCodec, OutputContainer, RecordAudio, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'Ffmpeg'";
|
std::string sql = "select Id, Name, ServerId, StorageId, Function+0, Enabled, LinkedMonitors, Path, Method, Options, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, SaveJPEGs, VideoWriter, EncoderParameters, OutputCodec, Encoder, OutputContainer, RecordAudio, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'Ffmpeg'";
|
||||||
if ( file[0] ) {
|
if ( file[0] ) {
|
||||||
sql += " AND Path = '";
|
sql += " AND Path = '";
|
||||||
sql += file;
|
sql += file;
|
||||||
|
@ -2343,7 +2351,8 @@ int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose
|
||||||
int savejpegs = atoi(dbrow[col]); col++;
|
int savejpegs = atoi(dbrow[col]); col++;
|
||||||
VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++;
|
VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++;
|
||||||
std::string encoderparams = dbrow[col] ? dbrow[col] : ""; col++;
|
std::string encoderparams = dbrow[col] ? dbrow[col] : ""; col++;
|
||||||
std::string output_codec = dbrow[col] ? dbrow[col] : ""; col++;
|
int output_codec = dbrow[col] ? atoi(dbrow[col]) : 0; col++;
|
||||||
|
std::string encoder = dbrow[col] ? dbrow[col] : ""; col++;
|
||||||
std::string output_container = dbrow[col] ? dbrow[col] : ""; col++;
|
std::string output_container = dbrow[col] ? dbrow[col] : ""; col++;
|
||||||
bool record_audio = (*dbrow[col] != '0'); col++;
|
bool record_audio = (*dbrow[col] != '0'); col++;
|
||||||
|
|
||||||
|
@ -2414,6 +2423,7 @@ int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose
|
||||||
videowriter,
|
videowriter,
|
||||||
encoderparams,
|
encoderparams,
|
||||||
output_codec,
|
output_codec,
|
||||||
|
encoder,
|
||||||
output_container,
|
output_container,
|
||||||
record_audio,
|
record_audio,
|
||||||
event_prefix,
|
event_prefix,
|
||||||
|
@ -2524,7 +2534,8 @@ Monitor *Monitor::Load( unsigned int p_id, bool load_zones, Purpose purpose ) {
|
||||||
int savejpegs = atoi(dbrow[col]); col++;
|
int savejpegs = atoi(dbrow[col]); col++;
|
||||||
VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++;
|
VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++;
|
||||||
std::string encoderparams = dbrow[col] ? dbrow[col] : ""; col++;
|
std::string encoderparams = dbrow[col] ? dbrow[col] : ""; col++;
|
||||||
std::string output_codec = dbrow[col] ? dbrow[col] : ""; col++;
|
int output_codec = dbrow[col] ? atoi(dbrow[col]) : 0; col++;
|
||||||
|
std::string encoder = dbrow[col] ? dbrow[col] : ""; col++;
|
||||||
std::string output_container = dbrow[col] ? dbrow[col] : ""; col++;
|
std::string output_container = dbrow[col] ? dbrow[col] : ""; col++;
|
||||||
bool record_audio = (*dbrow[col] != '0'); col++;
|
bool record_audio = (*dbrow[col] != '0'); col++;
|
||||||
|
|
||||||
|
@ -2746,6 +2757,7 @@ Monitor *Monitor::Load( unsigned int p_id, bool load_zones, Purpose purpose ) {
|
||||||
videowriter,
|
videowriter,
|
||||||
encoderparams,
|
encoderparams,
|
||||||
output_codec,
|
output_codec,
|
||||||
|
encoder,
|
||||||
output_container,
|
output_container,
|
||||||
record_audio,
|
record_audio,
|
||||||
event_prefix,
|
event_prefix,
|
||||||
|
|
|
@ -239,7 +239,8 @@ protected:
|
||||||
int colours;
|
int colours;
|
||||||
VideoWriter videowriter;
|
VideoWriter videowriter;
|
||||||
std::string encoderparams;
|
std::string encoderparams;
|
||||||
std::string output_codec;
|
int output_codec;
|
||||||
|
std::string encoder;
|
||||||
std::string output_container;
|
std::string output_container;
|
||||||
std::vector<EncoderParameter_t> encoderparamsvec;
|
std::vector<EncoderParameter_t> encoderparamsvec;
|
||||||
_AVPIXELFORMAT imagePixFormat;
|
_AVPIXELFORMAT imagePixFormat;
|
||||||
|
@ -359,7 +360,8 @@ public:
|
||||||
int p_colours,
|
int p_colours,
|
||||||
VideoWriter p_videowriter,
|
VideoWriter p_videowriter,
|
||||||
std::string &p_encoderparams,
|
std::string &p_encoderparams,
|
||||||
std::string &p_output_codec,
|
int p_output_codec,
|
||||||
|
std::string &p_encoder,
|
||||||
std::string &p_output_container,
|
std::string &p_output_container,
|
||||||
bool p_record_audio,
|
bool p_record_audio,
|
||||||
const char *p_event_prefix,
|
const char *p_event_prefix,
|
||||||
|
@ -458,7 +460,8 @@ public:
|
||||||
VideoWriter GetOptVideoWriter() const { return( videowriter ); }
|
VideoWriter GetOptVideoWriter() const { return( videowriter ); }
|
||||||
const std::vector<EncoderParameter_t>* GetOptEncoderParams() const { return( &encoderparamsvec ); }
|
const std::vector<EncoderParameter_t>* GetOptEncoderParams() const { return( &encoderparamsvec ); }
|
||||||
const std::string &GetEncoderOptions() const { return( encoderparams ); }
|
const std::string &GetEncoderOptions() const { return( encoderparams ); }
|
||||||
const std::string &OutputCodec() const { return output_codec; }
|
const std::string &Encoder() const { return encoder; }
|
||||||
|
const int OutputCodec() const { return output_codec; }
|
||||||
const std::string &OutputContainer() const { return output_container; }
|
const std::string &OutputContainer() const { return output_container; }
|
||||||
|
|
||||||
uint32_t GetVideoWriterEventId() const { return video_store_data->current_event; }
|
uint32_t GetVideoWriterEventId() const { return video_store_data->current_event; }
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -19,6 +19,15 @@ class VideoStore;
|
||||||
class VideoStore {
|
class VideoStore {
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
struct CodecData {
|
||||||
|
const int codec_id;
|
||||||
|
const char *codec_codec;
|
||||||
|
const char *codec_name;
|
||||||
|
const enum AVPixelFormat pix_fmt;
|
||||||
|
|
||||||
|
};
|
||||||
|
static struct CodecData codec_data[];
|
||||||
|
|
||||||
Monitor *monitor;
|
Monitor *monitor;
|
||||||
AVOutputFormat *out_format;
|
AVOutputFormat *out_format;
|
||||||
AVFormatContext *oc;
|
AVFormatContext *oc;
|
||||||
|
|
|
@ -15,7 +15,8 @@ private $defaults = array(
|
||||||
'Height' => null,
|
'Height' => null,
|
||||||
'Orientation' => null,
|
'Orientation' => null,
|
||||||
'AnalysisFPSLimit' => null,
|
'AnalysisFPSLimit' => null,
|
||||||
'OutputCodec' => 'h264',
|
'OutputCodec' => '0',
|
||||||
|
'Encoder' => 'auto',
|
||||||
'OutputContainer' => 'auto',
|
'OutputContainer' => 'auto',
|
||||||
'ZoneCount' => 0,
|
'ZoneCount' => 0,
|
||||||
'Triggers' => null,
|
'Triggers' => null,
|
||||||
|
|
|
@ -470,13 +470,21 @@ $videowriteropts = array(
|
||||||
'X264 Encode' => 1,
|
'X264 Encode' => 1,
|
||||||
'H264 Camera Passthrough' => 2
|
'H264 Camera Passthrough' => 2
|
||||||
);
|
);
|
||||||
$videowriter_codecs = array(
|
$videowriter_encoders = array(
|
||||||
'' => translate('Disabled'),
|
'' => translate('Auto'),
|
||||||
|
'h264_omx' => 'h264_omx',
|
||||||
'h264' => 'h264',
|
'h264' => 'h264',
|
||||||
'mjpeg' => 'mjpeg',
|
'mjpeg' => 'mjpeg',
|
||||||
'mpeg1' => 'mpeg1',
|
'mpeg1' => 'mpeg1',
|
||||||
'mpeg2' => 'mpeg2',
|
'mpeg2' => 'mpeg2',
|
||||||
);
|
);
|
||||||
|
$videowriter_codecs = array(
|
||||||
|
'0' => translate('Disabled'),
|
||||||
|
'220' => 'h264',
|
||||||
|
'8' => 'mjpeg',
|
||||||
|
'1' => 'mpeg1',
|
||||||
|
'2' => 'mpeg2',
|
||||||
|
);
|
||||||
$videowriter_containers = array(
|
$videowriter_containers = array(
|
||||||
'' => translate('Auto'),
|
'' => translate('Auto'),
|
||||||
'mp4' => 'mp4',
|
'mp4' => 'mp4',
|
||||||
|
@ -609,6 +617,7 @@ if ( $tab != 'storage' ) {
|
||||||
<input type="hidden" name="newMonitor[SaveJPEGs]" value="<?php echo validHtmlStr($monitor->SaveJPEGs()) ?>"/>
|
<input type="hidden" name="newMonitor[SaveJPEGs]" value="<?php echo validHtmlStr($monitor->SaveJPEGs()) ?>"/>
|
||||||
<input type="hidden" name="newMonitor[VideoWriter]" value="<?php echo validHtmlStr($monitor->VideoWriter()) ?>"/>
|
<input type="hidden" name="newMonitor[VideoWriter]" value="<?php echo validHtmlStr($monitor->VideoWriter()) ?>"/>
|
||||||
<input type="hidden" name="newMonitor[OutputCodec]" value="<?php echo validHtmlStr($monitor->OutputCodec()) ?>"/>
|
<input type="hidden" name="newMonitor[OutputCodec]" value="<?php echo validHtmlStr($monitor->OutputCodec()) ?>"/>
|
||||||
|
<input type="hidden" name="newMonitor[Encoder]" value="<?php echo validHtmlStr($monitor->Encoder()) ?>"/>
|
||||||
<input type="hidden" name="newMonitor[OutputContainer]" value="<?php echo validHtmlStr($monitor->OutputContainer()) ?>"/>
|
<input type="hidden" name="newMonitor[OutputContainer]" value="<?php echo validHtmlStr($monitor->OutputContainer()) ?>"/>
|
||||||
<input type="hidden" name="newMonitor[EncoderParameters]" value="<?php echo validHtmlStr($monitor->EncoderParameters()) ?>"/>
|
<input type="hidden" name="newMonitor[EncoderParameters]" value="<?php echo validHtmlStr($monitor->EncoderParameters()) ?>"/>
|
||||||
<input type="hidden" name="newMonitor[RecordAudio]" value="<?php echo validHtmlStr($monitor->RecordAudio()) ?>"/>
|
<input type="hidden" name="newMonitor[RecordAudio]" value="<?php echo validHtmlStr($monitor->RecordAudio()) ?>"/>
|
||||||
|
@ -912,6 +921,7 @@ if ( $monitor->Type() == 'Local' ) {
|
||||||
<tr><td><?php echo translate('SaveJPEGs') ?></td><td><select name="newMonitor[SaveJPEGs]"><?php foreach ( $savejpegopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $monitor->SaveJPEGs() ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
|
<tr><td><?php echo translate('SaveJPEGs') ?></td><td><select name="newMonitor[SaveJPEGs]"><?php foreach ( $savejpegopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $monitor->SaveJPEGs() ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
|
||||||
<tr><td><?php echo translate('VideoWriter') ?></td><td><select name="newMonitor[VideoWriter]"><?php foreach ( $videowriteropts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $monitor->VideoWriter() ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
|
<tr><td><?php echo translate('VideoWriter') ?></td><td><select name="newMonitor[VideoWriter]"><?php foreach ( $videowriteropts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $monitor->VideoWriter() ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
|
||||||
<tr><td><?php echo translate('OutputCodec') ?></td><td><?php echo htmlSelect( 'newMonitor[OutputCodec]', $videowriter_codecs, $monitor->OutputCodec() );?></td></tr>
|
<tr><td><?php echo translate('OutputCodec') ?></td><td><?php echo htmlSelect( 'newMonitor[OutputCodec]', $videowriter_codecs, $monitor->OutputCodec() );?></td></tr>
|
||||||
|
<tr><td><?php echo translate('Encoder') ?></td><td><?php echo htmlSelect( 'newMonitor[Encoder]', $videowriter_encoders, $monitor->Encoder() );?></td></tr>
|
||||||
<tr><td><?php echo translate('OutputContainer') ?></td><td><?php echo htmlSelect( 'newMonitor[OutputContainer]', $videowriter_containers, $monitor->OutputContainer() );?></td></tr>
|
<tr><td><?php echo translate('OutputContainer') ?></td><td><?php echo htmlSelect( 'newMonitor[OutputContainer]', $videowriter_containers, $monitor->OutputContainer() );?></td></tr>
|
||||||
<tr><td><?php echo translate('OptionalEncoderParam') ?></td><td><textarea name="newMonitor[EncoderParameters]" rows="4" cols="36"><?php echo validHtmlStr($monitor->EncoderParameters()) ?></textarea></td></tr>
|
<tr><td><?php echo translate('OptionalEncoderParam') ?></td><td><textarea name="newMonitor[EncoderParameters]" rows="4" cols="36"><?php echo validHtmlStr($monitor->EncoderParameters()) ?></textarea></td></tr>
|
||||||
<tr><td><?php echo translate('RecordAudio') ?></td><td><input type="checkbox" name="newMonitor[RecordAudio]" value="1"<?php if ( $monitor->RecordAudio() ) { ?> checked="checked"<?php } ?>/></td></tr>
|
<tr><td><?php echo translate('RecordAudio') ?></td><td><input type="checkbox" name="newMonitor[RecordAudio]" value="1"<?php if ( $monitor->RecordAudio() ) { ?> checked="checked"<?php } ?>/></td></tr>
|
||||||
|
|
Loading…
Reference in New Issue