From b545528bb0d2151f28527575579a8ae4b04b4dd9 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 11 Sep 2018 08:49:42 -0400 Subject: [PATCH] If DefaultVideo is set, use the passthrough mp4 instead of generating and mp4 from jpegs --- scripts/zmfilter.pl.in | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/zmfilter.pl.in b/scripts/zmfilter.pl.in index cfea3bfe4..0d76cbd97 100644 --- a/scripts/zmfilter.pl.in +++ b/scripts/zmfilter.pl.in @@ -713,13 +713,17 @@ sub substituteTags { } } # end if $first_alarm_frame - if ( $attachments_ref && $Config{ZM_OPT_FFMPEG} ) { + if ( $attachments_ref ) { if ( $text =~ s/%EV%//g ) { - my ( $format, $path ) = generateVideo($filter, $Event); - if ( !$format ) { - return undef; + if ( $$Event{DefaultVideo} ) { + push @$attachments_ref, { type=>'video/mp4', path=>join('/',$Event->Path(), $Event->DefaultVideo()) }; + } elsif ( $Config{ZM_OPT_FFMPEG} ) { + my ( $format, $path ) = generateVideo($filter, $Event); + if ( !$format ) { + return undef; + } + push( @$attachments_ref, { type=>"video/$format", path=>$path } ); } - push( @$attachments_ref, { type=>"video/$format", path=>$path } ); } if ( $text =~ s/%EVM%//g ) { my ( $format, $path ) = generateVideo($filter, $Event, 1);