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: 323
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: 237
lagarith
richardpl is offline   Reply With Quote
Old 10th October 2021, 14:16   #3  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 323
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,213
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: 323
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,213
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:12   #7  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 323
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:02   #8  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 323
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:54   #9  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,213
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: 323
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,213
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: 323
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:50   #13  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 323
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, 19:53   #14  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,061
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   #15  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 323
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, 21:30   #16  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,061
HDR is usually going to be at least 10bit 4:2:0 . Not as many comparison tests for lossless compression HDR scenario

--lossless is the only required switch for x265. The other options can make it slightly better or worse in terms of compression ratio (it varies) . In general a longer GOP has diminishing returns, just don't use --keyint 1 if the goal is compression. HDR settings would be the same as the input file if you want to retain the metadata
poisondeathray is offline   Reply With Quote
Old 10th October 2021, 22:18   #17  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 323
Quote:
Originally Posted by poisondeathray View Post
HDR is usually going to be at least 10bit 4:2:0 . Not as many comparison tests for lossless compression HDR scenario

--lossless is the only required switch for x265. The other options can make it slightly better or worse in terms of compression ratio (it varies) . In general a longer GOP has diminishing returns, just don't use --keyint 1 if the goal is compression. HDR settings would be the same as the input file if you want to retain the metadata
--lossless preset=placebo is it ok?

Last edited by PCU; 10th October 2021 at 22:38.
PCU is offline   Reply With Quote
Old 10th October 2021, 22:40   #18  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,061
Quote:
Originally Posted by PCU View Post
--lossless preset=placebo is it ok?
You can try it , but slower presets are sometimes worse for lossless encoding. Don't ask me why, they just are sometimes. There is no way to predict it's source dependent . +/- 0.1% filesize is not going give you a bad day
poisondeathray is offline   Reply With Quote
Old 13th October 2021, 00:09   #19  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,364
Quote:
Originally Posted by PCU View Post
--lossless preset=placebo is it ok?
It would be --lossless --preset placebo
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 13th October 2021, 00:08   #20  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,364
Quote:
Originally Posted by poisondeathray View Post
HDR is usually going to be at least 10bit 4:2:0 . Not as many comparison tests for lossless compression HDR scenario

--lossless is the only required switch for x265. The other options can make it slightly better or worse in terms of compression ratio (it varies) . In general a longer GOP has diminishing returns, just don't use --keyint 1 if the goal is compression. HDR settings would be the same as the input file if you want to retain the metadata
I've done some lossless HDR encoding. A few notes
  1. Unlike with non-lossless, the higher bit depth increases bitrate (typcially >25% due to more noise in the least significant bits).)
  2. With x265, --preset placebo can be >10% smaller than --preset veryslow
  3. Improvement of HEVC versus AVC lossless is <<2x
  4. Using all IDR isn't that much bigger than long GOP in lossless, and allows for more threading. Even --keyint 10 will capture most of the value from interframe encoding.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner 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 22:49.


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