The invention provides a video coding
code rate control optimization method and
system, and the method comprises the steps: setting a sliding window with a preset length, extracting a video
frame sequence frame by frame from front to back, calculating an estimated
code rate of a front-end frame with a preset length through a preset
code rate control algorithm, and carrying out the coding. For a video frame after a preset length frame, acquiring histograms of coded frames in a window and a to-be-coded current frame, calculating a distance between the histograms, calling a
genetic algorithm, taking a coding parameter corresponding to each coded frame in the window as a
population gene, and coding the to-be-coded current frame in the window; the
histogram distance between the to-be-coded frame and each coded frame is utilized to calculate the
coding distortion rate and the pre-
estimation code rate of the to-be-coded frame so as to calculate the fitness of individuals in the
population, and the
population is subjected to selection, hybridization and variation for iteration; and screening the individual with the maximum fitness in each iteration to obtain the optimal pre-
estimation code rate in each iteration so as to obtain a final pre-
estimation code rate, and coding the current frame to be coded according to the final pre-estimation code rate. According to the invention, the code
rate control precision and the
video quality can be improved.