y5gfunc.encode.qc¶
qc
¶
Classes:
| Name | Description |
|---|---|
QcMode |
Which metrics to use for quality check |
ReturnType |
What to return after quality check |
Functions:
| Name | Description |
|---|---|
encode_check |
Perform a quality check on an encoded video using SSIM and/or CAMBI metrics. |
QcMode
¶
ReturnType
¶
Bases: StrEnum
What to return after quality check
Attributes:
| Name | Type | Description |
|---|---|---|
ENCODED |
Return the |
|
ERROR |
Return a clip containing only the frames flagged as errors |
|
BOTH |
Return a tuple containing both the annotated |
encode_check
¶
encode_check(encoded: VideoNode, source: Optional[VideoNode] = None, mode: QcMode = BOTH, threshold_cambi: float = 5, threshold_ssim: float = 0.9, return_type: ReturnType = ENCODED) -> Union[VideoNode, tuple[VideoNode, VideoNode]]
Perform a quality check on an encoded video using SSIM and/or CAMBI metrics.
This function compares the encoded video against optional source video (for SSIM) and calculates CAMBI scores. It identifies frames that fall below the SSIM threshold or exceed the CAMBI threshold, printing information about problematic frames to the console.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VideoNode
|
The encoded video clip to check. |
required |
|
Optional[VideoNode]
|
The source video clip for SSIM comparison. Required if mode includes SSIM. Must have the same format as |
None
|
|
QcMode
|
Which metrics to use. |
BOTH
|
|
float
|
The maximum allowed CAMBI score. Frames exceeding this are flagged. Must be between 0 and 24. |
5
|
|
float
|
The minimum allowed PlaneSSIM score. Frames below this are flagged. Must be between 0 and 1. |
0.9
|
|
ReturnType
|
What to return: |
ENCODED
|
Returns:
| Type | Description |
|---|---|
Union[VideoNode, tuple[VideoNode, VideoNode]]
|
Depending on |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If input parameters are invalid. |
Source code in y5gfunc/encode/qc.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |