Driveway Cam

bash script to convert bvr files

to Mp4

I was looking for a method to convert .bvr files to mp4 without using up my Blue Iris camera servers processor. Currently I’m running an 4th gen i5 processor.  So it is not a workhorse compared to some other machines on my network. 

Note: This is a work in progress. 

If there is a better way, shoot me an email: james @ strickstuff [dot] com

 

 

#!/bin/bash
#
# Script to convert .bvr files to mp4 using ffmpeg
# NOTE: this is still a work in progress
# I am still working on the ffmpeg switches
# to make this work better. But it works fine
# as is.
#
#
# First pass & remove files as you convert them. 
##!/bin/bash
for vid in *.bvr; 
do ffmpeg -probesize 42M -framerate 30 -i $vid -vcodec copy -an -bsf:v h264_mp4toannexb "${vid%.*}.h264" && rm $vid;
done
#
# Second pass, 
#
for h264 in *.h264;
do ffmpeg -i $h264 "${h264%.*}.mp4" && rm $h264;
done
#
# This just merges all mp4s in the directory into a single file
# remove (or comment out) if not needed.
#
[ -e list.txt ] && rm list.txt
for f in *.mp4
do
echo "file $f" >> list.txt
done
ffmpeg -f concat -i list.txt -c copy joined-out.mp4 && rm list.txt