A method for forming a video stream based on images of a scene captured by a camera, the method comprising: encoding, by an encoder, image frames based on images captured by the camera, forming an encoded portion of the video stream; determining a length of motion for a sample image frame in an adjustment portion (P A) of the encoded portion as the longest motion vector length that at least a predetermined number of blocks have been encoded with, wherein the predetermined number of blocks corresponds to 10 % of the blocks; setting a motion length threshold to be the longest length of motion for a block of pixels that can be detected within a motion vector search range of the encoder; comparing the determined length of motion with the set motion length threshold; upon the determined length of motion being above the set motion length threshold, decreasing the chosen temporal frame distance of the adjustment portion by encoding N≥1 additional image frame or image frames based on one or more additional images captured by the camera, wherein the one or more additional image frames are located in between successive image frames (10, 20) of the adjustment portion, wherein the one or more additional frames can be used as reference frame in inter-coding of later encoded frames, and wherein the one or more additional image frames are associated with a non-display marker indicating that the one or more additional image frames are not to be displayed by a receiver of the video stream, whereby the likelihood that pixels blocks may be inter-coded is increased while a display frame rate at the receiver is maintained; and upon the determined length of motion being below the set motion length threshold, increasing the chosen temporal frame distance of the adjustment portion, by removing an encoded image frame of the video stream, or leaving the temporal frame distance unaltered. encoding, by an encoder, image frames based on images captured by the camera, forming an encoded portion of the video stream; determining a length of motion for a sample image frame in an adjustment portion (P A) of the encoded portion as the longest motion vector length that at least a predetermined number of blocks have been encoded with, wherein the predetermined number of blocks corresponds to 10 % of the blocks; setting a motion length threshold to be the longest length of motion for a block of pixels that can be detected within a motion vector search range of the encoder; comparing the determined length of motion with the set motion length threshold; upon the determined length of motion being above the set motion length threshold, decreasing the chosen temporal frame distance of the adjustment portion by encoding N≥1 additional image frame or image frames based on one or more additional images captured by the camera, wherein the one or more additional image frames are located in between successive image frames (10, 20) of the adjustment portion, wherein the one or more additional frames can be used as reference frame in inter-coding of later encoded frames, and wherein the one or more additional image frames are associated with a non-display marker indicating that the one or more additional image frames are not to be displayed by a receiver of the video stream, whereby the likelihood that pixels blocks may be inter-coded is increased while a display frame rate at the receiver is maintained; and upon the determined length of motion being below the set motion length threshold, increasing the chosen temporal frame distance of the adjustment portion, by removing an encoded image frame of the video stream, or leaving the temporal frame distance unaltered.