Currently unable to test using JP 5.1.2.
Recompiled the gst-nvinfer element from the Deepstream SDK and added some logging to show the NvBufSurfTransformParams values being passed to NvBufSurfTransform. Below are logged values for error code -2, error code -3 and some values that succeed without error. Included are the calculated scaling factors using:
width_scaling = src_rect.width / dst_rect.width
height_scaling = src_rect.height/ dst_rect.height
Error code -2
src_rect: { 214, left: 714, width: 78, height: 42 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: .60, height_scaling: .65
Error code -3
src_rect: { 174, left: 362, width: 362, height: 66 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 2.82, height_scaling: 1.03
src_rect: { 178, left: 368, width: 368, height: 84 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 2.87, height_scaling: 1.31
src_rect: { 306, left: 364, width: 364, height: 76 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 2.84, height_scaling: 1.18
src_rect: { 228, left: 366, width: 366, height: 166 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 2.85, height_scaling: 2.59
src_rect: { 174, left: 364, width: 364, height: 86 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 2.84, height_scaling: 1.34
src_rect: { 176, left: 368, width: 368, height: 84 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 2.87, height_scaling: 1.31
No Error
src_rect: { 274, left: 440, width: 102, height: 52 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: .79, height_scaling: .81
src_rect: { 264, left: 440, width: 142, height: 62 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 1.10, height_scaling: .96
src_rect: { 258, left: 444, width: 254, height: 68 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 1.98, height_scaling: 1.06
src_rect: { 38, left: 0, width: 720, height: 316 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.62, height_scaling: 4.93
src_rect: { 300, left: 128, width: 140, height: 74 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 1.09, height_scaling: 1.15
src_rect: { 310, left: 680, width: 38, height: 62 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: .29, height_scaling: .96
src_rect: { 34, left: 0, width: 720, height: 326 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.62, height_scaling: 5.09
src_rect: { 40, left: 0, width: 720, height: 318 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.62, height_scaling: 4.96
src_rect: { 32, left: 0, width: 720, height: 328 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.62, height_scaling: 5.12
src_rect: { 222, left: 0, width: 664, height: 164 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.18, height_scaling: 2.56
src_rect: { 28, left: 0, width: 720, height: 336 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.62, height_scaling: 5.25
src_rect: { 220, left: 0, width: 662, height: 164 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.17, height_scaling: 2.56
src_rect: { 28, left: 0, width: 720, height: 336 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.62, height_scaling: 5.25
src_rect: { 220, left: 0, width: 662, height: 164 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.17, height_scaling: 2.56
src_rect: { 22, left: 0, width: 720, height: 342 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.62, height_scaling: 5.34
src_rect: { 38, left: 0, width: 720, height: 322 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.62, height_scaling: 5.03
src_rect: { 32, left: 0, width: 720, height: 332 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.62, height_scaling: 5.18
src_rect: { 32, left: 0, width: 720, height: 330 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.62, height_scaling: 5.15
src_rect: { 32, left: 0, width: 720, height: 330 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.62, height_scaling: 5.15
src_rect: { 290, left: 0, width: 110, height: 82 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: .85, height_scaling: 1.28
src_rect: { 268, left: 0, width: 164, height: 112 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 1.28, height_scaling: 1.75
src_rect: { 266, left: 0, width: 422, height: 114 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 3.29, height_scaling: 1.78
src_rect: { 284, left: 384, width: 212, height: 92 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 1.65, height_scaling: 1.43
src_rect: { 26, left: 0, width: 720, height: 334 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.62, height_scaling: 5.21
src_rect: { 28, left: 0, width: 720, height: 324 }, dst_rect: { 0, left: 0, width: 128, height: 64 }, width_scaling: 5.62, height_scaling: 5.06