If you need to compress video, you need to use media codecs. They let you decrease the size of the video, make it smaller, and change its format. There are different video codecs so you need to choose the most appropriate of them according to your goals.
Such coders as H264 and XviD are very popular and considered the best for most of the users. They offer you an average speed, good quality, and not very big size of output files. XviD makes smaller videos when H264 has the higher speed and quality of files.
You can also try the HEVC codes, which is a little bit better than the previous two programs by all the parameters, but it is not very popular. MPEG is also widely used, but it has a low speed or processing and generates big output files.
There is also such a codec as Motion JPEG. It works fast, offer the average quality of videos, and output files are not very big. If you want to generate lossless video files fast with the good quality, it is recommended to use YV12 and other codes of its kind.
If you don’t know what to install, try using the K-Lite Codec Pack. It contains most of the popular codecs so you just need to install them on your PC and it takes a few minutes. It has a few versions, including Mega pack that contains even professional and not widely used codecs.