Criteria for choosing between H.264 Youtube and H.264 lossless profiles

Hello:
I want to save some videos that come from PNG image sequences. They are not videos to upload to a public platform, they are restored family videos and I would like them to be compatible for viewing on smartphones, TV, etc.
Most of these videos are 720 x 576 px 25 fps resolution.
So I want to save the videos in two ways.
a)For archiving. Maybe Ut Video profile (lossless) in Mkv container to preserve also the original audio track (This is multiplexed in external software)
B) For consumption. For viewing on usual home devices, with smaller size and better compatibility.

Normally I use the H.264 Youtube profile for the consumption purpose (b), but I noticed that there is an H.264 lossless profile (without visual loss).
I made my export in this profile and in the Youtube profile and it turned out that the video exported with the H264 lossless profile occupied less size.

I know that there are values and parameters that make the difference between both profiles (CABAC, GOP) although I don’t know what is their practical use.
What is the advantage of the H.264 Youtube profile over H.264 lossless?

I thank you in advance for your advice and comments.

Hmmm - that doesn’t make sense to me. A lossless profile would always take (much) more space/file size than a lossy one? (Can be easily a factor 10).

Anyway for a bunch of pictures i generally wouldn’t convert the sequence as video format - as this generally takes much more space (even if these can be fairly well compressed as there is no movement at all during each pic). There are so many ways to play an image sequence as a slide show on nearly all picture viewers (mobile and what so ever) that this job is fairly useless imho.

If you still want it as video i would go for a setting with GOP according to the duration of each image. Say you present each image for 5 sec and use 25 fps - i would use a GOP of 125 as there is no change inbetween and this can be compressed very well. Not sure if it works if you have blend-overs etc.

1 Like

This is what the data from both exported files show.

H.264 lossless profile

H.264 Youtube profile

It is actually a bunch of images that are frames extracted from a video, then processed by AI algorithms.
There is the option to save that processing as an intermediate editing format, as a low size final product, or as images (1 image per frame).
I chose the latter because I edit some frames individually with GIMP.
So the whole sequence of images is actually a video.
After using several processes the result could look something like this:

Usually file size and device compatibility.

The lossless format is smaller in this case because it has a longer GOP. Give the same or longer GOP to the YouTube preset and it will likely become even smaller.

Not all hardware devices support lossless playback. Smart TVs and Blu-ray players often won’t play lossless files (such as directly plugging in a USB stick with your video). But if playback is always done by a computer media player, then you can achieve both of your goals with a single lossless export.

1 Like

For this footage, I just checked on my smart TV as well as other devices and the conclusion is that my family does not appreciate any visual difference between the two profiles, so I think I will go with the H.264 Youtube profile for compatibility.
Thank you very much for the advice. :+1:

Then you could just set the GOP higher in the YT-profile and achieve even better results in file size.
When you look at the overall bitrate in both profiles it becomes obvious. I wasn’t aware of a higher GOP-setting in the lossless profile. Imho h.264 is always a bit lossy - its a compression algorithm afaik - so it must be lossy to some extend - but maybe i am wrong here, not sure.

Since I can’t find a (subjective) visual difference between these two profiles (for this footage), I tried the video quality measurement function built into Shotcut, for more objective guidance.
I read a bit about what the abbreviations psnr (Peak signal to noise ratio)
Peak signal-to-noise ratio - Wikipedia
and ssim (Structural similarity) mean.
Structural similarity - Wikipedia
So the results seem to indicate better values (in ssim) for the test in the H.264 Youtube profile, than in the test for the H.264 Lossless profile.
I don’t know if I’m wrong, but I think that the measurement of these values takes as reference the timeline in Shotcut as the original file (in this case it is a sequence of uncompressed PNG images), and compares with the exported video file. is this so?
Here are the results of these tests:
Video Quality test H.264 Youtube.txt (194.3 KB)
Video Qualityt test H.264 Lossless.txt (194.3 KB)

I understand that these values come from algorithms and are not always representative of visual or perceived quality, so I’m still in doubt.

Those are unusually low SSIMs for a lossless file. It should be more like 99.97+. Any chance the source was captured at 4:2:2 subsampling but then exported as 4:2:0?

EDIT: Oh yeah… your source was a PNG image sequence, which is RGB (similar to YUV 4:4:4) and it gets converted to YUV 4:2:0 for export. Stuff is getting lost in the conversion. It probably isn’t the lossless profile’s fault for losing data.

Thank you for reviewing this. :slightly_smiling_face:
These videos really aren’t of good quality, so that which may be lost in the conversion doesn’t seem to have a negative impact on the visual quality of the final video.
Thanks again for helping me understand this a little more. :+1: