timecodes ¶
Classes:
-
Keyframes
–Class representing keyframes, or scenechanges.
-
LWIndex
– -
Timecodes
–A list of individual Timecode objects.
Keyframes ¶
Class representing keyframes, or scenechanges.
They follow the convention of signaling the start of the new scene.
Methods:
Attributes:
Source code
354 355 356 357 358 359 |
|
from_clip classmethod
¶
from_clip(
clip: VideoNode,
mode: SceneChangeMode | int = WWXD,
height: int | Literal[False] = 360,
**kwargs: Any
) -> KeyframesBoundT
Source code
384 385 386 387 388 389 390 391 392 393 394 395 396 |
|
from_file classmethod
¶
from_file(file: FilePathType, **kwargs: Any) -> KeyframesBoundT
Source code
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 |
|
from_param classmethod
¶
from_param(clip: VideoNode, param: KeyframesBoundT | str) -> KeyframesBoundT
Source code
511 512 513 514 515 516 517 518 519 |
|
to_clip ¶
to_clip(
clip: VideoNode,
*,
mode: SceneChangeMode | int = WWXD,
height: int | Literal[False] = 360,
prop_key: str = next(iter(prop_keys)),
scene_idx_prop: bool = False
) -> VideoNode
Source code
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 |
|
to_file ¶
to_file(
out: FilePathType,
format: int = V1,
func: FuncExceptT | None = None,
header: bool = True,
force: bool = False,
) -> None
Source code
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
unique classmethod
¶
unique(clip: VideoNode, key: str, **kwargs: Any) -> KeyframesBoundT
Source code
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
|
LWIndex dataclass
¶
LWIndex(stream_info: StreamInfo, frame_data: list[Frame], keyframes: Keyframes)
Classes:
-
Frame
– -
Regex
– -
StreamInfo
–
Methods:
Attributes:
-
frame_data
(list[Frame]
) – -
keyframes
(Keyframes
) – -
stream_info
(StreamInfo
) –
Frame ¶
Regex ¶
Attributes:
frame_first class-attribute
instance-attribute
¶
frame_first = compile(
"Index=(?P<Index>-?[0-9]+),POS=(?P<POS>-?[0-9]+),PTS=(?P<PTS>-?[0-9]+),DTS=(?P<DTS>-?[0-9]+),EDI=(?P<EDI>-?[0-9]+)"
)
StreamInfo ¶
Bases: NamedTuple
Attributes:
from_file classmethod
¶
from_file(
file: FilePathType,
ref_or_length: int | VideoNode | None = None,
*,
func: FuncExceptT | None = None
) -> LWIndex
Source code
567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 |
|
Timecode dataclass
¶
A Timecode object representing the timecodes of a specific frame.
Methods:
-
to_fraction
–Convert the Timecode to a Fraction that represents the FPS.
Attributes:
-
denominator
(int
) –The framerate denominator.
-
frame
(int
) –The frame number.
-
numerator
(int
) –The framerate numerator.
Timecodes ¶
A list of individual Timecode objects.
Methods:
-
accumulate_norm_timecodes
– -
assume_vfr
–Force the given clip to be assumed to be vfr by other applications.
-
from_clip
–Get the timecodes from a given clip.
-
from_file
– -
normalize_range_timecodes
–Convert from normalized ranges to a list of Fractions.
-
separate_norm_timecodes
– -
to_file
–Write timecodes to a file.
-
to_fractions
–Convert to a list of frame lengths, representing the individual framerates.
-
to_normalized_ranges
–Convert to a list of normalized frame ranges and their assigned framerate.
Attributes:
accumulate_norm_timecodes classmethod
¶
accumulate_norm_timecodes(
timecodes: Timecodes | dict[tuple[int, int], Fraction],
) -> tuple[Fraction, dict[Fraction, list[tuple[int, int]]]]
Source code
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|
assume_vfr ¶
assume_vfr(clip: VideoNodeT, func: FuncExceptT | None = None) -> VideoNodeT
Force the given clip to be assumed to be vfr by other applications.
Parameters:
-
clip
¶VideoNodeT
) –Clip to process.
-
func
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling. This should only be set by VS package developers.
Returns:
-
VideoNodeT
–Clip that should always be assumed to be vfr by other applications.
Source code
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
|
from_clip classmethod
¶
Get the timecodes from a given clip.
Parameters:
-
clip
¶VideoNode
) –Clip to gather metrics from.
-
kwargs
¶Any
, default:{}
) –Keyword arguments to pass on to
clip_async_render
.
Source code
155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
from_file classmethod
¶
from_file(
file: FilePathType, ref: VideoNode, /, *, func: FuncExceptT | None = None
) -> Self
from_file(
file: FilePathType,
ref_or_length: int | VideoNode,
den: int | None = None,
/,
func: FuncExceptT | None = None,
) -> Self
Source code
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
|
normalize_range_timecodes classmethod
¶
normalize_range_timecodes(
timecodes: dict[tuple[int | None, int | None], Fraction],
length: int,
assume: Fraction | None = None,
) -> list[Fraction]
Convert from normalized ranges to a list of Fractions.
Source code
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
separate_norm_timecodes classmethod
¶
separate_norm_timecodes(
timecodes: Timecodes | dict[tuple[int, int], Fraction],
) -> tuple[Fraction, dict[tuple[int, int], Fraction]]
Source code
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
to_file ¶
Write timecodes to a file.
This file should always be muxed into the video container when working with Variable Frame Rate video.
Parameters:
-
out
¶FilePathType
) –Path to write the file to.
-
format
¶int
, default:V2
) –Format to write the file to.
Source code
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
|
to_fractions ¶
Convert to a list of frame lengths, representing the individual framerates.
Source code
70 71 72 73 74 75 76 |
|
to_normalized_ranges ¶
Convert to a list of normalized frame ranges and their assigned framerate.
Source code
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|