mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-20 06:48:00 -04:00
Merge branch 'feature-h264-videostorage' into storageareas
This commit is contained in:
@@ -22,7 +22,9 @@ Build-Depends: debhelper (>= 9), dh-systemd, python-sphinx | python3-sphinx, apa
|
||||
,libphp-serialization-perl
|
||||
,libsys-mmap-perl [!hurd-any]
|
||||
,libwww-perl
|
||||
,libdata-uuid-perl
|
||||
,libdata-uuid-perl
|
||||
,libx264-dev
|
||||
,libmp4v2-dev
|
||||
# Unbundled (dh_linktree):
|
||||
,libjs-jquery
|
||||
,libjs-mootools
|
||||
@@ -55,7 +57,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}
|
||||
,libio-socket-multicast-perl
|
||||
,libdigest-sha-perl
|
||||
,libsys-cpu-perl, libsys-meminfo-perl
|
||||
,libdata-uuid-perl
|
||||
,libdata-uuid-perl
|
||||
,mysql-client | virtual-mysql-client
|
||||
,perl-modules
|
||||
,php5-mysql | php-mysql, php5-gd | php-gd
|
||||
|
||||
@@ -203,10 +203,10 @@ int SWScale::Convert(const uint8_t* in_buffer, const size_t in_buffer_size, uint
|
||||
// Error("Invalid input or output pixel formats");
|
||||
// return -2;
|
||||
// }
|
||||
// if(!width || !height) {
|
||||
// Error("Invalid width or height");
|
||||
// return -3;
|
||||
// }
|
||||
if (!width || !height) {
|
||||
Error("Invalid width or height");
|
||||
return -3;
|
||||
}
|
||||
|
||||
#if LIBSWSCALE_VERSION_CHECK(0, 8, 0, 8, 0)
|
||||
/* Warn if the input or output pixelformat is not supported */
|
||||
|
||||
@@ -600,6 +600,7 @@ int FfmpegCamera::CaptureAndRecord( Image &image, bool recording, char* event_fi
|
||||
NULL,
|
||||
startTime,
|
||||
this->getMonitor()->getOrientation());
|
||||
|
||||
} else {
|
||||
Debug(3, "Video module initiated with audio stream");
|
||||
videoStore = new VideoStore((const char *) event_file, "mp4",
|
||||
|
||||
@@ -605,9 +605,10 @@ Monitor::~Monitor() {
|
||||
privacy_bitmask = NULL;
|
||||
}
|
||||
if ( mem_ptr ) {
|
||||
if ( event )
|
||||
if ( event ) {
|
||||
Info( "%s: %03d - Closing event %d, shutting down", name, image_count, event->Id() );
|
||||
closeEvent();
|
||||
closeEvent();
|
||||
}
|
||||
|
||||
if ( (deinterlacing & 0xff) == 4) {
|
||||
delete next_buffer.image;
|
||||
@@ -3010,14 +3011,15 @@ void Monitor::TimestampImage( Image *ts_image, const struct timeval *ts_time ) c
|
||||
}
|
||||
}
|
||||
|
||||
bool Monitor::closeEvent()
|
||||
{
|
||||
video_store_data->recording = false;
|
||||
if ( event ) {
|
||||
if ( function == RECORD || function == MOCORD ) {
|
||||
bool Monitor::closeEvent() {
|
||||
if (event)
|
||||
{
|
||||
if ( function == RECORD || function == MOCORD )
|
||||
{
|
||||
gettimeofday( &(event->EndTime()), NULL );
|
||||
}
|
||||
delete event;
|
||||
video_store_data->recording = false;
|
||||
event = 0;
|
||||
return( true );
|
||||
}
|
||||
@@ -4152,6 +4154,7 @@ void Monitor::SingleImageZip( int scale)
|
||||
fprintf( stdout, "Content-Type: image/x-rgbz\r\n\r\n" );
|
||||
fwrite( img_buffer, img_buffer_size, 1, stdout );
|
||||
}
|
||||
|
||||
unsigned int Monitor::Colours() const { return( camera->Colours() ); }
|
||||
unsigned int Monitor::SubpixelOrder() const { return( camera->SubpixelOrder() ); }
|
||||
int Monitor::PrimeCapture() {
|
||||
|
||||
@@ -419,16 +419,16 @@ public:
|
||||
inline bool Exif() {
|
||||
return( embed_exif );
|
||||
}
|
||||
Orientation getOrientation()const;
|
||||
Orientation getOrientation() const;
|
||||
|
||||
unsigned int Width() const { return width; }
|
||||
unsigned int Height() const { return height; }
|
||||
unsigned int Colours() const;
|
||||
unsigned int SubpixelOrder() const;
|
||||
|
||||
|
||||
int GetOptSaveJPEGs() const { return( savejpegspref ); }
|
||||
int GetOptVideoWriter() const { return( videowriterpref ); }
|
||||
const std::vector<EncoderParameter_t>* GetOptEncoderParams() const { return( &encoderparamsvec ); }
|
||||
const std::vector<EncoderParameter_t>* GetOptEncoderParams() const { return( &encoderparamsvec ); }
|
||||
|
||||
State GetState() const;
|
||||
int GetImage( int index=-1, int scale=100 );
|
||||
|
||||
@@ -488,7 +488,11 @@ int RemoteCameraRtsp::CaptureAndRecord( Image &image, bool recording, char* even
|
||||
if ( recording && !wasRecording ) {
|
||||
//Instantiate the video storage module
|
||||
|
||||
videoStore = new VideoStore((const char *)event_file, "mp4", mFormatContext->streams[mVideoStreamId],mAudioStreamId==-1?NULL:mFormatContext->streams[mAudioStreamId],startTime, this->getMonitor()->getOrientation() );
|
||||
videoStore = new VideoStore((const char *)event_file, "mp4",
|
||||
mFormatContext->streams[mVideoStreamId],
|
||||
mAudioStreamId==-1?NULL:mFormatContext->streams[mAudioStreamId],
|
||||
startTime,
|
||||
this->getMonitor()->getOrientation() );
|
||||
wasRecording = true;
|
||||
strcpy(oldDirectory, event_file);
|
||||
|
||||
@@ -508,7 +512,11 @@ int RemoteCameraRtsp::CaptureAndRecord( Image &image, bool recording, char* even
|
||||
videoStore = NULL;
|
||||
}
|
||||
|
||||
videoStore = new VideoStore((const char *)event_file, "mp4", mFormatContext->streams[mVideoStreamId],mAudioStreamId==-1?NULL:mFormatContext->streams[mAudioStreamId],startTime, this->getMonitor()->getOrientation() );
|
||||
videoStore = new VideoStore((const char *)event_file, "mp4",
|
||||
mFormatContext->streams[mVideoStreamId],
|
||||
mAudioStreamId==-1?NULL:mFormatContext->streams[mAudioStreamId],
|
||||
startTime,
|
||||
this->getMonitor()->getOrientation() );
|
||||
strcpy( oldDirectory, event_file );
|
||||
}
|
||||
|
||||
|
||||
@@ -114,6 +114,25 @@ VideoStore::VideoStore(const char *filename_in, const char *format_in,
|
||||
video_st->codec->time_base.den = video_st->time_base.den;
|
||||
}
|
||||
|
||||
if ( video_st->sample_aspect_ratio.den != video_st->codec->sample_aspect_ratio.den ) {
|
||||
Warning("Fixingample_aspect_ratio.den");
|
||||
video_st->sample_aspect_ratio.den = video_st->codec->sample_aspect_ratio.den;
|
||||
}
|
||||
if ( video_st->sample_aspect_ratio.num != input_st->codec->sample_aspect_ratio.num ) {
|
||||
Warning("Fixingample_aspect_ratio.num");
|
||||
video_st->sample_aspect_ratio.num = input_st->codec->sample_aspect_ratio.num;
|
||||
}
|
||||
if ( video_st->codec->codec_id != input_st->codec->codec_id ) {
|
||||
Warning("Fixing video_st->codec->codec_id");
|
||||
video_st->codec->codec_id = input_st->codec->codec_id;
|
||||
}
|
||||
if ( ! video_st->codec->time_base.num ) {
|
||||
Warning("video_st->codec->time_base.num is not set%d/%d. Fixing by setting it to 1", video_st->codec->time_base.num, video_st->codec->time_base.den);
|
||||
Warning("video_st->codec->time_base.num is not set%d/%d. Fixing by setting it to 1", video_st->time_base.num, video_st->time_base.den);
|
||||
video_st->codec->time_base.num = video_st->time_base.num;
|
||||
video_st->codec->time_base.den = video_st->time_base.den;
|
||||
}
|
||||
|
||||
video_st->codec->codec_tag = 0;
|
||||
if (oc->oformat->flags & AVFMT_GLOBALHEADER) {
|
||||
video_st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
||||
|
||||
Reference in New Issue
Block a user