Deepstream sample apps output to file

Hardware Platform: GPU (Tesla T4)
DeepStream Version: 5.0
TensorRT Version: 7.0.0.11
NVIDIA GPU Driver Version: 440.33.01
Cuda Version: 10.2
Cudnn Version: 7.6.5
Ubuntu Version: 18.04

Hello, I am trying to save the outputs (detected cars, make, type and color) from the deepstream-5.0/sources/apps/sample_apps/deepstream-test2 app as .mp4 or h264 but I don’t really know how because I find hard to understand that C code. Can someone guide me on the changes I have to make?

Thanks

Hi
Can you refer to code sources/apps/apps-common/src/deepstream_sink_bin.c::create_encode_file_bin
or for a quick incorporation, you may refer to this,