diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 1fa8b89dd..e4b9bd755 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -1413,13 +1413,9 @@ bool Monitor::Analyse() { if ( Event::PreAlarmCount() >= (alarm_frame_count-1) ) { Info( "%s: %03d - Gone into alarm state", name, analysis_image_count ); shared_data->state = state = ALARM; - if ( (function != MOCORD && state != ALERT) ) { -if ( event ) { -Error("Already ahve evnet!"); -} else { + if ( ! event ) { event = new Event( this, *timestamp, cause, noteSetMap ); shared_data->last_event_id = event->Id(); -} } } else if ( state != PREALARM ) { Info( "%s: %03d - Gone into prealarm state", name, analysis_image_count ); @@ -3259,7 +3255,7 @@ void Monitor::get_ref_image() { ( shared_data->last_write_time == 0 ) && ! zm_terminate ) { - Warning( "Waiting for capture daemon" ); + Warning( "Waiting for capture daemon lwi(%d) lwt(%d)", shared_data->last_write_index, shared_data->last_write_time ); usleep( 50000 ); } int last_write_index = shared_data->last_write_index ; diff --git a/src/zm_videostore.cpp b/src/zm_videostore.cpp index d9c2f69bf..5f1fe0425 100644 --- a/src/zm_videostore.cpp +++ b/src/zm_videostore.cpp @@ -348,7 +348,6 @@ Debug(2,"Using mjpeg"); zm_dump_codecpar(video_out_stream->codecpar); #else avcodec_copy_context(video_out_stream->codec, video_out_ctx); - Debug(2, "%dx%d", video_out_stream->codec->width, video_out_stream->codec->height ); zm_dump_codec(video_out_stream->codec); #endif @@ -563,10 +562,9 @@ VideoStore::~VideoStore() { break; } #endif - int keyframe = pkt.flags & AV_PKT_FLAG_KEY; - Debug(3, "dts:%I64d, pts:%I64d, keyframe:%d", pkt.dts, pkt.pts, keyframe ); + dumpPacket(&pkt); //pkt.dts = video_next_dts; - pkt.pts = pkt.dts; + //pkt.pts = pkt.dts; //pkt.duration = video_last_duration; write_video_packet(pkt); zm_av_packet_unref(&pkt); diff --git a/src/zmc.cpp b/src/zmc.cpp index c8274ef2e..588433f4e 100644 --- a/src/zmc.cpp +++ b/src/zmc.cpp @@ -254,7 +254,7 @@ int main(int argc, char *argv[]) { last_capture_times[i].tv_sec = last_capture_times[i].tv_usec = 0; capture_delays[i] = monitors[i]->GetCaptureDelay(); alarm_capture_delays[i] = monitors[i]->GetAlarmCaptureDelay(); - Debug(2, "capture delay(%u) alarm delay(%u)", capture_delays[i], alarm_capture_delays[i] ); + Debug(2, "capture delay(%u mSecs 1000/capture_fps) alarm delay(%u)", capture_delays[i], alarm_capture_delays[i] ); Monitor::Function function = monitors[0]->GetFunction(); if ( function == Monitor::MODECT || function == Monitor::MOCORD || function == Monitor::RECORD) { @@ -278,6 +278,7 @@ int main(int argc, char *argv[]) { gettimeofday(&now, NULL); for ( int j = 0; j < n_monitors; j++ ) { if ( last_capture_times[j].tv_sec ) { + // We pretty much know this is positive. DELTA_TIMEVAL(delta_time, now, last_capture_times[j], DT_PREC_3); // capture_delay is the amount of time we should sleep to achieve the desired framerate. if ( monitors[i]->GetState() == Monitor::ALARM )