diff --git a/scripts/zmfilter.pl.in b/scripts/zmfilter.pl.in index 6540413b7..6527742c8 100644 --- a/scripts/zmfilter.pl.in +++ b/scripts/zmfilter.pl.in @@ -448,10 +448,10 @@ sub generateImage { } elsif ( -r $capture_image_path ) { $image_path = $capture_image_path; } elsif ( -r $video_path ) { - my $command ="ffmpeg -ss $$frame{Delta} -i '$video_path' -frames:v 1 '$capture_image_path'"; + my $command ="ffmpeg -nostdin -ss $$frame{Delta} -i '$video_path' -frames:v 1 '$capture_image_path'"; #$command = "ffmpeg -y -v 0 -i $video_path -vf 'select=gte(n\\,$$frame{FrameId}),setpts=PTS-STARTPTS' -vframes 1 -f image2 $capture_image_path"; my $output = qx($command); - chomp( $output ); + chomp($output); my $status = $? >> 8; if ( $status || logDebugging() ) { Debug("Output: $output"); diff --git a/src/zm_event.cpp b/src/zm_event.cpp index 108aed5c6..dba7d1c52 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -543,6 +543,8 @@ void Event::AddFrame(Image *image, struct timeval timestamp, int score, Image *a bool write_to_db = false; if ( monitor->GetOptSaveJPEGs() & 1 ) { + if ( frames == 1 ) + write_to_db = true; // web ui might show this as thumbnail, so db needs to know about it. static char event_file[PATH_MAX]; snprintf(event_file, sizeof(event_file), staticConfig.capture_file_format, path, frames); Debug(1, "Writing capture frame %d to %s", frames, event_file); @@ -574,7 +576,7 @@ void Event::AddFrame(Image *image, struct timeval timestamp, int score, Image *a if ( score < 0 ) score = 0; - bool db_frame = ( frame_type != BULK ) || (!frames) || ((frames%config.bulk_frame_interval)==0) ; + bool db_frame = ( frame_type != BULK ) || (frames==1) || ((frames%config.bulk_frame_interval)==0) ; if ( db_frame ) { static char sql[ZM_SQL_MED_BUFSIZ];