How to get proper video encoding from Blender or similar?

okay, here is the thing,

OBS screencapture: flv or mp4 x264 CBR -> awesome nice quality and small (update: it is okay i guess)

Blender (after various resources and by a lot of trial and error):
HDTV 1080 60p preset, fps same as source, 100% render resolution,
Encoding RGB MPEG 4 + h.264 codec (lossless) is the only 'decent'
result. Even export as single pngs strangely had a loss of quality.

OBS (~8.00 min, 24 MB) (mp4+x264) = 18.375 s/MB

Blender ( 0.08 min, 76 MB) (mp4+h264 lossless) = 0.1 s/MB

รด_O

after app. an hour of calculation I found that the OBS compression vs Blender lossless
encoding is 18000 % more effective (!) ..... (that is even 2 x over 9000)!
And on top it is not even retaining the same quality...

Can someone explain that? Am I doing something wrong? How does OBS do that?

What OBS is doing is normal. Blender is just...borked. I cannot get it to import video even much less export it. And also you're using a lossless mode using RGB.

I can't really speak for the quality differences since Blender does not seem to import video normally and I have no particular interest in doing whatever voodoo is required to make it work. (I use Premiere/Sony Vegas)

Video is kinda complicated.

Colorspace Theory: The two color space formats that codecs can use are YUV and RGB. Red-Green-Blue is what needs to be displayed for actually outputing the video onto a monitor or when importing into a video editing program. However, it is also possible to store the colorspace as YUV or Luma (Y) and two colors (UV). The third color (to convert to RGB and actually display the video) can be computed dynamically based upon the Luma and the UV color channels.

So why does that matter? Because humans are very sensitive to Luma but not to chroma. This means it is possible to drop most of the information in UV channels to 1/4, keep all of the Luma information and have very little subjective loss in quality (yuv420p).

That Blender encode is doing "RGB MPEG 4 + h.264 codec" so it is retaining the full colorspace info, where as the OBS one is dropping most of it (which is normal) so the file-size for the OBS one should be significantly smaller, all else equal.

That said, all else isn't equal because the Blender settings are lossless. So in addition to not doing the normal chroma subsampling, the Blender codec settings are trying to retain literally 100% of the quality of the original. Raw video is like 2GB for 2 min. An lossless encode is like 200MB for 2 min and a normal h.254 encode would be around 20-30 MB for 2 min. The Blender one should be huge compared to the OBS capture which is lossy.

The actual size of the file OBS will output depends upon the x264 preset, and the CRF value (usually 20 is okay). A slower preset (uses more CPU) results in a smaller file-size and lower Constant Rate Factor results is better quality. OBS also supports hardware acceleration so, if using it, you should expect it to be quite fast and with a decent CRF (20) to retain most of the quality, and, especially with color space subsampling (YUV), to be quite small.

thanks for that insight mate! :D