Yes you right i could have managed it inside of NVR software but it stores everything in a single folder and it takes too much time to load filtered request in frontend. due to which i decided to create this script which triggered by my storage server when it syncs with the NVR software