Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > New and alternative video codecs

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th October 2021, 13:13   #1  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Any 2021 lossless video comparison?

Any unbiased 2021 lossless video comparison?
Maximum compression is the most important thing for me.
PCU is offline   Reply With Quote
Old 10th October 2021, 13:14   #2  |  Link
richardpl
Registered User
 
Join Date: Jan 2012
Posts: 271
lagarith
richardpl is offline   Reply With Quote
Old 10th October 2021, 14:16   #3  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Quote:
Originally Posted by richardpl View Post
lagarith
Even better than YULS?
PCU is offline   Reply With Quote
Old 10th October 2021, 15:30   #4  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
I have also been looking for recent comparisons but not found anything.
Purely from a size standpoint (for example, to archive footage), I have found x264 to be significantly smaller than any of the typical lossless codecs. I have not tried an HEVC encoder, but it could potentially be even smaller.
x264 is also hard to beat from a speed standpoint. I only saw about 12% size difference between veryfast and veryslow presets.
If you are willing to accept some minor loss (still visually lossless) you can set the crf to around 10 and cut the size to 1/3 of the lossless version.
Zarxrax is offline   Reply With Quote
Old 10th October 2021, 16:01   #5  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Quote:
Originally Posted by Zarxrax View Post
I have also been looking for recent comparisons but not found anything.
Purely from a size standpoint (for example, to archive footage), I have found x264 to be significantly smaller than any of the typical lossless codecs. I have not tried an HEVC encoder, but it could potentially be even smaller.
x264 is also hard to beat from a speed standpoint. I only saw about 12% size difference between veryfast and veryslow presets.
If you are willing to accept some minor loss (still visually lossless) you can set the crf to around 10 and cut the size to 1/3 of the lossless version.
Have you tried AV1 lossless so far?
PCU is offline   Reply With Quote
Old 10th October 2021, 16:56   #6  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
Quote:
Originally Posted by PCU View Post
Have you tried AV1 lossless so far?
No but it might be a bit smaller. For me speed is at least semi-important so I was good with x264. If you really want small size, I think its worth considering making just a very high quality encode rather than insisting on purely lossless content, as ultimately no one will be able to tell the difference as long as quality is sufficiently high.
Zarxrax is offline   Reply With Quote
Old 10th October 2021, 17:02   #7  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Active lossless video formats:
FFV1
MagicYUV
x264 (not recommended)
x265
AV1
JPEG XS
Motion JPEG 2000 (MainConcept)
VC-2
UT Video Codec Suite

Why does no one fork CorePNG? (better rename to MPNG (Motion PNG)
CorePNG is a very attractive project.

Last edited by PCU; 10th October 2021 at 17:23.
PCU is offline   Reply With Quote
Old 10th October 2021, 17:12   #8  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Quote:
Originally Posted by Zarxrax View Post
No but it might be a bit smaller. For me speed is at least semi-important so I was good with x264. If you really want small size, I think its worth considering making just a very high quality encode rather than insisting on purely lossless content, as ultimately no one will be able to tell the difference as long as quality is sufficiently high.
I prefer lossless, but the size is the most important thing for me:
source: 35 MB, lossless: MagicYUV/PCM 7.5 GB!
Length: 2.30 min!
PCU is offline   Reply With Quote
Old 10th October 2021, 17:54   #9  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
Quote:
Originally Posted by PCU View Post
Active lossless video formats:

Why does no one fork CorePNG? (better rename to MPNG (Motion PNG)
CorePNG is a very attractive project.
PNG is a very old technology. Modern formats like AV1 should easily outperform it.

Also, if size is the biggest concern, you need a codec that makes heavy use of temporal compression. X264, X265, or AV1. Codecs like MagicYUV, UTvideo, Corepng, etc are primarily designed with every frame being a keyframe, and this will be SIGNIFICANTLY larger in filesize.
Zarxrax is offline   Reply With Quote
Old 10th October 2021, 18:08   #10  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Quote:
Originally Posted by Zarxrax View Post
PNG is a very old technology. Modern formats like AV1 should easily outperform it.

Also, if size is the biggest concern, you need a codec that makes heavy use of temporal compression. X264, X265, or AV1. Codecs like MagicYUV, UTvideo, Corepng, etc are primarily designed with every frame being a keyframe, and this will be SIGNIFICANTLY larger in filesize.
My question is that apart from the color space being lost in the conversion, is the x265 really like FLAC?

https://forum.videohelp.com/threads/...I-can-prove-it

So here's the deal, currently have a GTX960 and decided to buy mini1050 for $115 when payday comes around. In preparation of this change I have been doing a bunch of tests of the GTX960's nvenc as a baseline to compare how the Pascal powered 1050 performs quality wise, namely I wanted to see if the 1050 offered better quality because it executes the same settings better, is it because it offers more settings than the 960 or both.

So using a static build of ffmpeg and Ubuntu 16.04 LTS and the latest NVIDIA drivers I transcoded a slew of files and used ffmpeg to calculate baseline PSNR and SSIM values. As a reference point I decided to include some x264 ultrafast and medium encodes and some x265 ultrafast encodes, it was when I decided to do a bunch of lossless encodes that I realized something was wrong.

Using a 2.3gb 1080p source file I transcoded it to nvenc_h264 lossless (the 960 doesn't support H265 lossless) and the resulting files size was 30.9gb.

The x264 ultra fast lossless was 28.6gb, with the medium preset it drops down to about 22gb. Then I ran into something really odd, the x265 ultra fast encode was only 14gb, less than half the size of the other 2.

Using ffmpeg to caluclate PSNR and SSIM for all the files i got the following values:

NVENC H264 Lossless
[Parsed_ssim_0 @ 0x27956a0] SSIM Y:1.000000 (inf) U:1.000000 (inf) V:1.000000 (inf) All:1.000000 (inf)

[Parsed_psnr_1 @ 0x2795d40] PSNR y:inf u:inf v:inf average:inf min:inf max:inf

X264 Lossless Ultra Fast
[Parsed_ssim_0 @ 0x37958a0] SSIM Y:1.000000 (97.759916) U:1.000000 (inf) V:1.000000 (inf) All:1.000000 (99.656556)

[Parsed_psnr_1 @ 0x3796040] PSNR y:inf u:inf v:inf average:inf min:inf max:inf

X265 Lossless Ultra Fast
[Parsed_ssim_0 @ 0x4133a40] SSIM Y:0.996310 (24.329467) U:0.997240 (25.590147) V:0.997184 (25.503329) All:0.996610 (24.698549)
[Parsed_psnr_1 @ 0x41340e0] PSNR y:53.354600 u:55.613567 v:55.443195 average:53.965527 min:51.749530 max:72.329853

The only values that make sense are the NVENC Lossless values, SSIM has a range between -1 and 1, with -1 being completely different and 1 being exactly the same and the decibel value for both PSNR and SSIM should be infinite if the encode is truly lossless.

Even x264 isn't really lossless but it's close enough that we can let it slide but the x265 values really surprise me.

Anyone want to run similar test with x265 on test samples they have and see if they see similar results.

For the record, lossless encoding for x264 and x265 where done with CRF 0.
PCU is offline   Reply With Quote
Old 10th October 2021, 18:24   #11  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
Quote:
Originally Posted by PCU View Post
My question is that apart from the color space being lost in the conversion, is the x265 really like FLAC?
Per the thread you linked, people responded that the wrong settings were used.

I just did my own test in x265 and it did turn out completely mathematically lossless.
Zarxrax is offline   Reply With Quote
Old 10th October 2021, 18:27   #12  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Quote:
Originally Posted by Zarxrax View Post
Per the thread you linked, people responded that the wrong settings were used.

I just did my own test in x265 and it did turn out completely mathematically lossless.


What about this comparison, says x264 is not that good in compression, correct me if I'm wrong:

https://compression.ru/video/codec_c...n_2007_eng.pdf
PCU is offline   Reply With Quote
Old 10th October 2021, 18:37   #13  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
Quote:
Originally Posted by PCU View Post


What about this comparison, says x264 is not that good in compression, correct me if I'm wrong:

https://compression.ru/video/codec_c...n_2007_eng.pdf
That was a very old version of x264 now. There were numerous improvements to lossless encoding after that, including revision 994 which was said to improve lossless encoding by 4-25%.
Zarxrax is offline   Reply With Quote
Old 10th October 2021, 18:47   #14  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Quote:
Originally Posted by Zarxrax View Post
That was a very old version of x264 now. There were numerous improvements to lossless encoding after that, including revision 994 which was said to improve lossless encoding by 4-25%.


That's why we need new unbiased comparison!
PCU is offline   Reply With Quote
Old 10th October 2021, 18:50   #15  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Quote:
Originally Posted by Zarxrax View Post
Per the thread you linked, people responded that the wrong settings were used.

I just did my own test in x265 and it did turn out completely mathematically lossless.
What settings do you use for maximum compression?
PCU is offline   Reply With Quote
Old 10th October 2021, 18:53   #16  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
Quote:
Originally Posted by PCU View Post
What settings do you use for maximum compression?
Dunno, I haven't played with it much aside from just checking if I got lossless output. I would guess the speed setting is the most important thing after the --lossless option.
Zarxrax is offline   Reply With Quote
Old 10th October 2021, 19:04   #17  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Quote:
Originally Posted by Zarxrax View Post
Dunno, I haven't played with it much aside from just checking if I got lossless output. I would guess the speed setting is the most important thing after the --lossless option.
What software do you use?
I'm a pro user of MainConcept codecs, but noob user of x264/x265, because IDK anything about it beside main settings!

Last edited by PCU; 10th October 2021 at 19:33.
PCU is offline   Reply With Quote
Old 10th October 2021, 19:53   #18  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,340
Quote:
Originally Posted by PCU View Post

Even x264 isn't really lossless but it's close enough that we can let it slide but the x265 values really surprise me.
Then there is some user error somewhere. Such as timestamps off or jitter, or not using --lossless switch for x265 (crf 0 is not lossless for x265)


What pixel format ?
What type of content ?

For 8bit 4:2:0, it will be x264 or ffv1 using long gop

Long GOP will almost always produce better results, so that rules out things like lagarith. The exception will be null frames. Content that has lots of identical frames. Lagarith "null frames" option will put it over the top
poisondeathray is offline   Reply With Quote
Old 10th October 2021, 20:16   #19  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Quote:
Originally Posted by poisondeathray View Post
Then there is some user error somewhere. Such as timestamps off or jitter, or not using --lossless switch for x265 (crf 0 is not lossless for x265)


What pixel format ?
What type of content ?

For 8bit 4:2:0, it will be x264 or ffv1 using long gop

Long GOP will almost always produce better results, so that rules out things like lagarith. The exception will be null frames. Content that has lots of identical frames. Lagarith "null frames" option will put it over the top
I just want max compression for lossless, --lossless is enough?
PCU is offline   Reply With Quote
Old 10th October 2021, 20:47   #20  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,340
Quote:
Originally Posted by PCU View Post
I just want max compression for lossless, --lossless is enough?
For x265 --lossless enables lossless mode. Anything else is not lossless .

Slower settings do not always reduce filesze, it depends on content. eg. You can demonstrate cases where "very slow" produces larger file than "very fast". There is no "max compression" setting for everything

But x265 always produces worse compression ratio than x264 for 8bit 4:2:0 content lossless encoding - there is not a single test in thousands that show otherwise (when using similar settings, not something like intra. vs long gop) . There is no reason to use x265 lossless - slower to encode/decode, larger filesizes

Your PSNR/SSIM tests look not done correctly (likely timestamp issue, or container timebase differences if it doesn't show "inf")

Last edited by poisondeathray; 10th October 2021 at 20:50.
poisondeathray is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:01.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.