Save output to video using filesink

I think the sample codes in error {Internal data stream error} while running deepstream-test1 has already implemented what you want.

So what is your problem with OSD enabled?