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, 21:02   #21  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Quote:
Originally Posted by poisondeathray View Post
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 - there is not a single test in thousands that show otherwise. 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")
Thank you, very strange.
But for HDR files, the only option is x265 or AV1.
I'm using Adobe Media Encoder + Voukoder + Autokroma Influx plugins, first for encoding and second for decoding. the Voukoder plugin has all x265 command line option in a GUI. what commands do you use?
PCU is offline   Reply With Quote
Old 10th October 2021, 21:30   #22  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,345
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   #23  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
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   #24  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,345
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 11th October 2021, 21:41   #25  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 322
Did a quick test a year or two ago with a 1min sample from an 1080p24 bluray:

Original: 179 MiB
x264 (preset veryslow, crf 0): 733 MiB
x264 (preset fast, crf 0): 765 MiB
x265 (preset veryslow, lossless): 808 MiB
FFV1: 831 MiB
JPEG2000: 932 MiB
x265 (preset fast, lossless): 934 MiB
Ut Video: 1.30 GiB
HUFFYUV: 1.87 GiB
Uncompressed: 4.17GiB

Last edited by excellentswordfight; 11th October 2021 at 21:44.
excellentswordfight is offline   Reply With Quote
Old 11th October 2021, 21:44   #26  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Quote:
Originally Posted by excellentswordfight View Post
Did a quick test a year or two ago with a 1min sample from an 1080p24 bluray:

Original: 179 MiB
x264 (preset veryslow, crf 0): 733 MiB
x264 (preset fast, crf 0): 765 MiB
x265 (preset veryslow, lossless): 808 MiB
FFV1: 831 MiB
JPEG2000: 932 MiB
x265 (preset fast, lossless): 934 MiB
Ut Video: 1.30 GiB
HUFFYUV: 1.87 GiB
Uncompressed: 4.17GiB
What about YULS and Lagarith?
PCU is offline   Reply With Quote
Old 11th October 2021, 22:15   #27  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
Quote:
Originally Posted by PCU View Post
What about YULS and Lagarith?
The website for YULS states that it has a maximum resolution of 1024 x 768. If this is true, I can't see that codec being very useful these days, as most people are going to have footage larger than that.

Lagarith ought to fall somewhere between UTvideo and FFV1.
Zarxrax is offline   Reply With Quote
Old 12th October 2021, 04:45   #28  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Quote:
Originally Posted by Zarxrax View Post
The website for YULS states that it has a maximum resolution of 1024 x 768. If this is true, I can't see that codec being very useful these days, as most people are going to have footage larger than that.

Lagarith ought to fall somewhere between UTvideo and FFV1.
Thanks.
What about AV1?
For HDR, the only option is x265 for now.
PCU is offline   Reply With Quote
Old 12th October 2021, 12:01   #29  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 322
Quote:
Originally Posted by PCU View Post
What about YULS and Lagarith?
Dunno about YULS, I only tested ffmpeg bundled codecs thats why lagarith wasnt inlcuded, as Zarxrax mentioned, it should be somewere between UT Video and FFV1.

Quote:
Originally Posted by PCU View Post
Thanks.
What about AV1?
For HDR, the only option is x265 for now.
I tried AV1 lossless, but its so slow that I didnt even bother letting it finish. Someone that has a faster CPU/has more interested in tuning it for some speed maybe can give an comparison on how good the compression is in lossless mode. But I'm pretty sure that it will keep being to slow offer any real life value when in comes to lossless compression for quite some time.

Why is x265 the only option for HDR? As long as the codec supports the pixel format it should be fine for HDR content, no? Are we discussing real world applications here? Is there a specific workflow need that you have for these lossless questions or are we just talking compression in general?

Last edited by excellentswordfight; 12th October 2021 at 12:15.
excellentswordfight is offline   Reply With Quote
Old 13th October 2021, 00:08   #30  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
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
Old 13th October 2021, 00:09   #31  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
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:12   #32  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by PCU View Post
Thanks.
What about AV1?
Do AV1 encoders generally enable the lossless option? x265 via command line is the only HEVC encoder that does off the top of my head.

AV1 encode is generally quite slow and decode is as well. And in many/most cases a lossless AV1 would be going through software decode to due level requirements, so even slower to use in practice.

Off the top of my head I can't think of any reason AV1 would have a material file size advantage over HEVC for the lossless case.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 13th October 2021, 04:20   #33  |  Link
`Orum
Registered User
 
Join Date: Sep 2005
Posts: 178
I have several TB of lossless footage so I've spent a lot of time researching them. To summarize what I've found:
  • For best ratio, x264 placebo is actually quite good, assuming you don't need alpha. There are some tricks to getting better compression ratios with it but they come with consequences. I've also yet to see where a slower preset for it produced a larger file than a faster one.
  • In situations you need alpha, I recommend FFV1. It tends to not be as good compression-wise as x264 (especially on footage with identical areas over multiple frames).
  • There is no reason to use x265 or any AV1 encoder that I have found (except for maybe HDR?). It's slower or worse ratio-wise compared to x264 for any given compression ratio/speed.
  • For high-speed lossless scenarios (e.g. capture), nvenc H.265 is what I'd recommend. It gets a better lossless ratio than nvenc's H.264 encoder.
  • If you don't have a Nvidia card for nvenc, but still need high-speed encoding, consider the faster speeds with x264 or ffvhuff.
__________________
My filters: DupStep | PointSize

Last edited by `Orum; 13th October 2021 at 04:48.
`Orum is offline   Reply With Quote
Old 13th October 2021, 08:32   #34  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Thanks guys.
It is true that the conversion speed is very important, but more importantly, the volume of the compression is much more important, because the space occupied on the disk is very important.
Placebo preset was terribly slow using the latest Voukoder (Adobe Media Encoder).

Last edited by PCU; 10th January 2022 at 09:49.
PCU is offline   Reply With Quote
Old 12th April 2022, 16:47   #35  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
I'm confused: Does FFV1 support HDR and 4K? I searched but did not find any answer.
PCU is offline   Reply With Quote
Old 12th April 2022, 19:43   #36  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by PCU View Post
I'm confused: Does FFV1 support HDR and 4K? I searched but did not find any answer.
4K resolution, definitely.
BT2020 with HLG or PQ transfer characteristics yes, but not in the .avi container. I think .mkv and .mov both support it, but I can't test right now as I'm on my mobile.
The only thing that it doesn't support is dynamically changing metadata, so no Dolby Vision nor HDR10+, but you can totally have HDR10 or even different kind of HDR with 12, 14 or 16bit planar precision.
FranceBB is offline   Reply With Quote
Old 13th April 2022, 12:15   #37  |  Link
PCU
Registered User
 
Join Date: Oct 2017
Posts: 327
Quote:
Originally Posted by FranceBB View Post
4K resolution, definitely.
BT2020 with HLG or PQ transfer characteristics yes, but not in the .avi container. I think .mkv and .mov both support it, but I can't test right now as I'm on my mobile.
The only thing that it doesn't support is dynamically changing metadata, so no Dolby Vision nor HDR10+, but you can totally have HDR10 or even different kind of HDR with 12, 14 or 16bit planar precision.
Replies from the official dev of FFV1:
HDR10+ might be be possible with ffv1 in Matroska with no changes to the specification but i think no implementation supports this ATM.
ive send the developer who implemented HDR10+ with vp9 in matroska in ffmpeg a mail asking why he didnt implemented it more generically so it would work with any codec in matroska
PCU is offline   Reply With Quote
Old 13th April 2022, 12:18   #38  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by PCU View Post
Replies from the official dev of FFV1:
HDR10+ might be be possible with ffv1 in Matroska with no changes to the specification but i think no implementation supports this ATM.
ive send the developer who implemented HDR10+ with vp9 in matroska in ffmpeg a mail asking why he didnt implemented it more generically so it would work with any codec in matroska
Got it.
Keep me posted 'cause I'm interested too, by the way.
FranceBB is offline   Reply With Quote
Old 14th April 2022, 22:03   #39  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
I'm surprised to hear that x265 isn't reliably producing smaller mathematically lossless files than x264.

The preset/efficiency ratio can be pretty non-constant. I've seen content where going from veryslow to placebo offers a bigger size reduction than going from medium to veryslow.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 15th April 2022, 16:26   #40  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Quote:
Originally Posted by PCU View Post
I'm confused: Does FFV1 support HDR and 4K? I searched but did not find any answer.
FFv1 same as most lossless codecs doesn't really care about resolution. Max frame size will be down to particular implementation limits, but it will be more like 16K or 32K.

Same with HDR. HDR is nothing more than 10 or 12bit video. Rest is flagging and metadata, but this can be stored in container (so codec itself doesn't need to support HDR flags). MOV, MXF or MKV will work (forget about AVI- old and limited).

I would not bother with x265 for lossless. It's terribly slow for no real gain. If you want good speed use ffvhuff. If you don't care about speed ffv1 is safe. If your source is RGB use codec which supports it natively at your desired bit depth.
As always- there is no simple answer what is the best. It all depends on your specific case.

Some limited numbers for UHD (10bit 4:2:2) source made of BM RAW, Canon RAW and Arri RAW source:
x265 lossless (preset=medium, GOP=1) 1740Mbit= 2.44 compression ratio
ffv1 lossless (ffmpeg) 1471Mbit=2.89 compression ratio
ffvhuff lossless (ffmpeg) 2021Mbit=2.10 compression ratio (10x faster than other 2)

High quality source with noise/grain etc. is typically 2-3x (even less sometimes). Anything above 3x will be rather specific case related to "easy" source (CGI, something lossy compressed many times already, etc.). Maybe long GOP is different.

x265 lossless (preset=medium, GOP=25) 1724Mbit= 2.46 compression ratio - not much gain over I frame only

Last edited by kolak; 15th April 2022 at 17:31.
kolak 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 14:29.


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