The nvstreammux “width” and “height” can not be changed dynamically during playback.
The caps can not be changed dynamically either.
The only way to change the display resolution is to set window size with x11 interfaces. There is sample in deepstream-test5 code.