I had installed the deepstream-5.0.0 deb package. And compiled the source code form /opt/nvidia/deepstream/deepstream5.0/sources/apps/sample-apps/deepstream-image-meta-test folder
As it was throwing a permission denied error, I compiled with sudo.
While running the app, I had to run as super user to run it successfully
You had to run as super user if you run from /opt/nvidia/deepstream/deepstream5.0/sources/apps/sample-apps/deepstream-image-meta-test
since the sample will write files to this location. you need super permission to write files to location
where you do not have permission using normal user.