Enhance Avisynth video workflow and metadata tools
This commit is contained in:
@@ -20,7 +20,7 @@ from tools.video_formatting import (
|
||||
)
|
||||
from tools.video_inputs import VideoInput
|
||||
from tools.video_outputs import output_begin_timestamp
|
||||
from tools.video_probe import VideoProbe
|
||||
from tools.video_probe import VideoProbe, hdr_kind
|
||||
from tools.video_timeline import OutputTimeline
|
||||
|
||||
|
||||
@@ -252,6 +252,9 @@ def print_probe_summary(inputs: list[VideoInput], probes: list[VideoProbe]) -> N
|
||||
f"{format_frame_count(probe.stream_frame_count, probe.timing.frame_count)}"
|
||||
)
|
||||
print(f" video: {_format_probe_video_line(probe)}")
|
||||
hdr_line = _format_hdr_line(probe)
|
||||
if hdr_line:
|
||||
print(f" HDR: {hdr_line}")
|
||||
if probe.audio_streams:
|
||||
for index, stream in enumerate(probe.audio_streams, start=1):
|
||||
print(f" audio {index}: {_format_audio_stream(stream)}")
|
||||
@@ -272,8 +275,7 @@ def print_probe_summary(inputs: list[VideoInput], probes: list[VideoProbe]) -> N
|
||||
|
||||
|
||||
def _format_probe_video_line(probe: VideoProbe) -> str:
|
||||
return join_parts(
|
||||
video_parts(
|
||||
parts = video_parts(
|
||||
codec=probe.codec or "unknown codec",
|
||||
width=probe.width,
|
||||
height=probe.height,
|
||||
@@ -282,7 +284,23 @@ def _format_probe_video_line(probe: VideoProbe) -> str:
|
||||
matrix=probe.color_matrix or "unknown",
|
||||
bit_rate=probe.video_bit_rate,
|
||||
)
|
||||
)
|
||||
kind = hdr_kind(probe.color_transfer, dynamic=probe.hdr10plus)
|
||||
if kind:
|
||||
parts.append(kind)
|
||||
return join_parts(parts)
|
||||
|
||||
|
||||
def _format_hdr_line(probe: VideoProbe) -> str | None:
|
||||
kind = hdr_kind(probe.color_transfer, dynamic=probe.hdr10plus)
|
||||
if kind is None:
|
||||
return None
|
||||
parts = ["PQ" if (probe.color_transfer or "").lower() == "smpte2084" else "HLG"]
|
||||
parts.append("full range" if (probe.color_range or "").lower() == "pc" else "limited range")
|
||||
if probe.max_content_light is not None:
|
||||
parts.append(f"MaxCLL {probe.max_content_light}")
|
||||
if probe.max_frame_average_light is not None:
|
||||
parts.append(f"MaxFALL {probe.max_frame_average_light}")
|
||||
return join_parts(parts)
|
||||
|
||||
|
||||
def _format_audio_stream(stream) -> str:
|
||||
|
||||
Reference in New Issue
Block a user