A method for intra refresh encoding of a sequence of image frames of a video stream, the method comprising: determining a plurality of distribution functions, each defining a probability of intra refresh (p) of a block of pixels of an image frame in the video stream with respect to a number of frames (fc) that have passed since a spatially corresponding block of pixels of a previous image frame in the video stream was intra refreshed, wherein a first distribution function of the plurality of distribution functions corresponds to a cumulative distribution function having a convex shape, wherein a second distribution function of the plurality of distribution functions corresponds to a cumulative distribution function having a concave shape, receiving an image frame comprised in the video stream, for each block of pixels in the received image frame, determining a frame count (fc) defining how many image frames that have passed in the video stream since a spatially corresponding block of pixels of a previous image in the video stream was intra refreshed, determining whether the block of pixels spatially corresponds to a region of interest, ROI, of the image frame or not, upon determining that the block of pixels spatially corresponds to the ROI, applying (S10a) the first distribution function in respect to the determined frame count to determine whether the block of pixels should be intra refreshed, upon determining that the block of pixels does not spatially correspond to the ROI, applying (S10b) the second distribution function in respect to the determined frame count to determine whether the block of pixels should be intra refreshed, intra encoding the block of pixels of the received image frame if the block of pixels is determined to be intra refreshed. determining a plurality of distribution functions, each defining a probability of intra refresh (p) of a block of pixels of an image frame in the video stream with respect to a number of frames (fc) that have passed since a spatially corresponding block of pixels of a previous image frame in the video stream was intra refreshed, wherein a first distribution function of the plurality of distribution functions corresponds to a cumulative distribution function having a convex shape, wherein a second distribution function of the plurality of distribution functions corresponds to a cumulative distribution function having a concave shape, receiving an image frame comprised in the video stream, for each block of pixels in the received image frame, determining a frame count (fc) defining how many image frames that have passed in the video stream since a spatially corresponding block of pixels of a previous image in the video stream was intra refreshed, determining whether the block of pixels spatially corresponds to a region of interest, ROI, of the image frame or not, upon determining that the block of pixels spatially corresponds to the ROI, applying (S10a) the first distribution function in respect to the determined frame count to determine whether the block of pixels should be intra refreshed, upon determining that the block of pixels does not spatially correspond to the ROI, applying (S10b) the second distribution function in respect to the determined frame count to determine whether the block of pixels should be intra refreshed, determining a frame count (fc) defining how many image frames that have passed in the video stream since a spatially corresponding block of pixels of a previous image in the video stream was intra refreshed, determining whether the block of pixels spatially corresponds to a region of interest, ROI, of the image frame or not, upon determining that the block of pixels spatially corresponds to the ROI, applying (S10a) the first distribution function in respect to the determined frame count to determine whether the block of pixels should be intra refreshed, upon determining that the block of pixels does not spatially correspond to the ROI, applying (S10b) the second distribution function in respect to the determined frame count to determine whether the block of pixels should be intra refreshed, intra encoding the block of pixels of the received image frame if the block of pixels is determined to be intra refreshed.