The best method for extracting Blu-Ray source files is through VLC with libaacs installed. CTRL + D in VLC, select Blu-Ray and the mounted Blu-Ray drive, select "Convert" from the drop-down menu, select "Dump raw input" and the destination, then "Start".
Web rips are complicated and depend on the platform
To turn source files into something that most people can automatically run on their media players, you can use FFmpeg on the command line, or settle for its restricted GUI frontend, Handbrake
https://ffmpeg.org/ (
https://ffmpeg.org/documentation.html)
https://handbrake.fr/For a container, MKV and MP4 are obviously the standards
For a video codec, HEVC (x265) and AV1 (libaom/SVT-AV1/rav1e) are currently the most efficient at compression
For audio, opus is roughly 2x more efficient than mp3, with 64kbps being subjectively CD-quality in most cases. FLAC is a solid lossless format. Both formats support 5.1/7.1 channels although mapping them can be tricky and broken in FFmpeg
The trick is to find a compromise between file size (smaller bitrate) and quality. It's better to start off by encoding at the lowest possible bitrate and then moving up incrementally until you find the right one
Subtitles can be taken from the ripped source, done yourself, or imported from a website like Subscene
Extras from the source can be transcoded into their own files