Merge branch 'storageareas' of github.com:ConnorTechnology/ZoneMinder into storageareas
This commit is contained in:
commit
da16b60ac9
|
@ -144,7 +144,7 @@ MAIN: while( $loop ) {
|
|||
# After a long sleep, we may need to reconnect to the db
|
||||
while ( ! ( $dbh and $dbh->ping() ) ) {
|
||||
$dbh = zmDbConnect();
|
||||
|
||||
if ( ! $dbh ) {
|
||||
if ( $continuous ) {
|
||||
Error('Unable to connect to database');
|
||||
# if we are running continuously, then just skip to the next
|
||||
|
@ -154,6 +154,7 @@ MAIN: while( $loop ) {
|
|||
} else {
|
||||
Fatal('Unable to connect to database');
|
||||
} # end if
|
||||
} # end if
|
||||
} # end while can't connect to the db
|
||||
|
||||
my %Monitors;
|
||||
|
|
|
@ -837,11 +837,9 @@ else if ( packet.pts && video_last_pts > packet.pts ) {
|
|||
Debug( 3, "Some other stream index %d", packet.stream_index );
|
||||
#endif
|
||||
}
|
||||
//if ( videoStore ) {
|
||||
|
||||
// the packet contents are ref counted... when queuing, we allocate another packet and reference it with that one, so we should always need to unref here, which should not affect the queued version.
|
||||
zm_av_packet_unref( &packet );
|
||||
//}
|
||||
} // end while ! frameComplete
|
||||
return (frameCount);
|
||||
} // end FfmpegCamera::CaptureAndRecord
|
||||
|
|
|
@ -30,7 +30,7 @@ zm_packetqueue::zm_packetqueue(){
|
|||
}
|
||||
|
||||
zm_packetqueue::~zm_packetqueue() {
|
||||
|
||||
clearQueue();
|
||||
}
|
||||
|
||||
bool zm_packetqueue::queuePacket( ZMPacket* zm_packet ) {
|
||||
|
|
|
@ -189,6 +189,8 @@ VideoStore::VideoStore(const char *filename_in, const char *format_in,
|
|||
audio_output_codec = NULL;
|
||||
audio_input_context = NULL;
|
||||
audio_output_stream = NULL;
|
||||
input_frame = NULL;
|
||||
output_frame = NULL;
|
||||
#ifdef HAVE_LIBAVRESAMPLE
|
||||
resample_context = NULL;
|
||||
#endif
|
||||
|
@ -391,6 +393,15 @@ Debug(2, "writing flushed packet pts(%d) dts(%d) duration(%d)", pkt.pts, pkt.dts
|
|||
|
||||
/* free the stream */
|
||||
avformat_free_context(oc);
|
||||
|
||||
if ( input_frame ) {
|
||||
av_frame_free( &input_frame );
|
||||
input_frame = NULL;
|
||||
}
|
||||
if ( output_frame ) {
|
||||
av_frame_free( &output_frame );
|
||||
output_frame = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool VideoStore::setup_resampler() {
|
||||
|
|
|
@ -68,7 +68,7 @@ void Zone::Setup(
|
|||
overload_frames = p_overload_frames;
|
||||
extend_alarm_frames = p_extend_alarm_frames;
|
||||
|
||||
Debug( 1, "Initialised zone %d/%s - %d - %dx%d - Rgb:%06x, CM:%d, MnAT:%d, MxAT:%d, MnAP:%d, MxAP:%d, FB:%dx%d, MnFP:%d, MxFP:%d, MnBS:%d, MxBS:%d, MnB:%d, MxB:%d, OF: %d, AF: %d", id, label, type, polygon.Width(), polygon.Height(), alarm_rgb, check_method, min_pixel_threshold, max_pixel_threshold, min_alarm_pixels, max_alarm_pixels, filter_box.X(), filter_box.Y(), min_filter_pixels, max_filter_pixels, min_blob_pixels, max_blob_pixels, min_blobs, max_blobs, overload_frames, extend_alarm_frames );
|
||||
//Debug( 1, "Initialised zone %d/%s - %d - %dx%d - Rgb:%06x, CM:%d, MnAT:%d, MxAT:%d, MnAP:%d, MxAP:%d, FB:%dx%d, MnFP:%d, MxFP:%d, MnBS:%d, MxBS:%d, MnB:%d, MxB:%d, OF: %d, AF: %d", id, label, type, polygon.Width(), polygon.Height(), alarm_rgb, check_method, min_pixel_threshold, max_pixel_threshold, min_alarm_pixels, max_alarm_pixels, filter_box.X(), filter_box.Y(), min_filter_pixels, max_filter_pixels, min_blob_pixels, max_blob_pixels, min_blobs, max_blobs, overload_frames, extend_alarm_frames );
|
||||
|
||||
alarmed = false;
|
||||
was_alarmed = false;
|
||||
|
|
|
@ -217,6 +217,8 @@ class Event {
|
|||
$captImage = 'snapshot.jpg';
|
||||
Debug("Frame not specified, using snapshot");
|
||||
} else {
|
||||
$captImage = sprintf( '%0'.ZM_EVENT_IMAGE_DIGITS.'d-analyze.jpg', $frame['FrameId'] );
|
||||
if ( ! file_exists( $eventPath.'/'.$captImage ) ) {
|
||||
$captImage = sprintf( '%0'.ZM_EVENT_IMAGE_DIGITS.'d-capture.jpg', $frame['FrameId'] );
|
||||
if ( ! file_exists( $eventPath.'/'.$captImage ) ) {
|
||||
# Generate the frame JPG
|
||||
|
@ -238,7 +240,8 @@ class Event {
|
|||
} else {
|
||||
Error("Can't create frame images from video becuase there is no video file for this event (".$Event->DefaultVideo() );
|
||||
}
|
||||
}
|
||||
} // end if capture file exists
|
||||
} // end if analyze file exists
|
||||
}
|
||||
|
||||
$captPath = $eventPath.'/'.$captImage;
|
||||
|
|
|
@ -207,7 +207,7 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
|
|||
if ( $monitor['Type'] == 'Local' ) {
|
||||
$source = $monitor['Device'].' ('.$monitor['Channel'].')';
|
||||
} elseif ( $monitor['Type'] == 'Remote' ) {
|
||||
$source = $monitor['Host'];
|
||||
$source = preg_replace( '/^.*@/', '', $monitor['Host'] );
|
||||
} elseif ( $monitor['Type'] == 'File' || $monitor['Type'] == 'cURL' ) {
|
||||
$source = preg_replace( '/^.*\//', '', $monitor['Path'] );
|
||||
} elseif ( $monitor['Type'] == 'Ffmpeg' || $monitor['Type'] == 'Libvlc' ) {
|
||||
|
|
|
@ -193,7 +193,9 @@ foreach ( $events as $event ) {
|
|||
<tr>
|
||||
<td class="colId"><?php echo makePopupLink( '?view=event&eid='.$event->Id().$filterQuery.$sortQuery.'&page=1', 'zmEvent', array( 'event', reScale( $event->Width(), $scale ), reScale( $event->Height(), $scale ) ), $event->Id().($event->Archived()?'*':'') ) ?></td>
|
||||
<td class="colName"><?php echo makePopupLink( '?view=event&eid='.$event->Id().$filterQuery.$sortQuery.'&page=1', 'zmEvent', array( 'event', reScale( $event->Width(), $event->DefaultScale(), ZM_WEB_DEFAULT_SCALE ), reScale( $event->Height(), $event->DefaultScale(), ZM_WEB_DEFAULT_SCALE ) ), validHtmlStr($event->Name()).($event->Archived()?'*':'' ) ) ?></td>
|
||||
<td class="colMonitorName"><?php echo $event->MonitorName() ?></td>
|
||||
<td class="colMonitorName"><?php echo
|
||||
makePopupLink( '?view=monitor&mid='.$event->MonitorId(), 'zmMonitor'.$event->Monitorid(), 'monitor', $event->MonitorName(), canEdit( 'Monitors' ) )
|
||||
?></td>
|
||||
<td class="colCause"><?php echo makePopupLink( '?view=eventdetail&eid='.$event->Id(), 'zmEventDetail', 'eventdetail', validHtmlStr($event->Cause()), canEdit( 'Events' ), 'title="'.htmlspecialchars($event->Notes()).'"' ) ?></td>
|
||||
<td class="colTime"><?php echo strftime( STRF_FMT_DATETIME_SHORTER, strtotime($event->StartTime()) ) ?></td>
|
||||
<td class="colDuration"><?php echo gmdate("H:i:s", $event->Length() ) ?></td>
|
||||
|
|
Loading…
Reference in New Issue