SD Card: Time Lapse when there's no activity, full rate when motion detected

I would like to see a recording option where the camera would be configured to store one frame per second when no activity is detected, then jump to 30 FPS upon detecting motion. This does several things. It does not waste space on the SD card with lots of inactivity, but still gives you a full time-line of recorded history should there be activity in the field of view that was not detected by the camera. It also reduces the amount of time required to playback recorded history. But when motion is detected, the camera would store detailed activity.