The embodiment of the invention discloses a video coding method and device,
electronic equipment and a computer readable medium. A specific embodiment of the method comprises the following steps: acquiring a video; for each frame of image, determining an average gradient value; in response to the fact that the average gradient value is not lower than a first threshold value, determining a
motion vector precision mode as a first mode; in response to the condition not higher than the first threshold and not lower than a second threshold, determining that the
motion vector precision mode is a second mode; in response to not higher than the second threshold, determining the
motion vector precision mode as a third mode; obtaining each coding unit; determining a self-adaptive motion vector precision tool; setting a motion vector precision range; performing encoding
processing on each encoding unit to generate encoding information; and determining each piece of coding information as video coding information. According to the embodiment, the overall characteristics of the image are utilized, so that the selection range of the motion vector precision is more reasonable, the coding efficiency is improved, the consumption of computing resources is reduced, and the overall performance of video coding is improved.