wtf format is it in to start with that you have to convert it? you said you have dahuas, they direct save to h.265 or h.264I sure don't.
I just keep a 14 day backlog of video on my NFS server that's purged by a cron job. If I need anything in that window, I can just zip into the directory (it's organized by date and hour of the day), get what I need, ffmpeg it into MP4, and go about my business.