If DefaultVideo is set, use the passthrough mp4 instead of generating and mp4 from jpegs

This commit is contained in:
Isaac Connor 2018-09-11 08:49:42 -04:00
parent c70fb2f195
commit b545528bb0
1 changed files with 9 additions and 5 deletions

View File

@ -713,13 +713,17 @@ sub substituteTags {
} }
} # end if $first_alarm_frame } # end if $first_alarm_frame
if ( $attachments_ref && $Config{ZM_OPT_FFMPEG} ) { if ( $attachments_ref ) {
if ( $text =~ s/%EV%//g ) { if ( $text =~ s/%EV%//g ) {
my ( $format, $path ) = generateVideo($filter, $Event); if ( $$Event{DefaultVideo} ) {
if ( !$format ) { push @$attachments_ref, { type=>'video/mp4', path=>join('/',$Event->Path(), $Event->DefaultVideo()) };
return undef; } 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 ) { if ( $text =~ s/%EVM%//g ) {
my ( $format, $path ) = generateVideo($filter, $Event, 1); my ( $format, $path ) = generateVideo($filter, $Event, 1);