What setting should I use to keep the same quality of video file?
I wanna know how to keep the same quality or at least what settings would be maximally close to original quality.


The short answer is you can't; migrating to a codec will always result in a degradation of the nebulous term “quality.”

If one speaks of quantization quality, the source RGB will be degraded. If one speaks of a general “perceptual” quality, the source RGB will also be degraded.

Encoding is an extremely complex domain, with content of work factoring into the resultant encode, as well as many other subtleties.

Best advice for optimal perceptual encoded quality is to remember BINAE; Blender Is Not An Encoder. Use an appropriate tool such as FFMPEG to encode material.

Some additional complexities outlined here.