This is a free, open source tool that converts Ubiquiti's proprietary .ubv files into standard .MP4 files with H.264/HEVC video and AAC audio. The conversion is a "remux": no transcoding takes place, the exact same video and audio essence are simply copied into a different, industry standard container; because of this the process is reasonably fast and not CPU intensive even on a low spec ARM machine.
Use the following instructions to get the unifi-protect-remux tool working:
- Go to the github releases page and download the version you need for your machine. If you're not sure, you probably want the
guirelease. Theclireleases are for using at the command-line and for automated use. Download the package that you want for your operating system and CPU architecture. If you want to run on Ubiquiti hardware you'll need to use the linuxaarch64-legacy.tar.gzcli tools file. The Windows GUI installer includes the command-line tools. - If using on ubiquiti hardware, upload via SSH to the cloudkey/nvr/etc. and extract with
tar -xaf cli-*.tar.gz - Otherwise, transfer .ubv files from your NVR to the machine you will be running the remux on. See Source Media: Live Systems below if you're not sure where to find the video files.
- If using command-line tools, run:
./remux *.ubv. If using the GUI, drag the .ubc files in - By default, both audio and video will be extracted. If you do not want audio, consult Settings (or --help text) for more information.
I've been in the video software field for over 20 years, and have assisted with footage recovery and analysis (including production of custom review and reporting interfaces) for a case that became a high-profile UK Public Inquiry, and involved hundreds of thousands of hours of highly sensitive footage, so I understand the complex environment my users often work within.
While a technical user with UNIX experience should be able to use my tools to extract footage even from corrupted files with relative ease by themselves, if you don't have a suitable person available or simply want somebody with experience for complex cases you can hire me to assist privately with footage extraction, analysis, or report writing.
If you think you need paid assistance, please reach out first by creating a GitHub issue to arrange a private discussion (N.B. do not include any confidential information in the Issue text).
This tool is designed to work on _0_rotating_ .ubv files. You can get a list of these files with the following on your Unifi Protect system:
find /srv/unifi-protect/video -type f -name "*_0_rotating_*.ubv"
or
find /volume1/.srv/unifi-protect/video -type f -name "*_0_rotating_*.ubv"
If your Ubiquiti NVR has been damaged, you should be able to mount it on any Linux system (or other OS supporting ext4) using a USB to SATA (or USB to NVMe) adapter. I highly recommend mounting as read-only.
If your footage is sensitive or likely to involve a court case, I highly recommend involving a qualified data forensics company to extract the files for you since they understand how to handle devices in a safe way while preserving and documenting chain of custody, and be able to attest to the integrity of any files they recover. Retain the ubv files they retrieve from the disks: these are the originals, my remux tool can always derive standard MP4s from them, but you cannot produce the original from an MP4.
Run ./remux --help for advanced use. This will produce output like so:
Usage of remux:
--with-audio
If true, extract audio (default true)
--with-video
If true, extract video (default true)
--mp4
If true, will create an MP4 as output (default true)
Note: MP4 output currently requires `--with-video=true`; audio-only MP4 is not supported
--fast-start
If true, generated MP4 files will have faststart enabled for better streaming. Increases remux IO cost (default false)
--output-folder string
The path to output remuxed files to. "SRC-FOLDER" to put alongside .ubv files (default "./")
--version
Display version and quit
--force-rate int
If non-zero, forces CFR at the defined rate
As part of my reverse engineering work, I am documenting the UBV format.
See COMPILING.md for more detail
I provide a Windows build of this tool; I have not been able to test this in a Windows environment, but it should work. Please reach out with feedback if you do use it on Windows.
