A method of controlling bitrate in video coding of a sequence of images, including a series of Inter frames separated by Intra frames, the method comprising: measuring frame complexity (44, 252) in the sequence of images; for each Inter frame, (i) calculating a target buffer level (47, 104) of a video buffering device in relation to a distance between the Inter frame and a next Intra frame; (ii) calculating a target frame size (48, 106, 250, 256) in relation to the measured frame complexity, a current buffer level of the video buffering device and the calculated target buffer level as a function B P t = R AVG F β t min γα t, MAD t 1 + MAD avg t - 1 with α t = 1 - W t W high 2 if W t < W high and α t = 0, if W t ≥ W high and β t = 1 - W t - W t arg et t W max - W t arg et t t T - 1 if W t > W target t and β t = 1 otherwise; wherein B P (t) denotes the target frame size, R AVG denotes an average bitrate, F denotes a frame rate, γ denotes a constant factor, MAD(t) denotes the measured frame complexity, MAD avg (t-1) denotes an average frame complexity over a period of time, W(t) denotes the current buffer level of the video buffering device, W high denotes a high buffer level of the video buffering device, W t arget ( t) denotes the calculated target buffer level, W max denotes a maximum size limit of the video buffering device, t denotes a distance between the Inter frame and a previous Intra frame and T denotes the period between two Intra frames; and using the calculated target frame size of the Inter frame to control bitrate in video coding of the sequence of images. measuring frame complexity (44, 252) in the sequence of images; for each Inter frame, (i) calculating a target buffer level (47, 104) of a video buffering device in relation to a distance between the Inter frame and a next Intra frame; (ii) calculating a target frame size (48, 106, 250, 256) in relation to the measured frame complexity, a current buffer level of the video buffering device and the calculated target buffer level as a function B P t = R AVG F β t min γα t, MAD t 1 + MAD avg t - 1 with α t = 1 - W t W high 2 if W t < W high and α t = 0, if W t ≥ W high and β t = 1 - W t - W t arg et t W max - W t arg et t t T - 1 if W t > W target t and β t = 1 otherwise; wherein B P (t) denotes the target frame size, R AVG denotes an average bitrate, F denotes a frame rate, γ denotes a constant factor, MAD(t) denotes the measured frame complexity, MAD avg (t-1) denotes an average frame complexity over a period of time, W(t) denotes the current buffer level of the video buffering device, W high denotes a high buffer level of the video buffering device, W t arget ( t) denotes the calculated target buffer level, W max denotes a maximum size limit of the video buffering device, t denotes a distance between the Inter frame and a previous Intra frame and T denotes the period between two Intra frames; and (i) calculating a target buffer level (47, 104) of a video buffering device in relation to a distance between the Inter frame and a next Intra frame; (ii) calculating a target frame size (48, 106, 250, 256) in relation to the measured frame complexity, a current buffer level of the video buffering device and the calculated target buffer level as a function B P t = R AVG F β t min γα t, MAD t 1 + MAD avg t - 1 with α t = 1 - W t W high 2 if W t < W high and α t = 0, if W t ≥ W high and β t = 1 - W t - W t arg et t W max - W t arg et t t T - 1 if W t > W target t and β t = 1 otherwise; wherein B P (t) denotes the target frame size, R AVG denotes an average bitrate, F denotes a frame rate, γ denotes a constant factor, MAD(t) denotes the measured frame complexity, MAD avg (t-1) denotes an average frame complexity over a period of time, W(t) denotes the current buffer level of the video buffering device, W high denotes a high buffer level of the video buffering device, W t arget ( t) denotes the calculated target buffer level, W max denotes a maximum size limit of the video buffering device, t denotes a distance between the Inter frame and a previous Intra frame and T denotes the period between two Intra frames; and using the calculated target frame size of the Inter frame to control bitrate in video coding of the sequence of images.