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. |
4th April 2023, 04:01 | #21 | Link | |
Registered User
Join Date: Mar 2021
Location: North Carolina
Posts: 138
|
Quote:
So I've been fine-tuning Sol Levante from Netflix using 4K uhd-bd restrictions (for fun), and I've finally been able to get rid of some artifacts using this method. I think it was a combination of --b-adapt, --b-pyramid, --aq-mode, --psy-rd, --psy-rdoq, and --rdoq-level=2. Optimizing all of these made it completely artifact-free. You could never see the artifacts when watching normally, so this optimization was completely over-the-top, but it felt good getting it to look as good as I could. I captured 1 screenshot that previously had artifacts and breakdown. I zoomed in to the new encode and the artifacts were completely gone. I inspected the file using Avidemux, and it's interesting how it distributes bframes and pframes. Basically, under fast-moving scenes it would sometimes use back-to-back pframes, and only a couple of bframes. If, at any point scenes repeated for a while or were slow it would use more bframes, and fewer pframes. I have seen it where it used 3 pframes, 2 bframes, and right back to a pframe under a crazy high movement scene. Having adaptive bframes is incredibly good, it really has picked up the quality, and I couldn't see the difference between the prores file vs the encode even when zooming into shots with this method. I picked some scenes that repeat more, and sometimes it can use around 7 bframes, but rarely uses the full 8 bframes that I set. But, on slower content where frames repeat a lot, I can see that this really would get more quality out of animation. Maybe on animations like The Boxtrolls where backgrounds constantly repeat and the only thing that changes is the characters animating, it would be incredible for that too. Some extra info HB x265 [info]: frame I: 288, Avg QP:8.38 kb/s: 85705.13 HB x265 [info]: frame P: 1524, Avg QP:7.27 kb/s: 85089.15 HB x265 [info]: frame B: 4502, Avg QP:7.99 kb/s: 64369.76 HB x265 [info]: Weighted P-Frames: Y:6.7% UV:5.8% HB x265 [info]: Weighted B-Frames: Y:10.9% UV:9.6% 70343.93 kb/s, Avg QP:7.84 That's the lowest average QP I've ever gotten with this encode using a maxrate of 98 Mbps. Last edited by HD MOVIE SOURCE; 4th April 2023 at 04:04. |
|
21st April 2023, 19:12 | #23 | Link |
Registered User
Join Date: Mar 2021
Location: North Carolina
Posts: 138
|
I use Vidcoder so the code is written this way.
Code:
uhd-bd=1:no-open-gop:min-keyint=1:keyint=24:rc-lookahead=24:lookahead-slices=0:vbv-maxrate=98000:vbv-bufsize=99000:no-fast-intra:ref=5:limit-refs=0:limit-modes=0:aq-mode=3:aq-strength=1.7:bframes=8:b-adapt=2:b-intra:b-pyramid:weightb:weightp:ipratio=1.00:pbratio=1.00:subme=7:no-deblock:no-sao:no-strong-intra-smoothing:psy-rd=0.00:psy-rdoq=0.04:rdoq-level=2:no-cutree:rect:amp:hme:tskip:rskip=0:no-early-skip:rd=6:limit-tu=0:no-info Bit-rates are still controlled with Code:
vbv-maxrate=98000:vbv-bufsize=99000 Mine is the MKV file, it's 2.2GB, let me know what you think please. This is the best settings for grainless animation that I could find, and the lowest Avg QP was 7.84. So, this type of quality could be achieved on 4K Ultra HD Blu-ray. You just intense compute levels, LOL. I think it's time for me to upgrade to a workstation or something. Last edited by HD MOVIE SOURCE; 21st April 2023 at 19:16. |
6th May 2023, 04:24 | #25 | Link | |
Registered User
Join Date: Mar 2021
Location: North Carolina
Posts: 138
|
Quote:
I tested using no-scenecut and actually got better results on another encode. Think this is because I'm allowing p and b frames to be used as reference? So, typically an iframe is used for a scenecut, but now I see it's using a p or b frame. I'm using Avidemux to see where p and b frames are placed, but I'm not able to see if they were used as reference frames. My assumption is that they are, and that's why there was a quality increase. Oddly enough I found this method due to testing an encode on very fast and saw that it didn't use a scenecut. Tested it again with normal settings and using no-scenecut was better. It's actually a bit-rate saver too because Im not using as many iframes which is really nice. I wonder if streaming services do this so they can avoid as many iframes as possible but retain good picture quality. In reality, streaming services could set their keyint to the maximum, use as many reference frames as possible, use b-adapt, b-pyramid, and as many bframes as possible, and you save massive amounts of data, and you should be able to retain very good picture quality with that method I think. |
|
6th May 2023, 07:42 | #26 | Link | |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
|
Quote:
|
|
8th May 2023, 04:25 | #27 | Link | |
Registered User
Join Date: Mar 2021
Location: North Carolina
Posts: 138
|
Quote:
Again, this is under a uhb-bd=1 restriction, so there would be a keyint every 24 frames anyway. I think this is why it has actually helped achieve lower QP values because fewer iframes are being used, that's less data, and the quality of P frames and b frames are so good still. b-adapt=2, b-intra, b-pyramid, weightb, and weightp make p and b frames exceptionally good quality. Hey, that's the thought anyway, LOL. Seems to be working with a restricted keyint. |
|
17th May 2023, 18:23 | #28 | Link | ||
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
|
Quote:
Quote:
|
||
18th May 2023, 05:20 | #29 | Link | |
Registered User
Join Date: Mar 2021
Location: North Carolina
Posts: 138
|
Quote:
Just to clear some things up that I potentially might have misunderstood. By using --ref=5, does that mean a reference frame can be used with a B or P frame? If so, is the quality of a B reference frame ever as good as a true reference iframe? If reference frame quality differs when using a B or P frame then I've thought about a way to counter this. Even though I've now switched to b-adapt, one other method I've been thinking about is using a locked bframe method with my thoughts about ref=5. Like this... 24 frames long... i bbb p bbb p bbb p bbb p bbb p bbb With this method, you'd turn off b-pyramid, and that would mean all P frames would be used as reference frames. That would then offer enough information to pretty much every bframe and possibly keep the quality higher? This is considering that reference frame quality is not equal over I, P, and B frames, and why it's potentially better on 4K Blu-ray for instance, to do it this way. Just something I've been thinking about recently after seeing how many bframes companies like Sony use on their 4Ks, which is relatively low. I've seen them use 4 bframes on a transfer and it looked absolutely incredible. Thats kinda where this idea came from. Basically, you control where all your reference frames will go if you get the bframe count exactly right. I think this is certainly interesting. Especially being locked to 24 frame GOPs. If the first b frame references the iframe, it will look great. If the last bframe reference the pframe it will look great, and the bframe in the middle can reference the previous bframe and the bframe in front of it, which are coming from 2 reference points. In my head it sounds right, but is it? LOL Thanks. Last edited by HD MOVIE SOURCE; 18th May 2023 at 05:23. |
|
18th May 2023, 22:56 | #30 | Link | ||||
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
|
[QUOTE=HD MOVIE SOURCE;1987287]Just to clear some things up that I potentially might have misunderstood. By using --ref=5, does that mean a reference frame can be used with a B or P frame?[QUOTE]
--ref 5 means there can be a maximum of 5 decoded pictures buffered for frames to reference. All you need is --ref 2 to get B-frames, and --ref 1 for P-frames. IDR-only would be "--ref 0" as no frames reference each other. Quote:
Quote:
Quote:
Quote:
If you find a better algorithm to pick which frames should be what type, and what QP, that can be done with a qpfile. |
||||
29th May 2023, 13:41 | #31 | Link | |
Registered User
Join Date: Mar 2021
Location: North Carolina
Posts: 138
|
[QUOTE=benwaggoner;1987348][QUOTE=HD MOVIE SOURCE;1987287]Just to clear some things up that I potentially might have misunderstood. By using --ref=5, does that mean a reference frame can be used with a B or P frame?
Quote:
When using b-adapt, is there a way to control how to use bframes? I mean the quality of the frames. Is there a way to set it up to where bframes will only be chosen if the pframe is of lower quality? I think it's called frame bias, I've never used it, but like I've said. Is there an absolute way where it will only use a bframe if the quality is better? Example. bframe quality = 10.0 QP pframe quality = 9.99 QP I know the quality is tiny. but what bframe bias setting would allow this type of decision to be made? One of the reasons I'm asking is that I've been thinking about quality thresholds. Does the default bframe bias allow more bframes to be used under a certain level of loss? If the bframe quality was only say 5% less quality than the pframe, would it still use the bframe because it's cheaper, from a bandwidth perspective? Is the bframe bias setting the same in x264, because this is where I noticed this? In x264 if you use b-adapt with 3 bframes, the quality is slightly worse than simply using 1 bframe. So, the algorithm by default is favoring bframes at the expense of absolute quality. I'd like to fix this if possible by only using a bframe if it is higher quality than using a pframe. |
|
30th May 2023, 15:52 | #32 | Link | |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
|
Quote:
You can always set the frame type and QP via a qpfile. |
|
30th May 2023, 16:58 | #33 | Link | |
ffx264/ffhevc author
Join Date: May 2007
Location: /dev/video0
Posts: 1,844
|
[QUOTE=HD MOVIE SOURCE;1987733][QUOTE=benwaggoner;1987348]
Quote:
|
|
3rd June 2023, 04:22 | #34 | Link |
Registered User
Join Date: Mar 2021
Location: North Carolina
Posts: 138
|
I have asked about that in other threads, and now I'm asking about this. I'm trying to understand how all the pieces of the puzzle fit together. Please don't tell me what I should and shouldn't ask, this is the point of a forum, to try and gain knowledge and have a conversation.
Last edited by HD MOVIE SOURCE; 3rd June 2023 at 04:24. |
1st July 2023, 21:15 | #35 | Link | |
Registered User
Join Date: Mar 2021
Location: North Carolina
Posts: 138
|
Quote:
Even though bframes can be used as reference frames, are there scenarios where it will still only choose pframes? Is it possible for pframes to be better references than bframes? How does that work? Also, if my GOP is 24 frames long, and my lookahead is 24 frames long, can the encoder use the lookahead and reference the lookahead? Or in other words, use the lookahead to gather even more information than the currently available references? I ask this, because, I've seen pframes used where scenecuts could typically be used, but it used a pframe instead of an iframe. I'm just wondering how it could accurately create that frame without using the lookahead? Just to be 100% clear, when thinking about the lookahead, does it only lookahead 24 frames past the current iframe? So if there were a scenecut, the lookahead has to rebuilt, so to speak? |
|
3rd July 2023, 17:35 | #36 | Link | |||||
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
|
Quote:
In x265, --cutree tracks how sections of frames get used as later references, and improves the quality of blocks that are highly referenced later in the GOP, so that will naturally improve quality of any reference frame. Quote:
Quote:
Quote:
Quote:
|
|||||
5th July 2023, 03:40 | #37 | Link | |
Registered User
Join Date: Mar 2021
Location: North Carolina
Posts: 138
|
Quote:
Somebody mentioned this is one of my other posts using x264, and that's using an open-gop and still remaining compatible with Blu-ray standards. This has me thinking, if I use a keyint=24 with open-gop, if I use rc-lookahead=48, or something like that. Can Bframes reference images outside of the current GOP? Because if you can only reference the 24 frames inside the GOP then at frame 24 the only choice would be to use a pframe because pframes can only reference what comes before it. I see this all the time from my encodes, and didn't realize why it was choosing pframes on frame 24. But, I can't imagine not being able to reference frames outside the GOP even with a 24 frame keyint. If it can't do it, then why give the option to use open-gop? If it can, you could in theory use a 5-second lookahead=120 much like the streamers, and gather quite a bit more information about future frames. Vs being locked into a 24 frame keyint and lookahead like Im doing right now, right? However, I use ref=5, so does that mean I can only reference 5 frames in front of the current frame? If so, then You'd only need a 29 frame lookahead. Then you could get to frame 24 and still reference 5 frames ahead. Is that how it works? Last edited by HD MOVIE SOURCE; 5th July 2023 at 03:44. |
|
5th July 2023, 17:20 | #38 | Link | ||||||
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
|
Quote:
Quote:
Quote:
Quote:
This is a big reason why we want to use higher --keyint values. DVD having a max --keyint of 14 was a serious limitation! Quote:
Quote:
|
||||||
11th July 2023, 22:27 | #39 | Link | |
Registered User
Join Date: Mar 2021
Location: North Carolina
Posts: 138
|
Quote:
If there ever was a future Physical Media Player released for 8k (which I know there won't be) it should be up to the encoder to state what keyint to use. Because being able to use a 120 keyint on disc would significantly lower bit-rates. I can dream right? LOL. The only thing that would potentially fall is the reference quality when using a keyint that long. But, that's where scenecut comes in, so, think it would look nice. Never actually tested higher keyint values over 24. I probably should. I will test --radl Thanks. Last edited by HD MOVIE SOURCE; 11th July 2023 at 22:29. |
|
12th July 2023, 22:33 | #40 | Link | ||||
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
|
Quote:
Only IDR frames are independently decodable, so are the best ones for random access. Some decoders do random access by following the reference hierarchy and only decoding the frames needed to decode a given frame. Decoding just P-frames is a lot lighter weight intermediate. Quote:
The shorter GOPs were important for optical media to make random access less painful. The latency of a random access read of an optical desk makes even a 5400 rmp HD seem incredibly spritely. Quote:
Quote:
|
||||
Thread Tools | Search this Thread |
Display Modes | |
|
|