Skip to content

Expose probe score, codec frame rate, and frame cropping - #2496

Merged
WyattBlue merged 4 commits into
masterfrom
patch
Oct 28, 2026
Merged

WyattBlue merged 4 commits into
masterfrom
patch

Conversation

@WyattBlue

Copy link
Copy Markdown
Member

Add InputContainer.probe_score, VideoStream.codec_rate and video_delay from AVCodecParameters, Codec.wrapper_name and max_lowres, and the VideoFrame crop_* fields with apply_cropping().

Cropping moves the data pointer into the buffer, so linesize * height could reach past the allocation. VideoPlane now clamps its buffer size to the end of the plane's AVBufferRef.

Add InputContainer.probe_score, VideoStream.codec_rate and video_delay
from AVCodecParameters, Codec.wrapper_name and max_lowres, and the
VideoFrame crop_* fields with apply_cropping().

Cropping moves the data pointer into the buffer, so linesize * height
could reach past the allocation. VideoPlane now clamps its buffer size
to the end of the plane's AVBufferRef.
Report whether the duration came from timestamps, a stream, or a bitrate
guess, so callers can tell when container.duration is unreliable. Return
None when the duration is unknown, since FFmpeg leaves the field at
AVFMT_DURATION_FROM_PTS in that case.
decode_error_flags was only folded into is_corrupt, which hid why a frame
was flagged. Expose it as a DecodeError flag on Frame, since audio
decoders such as AC-3 set it too.

repeat_pict carries soft telecine from MPEG-2 repeat_first_field and
H.264 pic_struct. The tests patch an encoded MPEG-2 stream, since no
FFmpeg encoder writes either signal.
FFmpeg 9.0 takes enum AVCodecID; int only remains in 8.1 behind
FF_API_PARSER_CODECID. Both are int-sized, so this matches the current
API without changing behavior.
@WyattBlue
WyattBlue merged commit 47ef074 into master Oct 28, 2026
10 checks passed
@WyattBlue
WyattBlue deleted the patch branch October 28, 2026 03:34
@WyattBlue WyattBlue mentioned this pull request Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant