Video format with dynamic resolution
You can't get "dynamic resolution" because essentially that would mean that some of the time you used a 4K display (for example) to show a 2160P image and some of the time you displayed a 1080P image by pixel doubling - so either way it's 4K but what you could gain (IF there were such a Codec) is an increase in the compression, and that's where you should look.

The h265+ Codec developed by HikVision analyses the image frame by frame and decides what is important and what can be compressed to a greater extent, relying upon prior frames to have the data to 'fix' where the extreme compression was used - it can be decoded with a standard h265 (non plus) decoder.

Here is a quote from their Website: "The average decreased rate between H.264 and H.265 is 47,8%. When applying Hikvision H.265+ the decrease rate increases to an average of 83.7 percent.".

Here's the explanation of this: http://www.hikvision.com/europe/Press-Release-details_71_i14097.html

PDF: http://www.hikvision.com/upload/20161209211521855.pdf

As far as I know it's only available as Hardware in HikVision's cameras, if someone knows where there's an Open Source version of h265+ I'd sure like to know - thanks.