Yffud wrote: ↑Wed Jul 19, 2023 5:38 pm
I guess the attached file got deleted? Anyone have it to reupload
(File is attached below.)
General Info
BVR Converter converts Blue Iris .BVR files to .MP4 fideo files while preserving their original timestamp. It also typically reduces their size, in some cases dramatically. Converting to the MP4 format allows the files to be provided to others to view without having to install Blue Iris. It can process an entire directory, file by file, and optionally move the files to another directory for storage (such as a NAS, an external hard drive, thumb drive, etc).
This powershell script converts .BVR files to .MP4 files, preserving the original file's timestamp. Options include keeping the original size or scaling to 1/2, 1/3, or 1/4 of the original video size/resolution.
The only external component required is the free utility "ffmpeg", which may be found here:
https://www.ffmpeg.org/
and downloaded from here:
https://www.ffmpeg.org/download.html
It's recommended that you get the pre-compiled binary instead of the source code. Versions of ffmpeg are available for Windows, Linux, and Mac OS. The powershell script is intended to be run under Windows 8 or greater.
Install ffmpeg in a location that's in your computer's PATH variable so it can be run from anywhere, or install it somewhere else and add its location to your PATH variable. If you opt not to do either of these then you'll need to modify the bvr_converter.ps1 file so the full path to ffmpeg is referenced in the script.
-------------
Configuration
-------------
The "
source" directory is where the .BVR files to be converted are found. DO NOT use a trailing slash (\).
For example: "C:\BlueIris\Stored"
The "
target" directory is where the converted .MP4 files will stored. DO NOT use a trailing slash (\).
For example: "C:\backup_video"
You can set this to a different directory, a NAS, attached storage, or other remote location if you want.
The "
pause" time is an optional time to wait between each file conversion. This may be useful to avoid overloading the PC that's doing the converting. The "pause" time value is set in seconds, and typically 1 or 2 seconds is plenty, but adjust as needed.
For example: $pause_time = 2
Command line settings for ffmpeg
There are several sample command line parameters for conversion. Don't change these if you don't know what you're doing.
Uncomment ONE and only ONE of the parameter lines. If you uncomment more than one, the last uncommented one will be used.
For the most reduction in file size, use one of the settings that scales the image.
--------------
If you find bugs or have enhancements to this script that you'd like to have added, please feel free to contact the user "Thixotropic" on the Blue Iris forum:
https://blueirissoftware.com/forum/index.php
-----------------------------------------------------------------
README.TXT
These tests were run with an sinput file (input.bvr) file size of 6703K (6.7M) and with ffmpeg using the x264 codec (included).
The factors that influence the output file size the most are the codec, the output size (scaled or unscaled), and the CRF (Constant Rate Factor) parameter. In general, a higher CRF produces a smaller file. Note that a lower CRF *may* produce a larger file under some circumstances. For x264, sane values are between 18 and 28.
CRF can be used in a constrained/capped mode to prevent bitrate spikes.
0 <---- 18 <---- 23 ----> 28 ----> 51
(Lossless, better, worse, worst)
More information on CRF can be found here:
https://slhck.info/video/2017/02/24/crf-guide.html
Standard compression with CRF of 30
ffmpeg -i input.bvr -vcodec libx264 -crf 30 output.mp4
Converted size: 4626K
Standard compression with CRF of 25
ffmpeg -i input.bvr -vcodec libx264 -crf 25 output.mp4
Converted size: 8037K
Compress and reduce size to 1/2, CRF of 30
ffmpeg -i input.bvr -vcodec libx264 -crf 30 -vf "scale=iw/2:ih/2" output.mp4
Converted size: 854K
Compress and reduce size to 1/2, CRF of 25
ffmpeg -i input.bvr -vcodec libx264 -crf 20 -vf "scale=iw/2:ih/2" output.mp4
Converted size: 3524K
ffmpeg -n -loglevel error -i input.bvr -vcodec libx264 -crf 28 -preset faster -tune film output.mp4
Converted size: 5379K
ffmpeg -n -loglevel error -i input.bvr -vcodec libx264 -crf 28 -preset faster -tune film -vf "scale=iw/2:ih/2" output.mp4
Converted size: 979K