Capturing video on macOS is easy. Doing so without losing any quality whatsoever is not trivial.
If you want simple and don't mind slight color inaccuracy, you can go with ScreenFlow. It'll take care of most heavy lifting for you including the final encoded video.
Free alternatives to doing this are using CamTwist and sending its output to Syphon Recorder, or using Open Broadcaster Software. However this won't give you post-production editing options and you'll need to know how to encode your video manually afterwards.
Advanced Approach (note: this is only if you're not scared to dig a lot deeper.)
Most video recording solutions will degrade something even if you try "lossless" recording. If you want video that is truly 1:1 with your source, you'll need a few things:
- SSD or better: Perfect videos require fast disk write speed, so HDDs won't help except maybe at super low resolutions. Likewise, you'll need a lot of disk space.
- RGB format: The software you record with must be capable of handling video in RGB, whereas most recording solutions will default to YUV and not have a means of changing it.
- Flexible encoding: It does you no good if you can get a perfect video but the encoded video losses quality.
So far the only solution I've found that gets both RGB format and frame rate correct is Syphon Recorder. Set it to "Lossless" quality and for frame rate choose "As Fast As Possible" for maximum smoothness and perfect quality. This will give you a rawvideo file that you can then encode.
For encoding I recommend learning how to use ffmpeg. It offers tremendous flexibility and you can get amazing compression while keeping all your quality. Here's an example of a command I would use for a YouTube video:
ffmpeg -i ~/Desktop/Input.mov -c:v libx264rgb -preset veryslow -crf 0 -vf fps=60 -c:a pcm_s16be ~/Desktop/Output.mkv
For archiving videos on your computer you can use this:
ffmpeg -i ~/Desktop/Input.mov -c:v ffv1 -level 3 -vf fps=60 -c:a copy ~/Desktop/Output.nut
It is also possible to do a screen capture with ffmpeg, but currently there is a frame rate bug that prevents the macOS version from achieving perfect smoothness for live capture.
Lastly, if you want to verify the accuracy of your videos, you can use the built-in utility Digital Color Meter to check the pixels and values of your videos. If you don't mind dropping a few bucks, there's a much much better version of that on the Mac App Store called Classic Color Meter.