Also if run it from cli. Like this
/usr/bin/perl -wT /usr/bin/zmvideo.pl -e $ffmpeg_event -f avi -r 1.00 -s 1.00 -o
But when it runs from Filters - "Create video for all matches video" checked with "Run filter in background" checked.
50%/50% I have NOT full video file with ffmpeg.log with various errors.
Sach as:
Code: Select all
Enter command: <target>|all <time>|-1 <command>[ <argument>]
Code: Select all
key function
? show this help
+ increase verbosity
- decrease verbosity
c Send command to first matching filter supporting it
C Send/Que command to all matching filters
D cycle through available debug modes
h dump packets/hex press to cycle through the 3 states
q quit
s Show QP histogram
ZoneMinder = 1.30.4
FFMPEG_OUTPUT_OPTIONS = -loglevel panic -c:v libx264 -preset ultrafast
FFMPEG_OPEN_TIMEOUT = 3600 (didnt find this options in code, but set 3600 anyway)
What it is wrong with this?
my script which resolve some problems sometimes and drops jpegs.
Code: Select all
#!/bin/sh -x
path_event="$1"
wait_count=0
wait_limit=300
file_cleanup_log="$path_event/clenup.log"
file_ffmpeg_log="$path_event/ffmpeg.log"
echo `date` start >> $file_cleanup_log
ffmpeg_bin="/usr/bin/ffmpeg"
ffmpeg_opt="-y -r 8 -i $path_event/%05d-capture.jpg -s 1280x720 -loglevel panic -threads 1 -c:v libx264"
ffmpeg_event=$(find $path_event -type f -name ".*" | head -1)
ffmpeg_event=${ffmpeg_event#*.}
ffmpeg_video="Event-$ffmpeg_event-r1-s1.avi"
exec_check="ps ax| grep -v grep | grep $ffmpeg_video"
cd $path_event
while [ -n "$(eval $exec_check)" -a $wait_count -lt $wait_limit ]; do
wait_count=$((wait_count+1))
sleep 1
done
if [ ! -r $path_event/$ffmpeg_video -o -s $file_ffmpeg_log ]; then
size_video_old=$(wc -c $path_event/$ffmpeg_video | awk '{print $1}')
mv -f $path_event/$ffmpeg_video $path_event/$ffmpeg_video-old
/usr/bin/perl -wT /usr/bin/zmvideo.pl -e $ffmpeg_event -f avi -r 1.00 -s 1.00 -o
echo "[ done re-encode ]" >> $file_cleanup_log
else
echo "[ no need re-encode ]" >> $file_cleanup_log
fi
size_video=$(wc -c $path_event/$ffmpeg_video | awk '{print $1}')
size_total=$(wc -c $path_event/*.jpg | awk '/total/{print $1}')
size_coof=$(echo $size_total / $size_video | bc)
echo [ size_video=$size_video / size_total=$size_total = coof $size_coof ] >> $file_cleanup_log
[ -n "$size_video_old" ] && if [ $size_video_old -eq $size_video ]; then
echo "[ old and new video have SAME size ]" >> $file_cleanup_log
rm -f $path_event/$ffmpeg_video-old
else
if [ $size_video_old -lt $size_video ]; then
echo "[ new video has MORE size old=$size_video_old vs new=$size_video ]" >> $file_cleanup_log
rm -f $path_event/$ffmpeg_video-old
else
echo "[ new video has LESS size old=$size_video_old vs new=$size_video ]" >> $file_cleanup_log
echo "[ so getting back OLD video ]" >> $file_cleanup_log
mv -f $path_event/$ffmpeg_video-old $path_event/$ffmpeg_video
fi
fi
[ -s $path_event/$ffmpeg_video ] && rm -f $path_event/*.jpg
echo `date` end >> $file_cleanup_log