Can duplicate frames from an h264 stream be dropped without encoding?
Almost all encoded frames depend on the surrounding frames, so it's virtually impossible to delete anything from the encoded output without negatively affecting the video. Short answer: no, you can't do that.

One consolation is that true duplicate frames cost almost nothing in terms of file size. They can effectively be represented by a short sequence that means "repeat previous".