Extracting video from a Cloud Key running Ubiquiti protect

Work in progress

Enable SSH on Cloud Key

Get ubnt_ubvinfo from Cloud Key:

scp ubnt@ ubnt_ubvinfo


FROM ubuntu

RUN apt-get update -y
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y qemu-user gcc-aarch64-linux-gnu ffmpeg git golang build-essential

RUN git clone https://github.com/petergeneric/unifi-protect-remux.git && \
    cd unifi-protect-remux && \
    make && \
    mv remux /usr/local/bin && \
    cd .. && \
    rm -rf unifi-protect-remux

COPY aarch64_ubnt_ubvinfo /usr/local/bin/aarch64_ubnt_ubvinfo
COPY ubnt_ubvinfo /usr/local/bin/ubnt_ubvinfo


Build container:

docker build -t extract-video .

Convert all files in a particular directory:

docker run -ti --rm -v video_directory:/video extract-video bash -c 'remux --with-audio *.ubv'

Sync video from Cloud Key (Do not use -z option as the video is already compressed and the CPU on the Cloud Key is slow! When I used compression the transfer speed went from ~30 MB/sec to 8 MB/sec):

rsync -avP ubnt@cloud-key-ip:/srv/unifi-protect/video/2021/ 2021/