Multiple Use-case in one camera with Smart recording

please refer to this FAQ for how to do smart record in Python.
you can use nvdspreprocess to add a ROI, then deepstream will infer only on ROI. please refer to this sample. when there is a vehicle object, you can call interface to start record.