An imaging device includes the following. A temporary storage cyclically stores images for a predetermined duration or number imaged in succession. A record controller records temporarily stored images for a first duration or a first number of images before detection of the capturing instruction, and records images for a second duration or a second number of images after detection of the capturing instruction. A setter preliminarily determines a total duration of the first duration and the second duration or a total number of the first number and the second number and determines a ratio of the first duration to the second duration or a ratio of the first number to the second number in response to one type of operation of an operational input unit, while retaining the preliminarily determined total duration or the preliminarily determined total number.