1
0
Fork 0
mirror of https://git.concertos.live/Encode_Guide/mdbook-guide synced 2024-05-14 18:20:22 +00:00

Update use of ScreenGen, output nodes, green tint fix, zresize with fillborders, adptvgrnmod's chroma strength

This commit is contained in:
W S 2022-05-26 03:18:24 +05:30
parent 728c1190ff
commit 0721ccb8ef
7 changed files with 55 additions and 8 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
book
public

View file

@ -54,18 +54,23 @@ If you'd like to compare these in your previewer, it's recommended to interleave
out = core.std.Interleave([src, encode])
```
However, if you're taking your screenshots with `ScreenGen`, it's easier not to do that and just run two `ScreenGen` calls:
However, if you're taking your screenshots with `ScreenGen`, it's easier not to do that and just run a `ScreenGen` call:
```py
src = awf.FrameInfo(src, "Source")
awf.ScreenGen(src, "Screenshots", "a")
encode = awf.FrameInfo(encode, "Encode")
awf.ScreenGen(encode, "Screenshots", "b")
awf.ScreenGen([src, encode], "Screenshots")
```
Note that `"a"` was substituted for `"b"` in the encode's `ScreenGen`.
By default, this will generate src screenshots with the suffix "a", and encode screenshots with the suffix "b".
This will allow you to sort your folder by name and have every source screenshot followed by an encode screenshot, making uploading easier.
To use custom suffixes, you can use the `suffix` argument:
```py
awf.ScreenGen([src, encode], "Screenshots", suffix=["src","enc"])
```
### HDR comparisons
For comparing an HDR source to an HDR encode, it's recommended to tonemap.
@ -80,6 +85,8 @@ encode = awf.DynamicTonemap(encode, reference=src)
The `reference=src` in the second tonemap makes sure that the tonemapping is consistent across the two.
**Optional:** For better quality tonemapping, ensure that you have installed [vs-placebo](https://github.com/Lypheo/vs-placebo).
## Choosing frames
When taking screenshots, it is important to not make your encode look deceptively transparent.

View file

@ -35,6 +35,18 @@ actually know which clip you're looking at:
folder = "/path/to/settings_folder"
out = awf.InterleaveDir(src, folder, PrintInfo=True, first=extract, repeat=True)
If you are using vspreview or VSEdit, you can use output nodes
to set each clip to a different node. Then you can switch
between them using the number keys on your keyboard.
# Load the files before this
src = awf.FrameInfo(src, "Source")
test1 = awf.FrameInfo(test1, "Test 1")
test2 = awf.FrameInfo(test2, "Test 2")
src.set_output(0)
test1.set_output(1)
test2.set_output(2)
If you're using `yuuno`, you can use the following iPython magic to get
the preview to switch between two source by hovering over the preview
screen:

View file

@ -0,0 +1 @@
# Chroma Resampling and Shifting

View file

@ -134,7 +134,7 @@ The reason why it's difficult to know whether the incorrect standard was assumed
## Rounding error
A slight green tint may be indicative of a rounding error having occured.
This issue is especially common among streaming services like Amazon, CrunchyRoll, etc.
This issue is especially common among streaming services like Amazon, CrunchyRoll, HBO Max etc.
To fix this, we need to add a half step in a higher bit depth than the source's:
```py
@ -143,6 +143,12 @@ half_step = high_depth.std.Expr("x 128 +")
out = vsutil.depth(half_step, 8)
```
If the above fixes the tint, but introduces a very slight mismatch in contrast, try applying the filter to only the chroma plane:
```py
half_step = high_depth.std.Expr(["", "x 128 +"])
```
<p align="center">
<img src='Pictures/rounding_0.png' onmouseover="this.src='Pictures/rounding_1.png';" onmouseout="this.src='Pictures/rounding_0.png';" />
</p>

View file

@ -469,6 +469,23 @@ fix = core.fb.FillBorders(crop, top=top_fill, bottom=bot_fill, mode="fillmargins
resize = core.resize.Spline36(1280, 536, src_top=top_fill, src_height=src_height)
```
An easier way of doing the above is using the relevant parameters in awsmfunc's `zresize`.
So the last line in the above example would become:
```py
resize = awf.zresize(preset=720, top=1)
```
Similarly, if you filled 1 line each on the left and right side, you would use:
```py
resize = awf.zresize(preset=720, left=1, right=1)
```
A significant benefit of using `zresize` is that it automatically calculates
the most appropriate target resolution, to minimize the AR error.
### Diagonal borders
If you're dealing with diagonal borders, the proper approach here is to

View file

@ -114,11 +114,14 @@ This function resizes grain in the same way `GrainFactory3` does, then applies i
It also has some protection for darks and brights to maintain average frame brightness:
```py
grain = agm.adptvgrnMod(strength=0.25, cstrength=None, size=1, sharp=50, static=False, luma_scaling=12, seed=-1, show_mask=False)
grain = agm.adptvgrnMod(strength=0.25, size=1, sharp=50, static=False, luma_scaling=12, seed=-1, show_mask=False)
```
Grain strength is controlled by `strength` for luma and `cstrength` for chroma.
`cstrength` defaults to half of `strength`.
Grain strength is controlled by `strength`, for both luma and chroma grain.
If a single value is passed, the chroma graining applied is half of that value.
To choose both strengths, pass a list like `strength=[0.50, 0.35]`, which will
apply luma strength of 0.50 and chroma strength of 0.35.
Just like `adaptive_grain`, the default or slightly lower is usually fine, but you shouldn't go too high.
If you're using a `size` greater than the default, you can get away with higher values, e.g. `strength=1`, but it's still advised to stay conservative with grain application.