Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions av/video/codeccontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,20 @@ def has_b_frames(self):
"""
return bool(self.ptr.has_b_frames)

@property
def reorder_depth(self):
"""Raw ``has_b_frames`` value from FFmpeg (int, not bool).

After :meth:`flush_buffers`, FFmpeg may reset the internal reorder
heuristic. Set this to the known reorder depth *after* seeking to
avoid dropped hierarchical B-frames.
"""
return self.ptr.has_b_frames

@reorder_depth.setter
def reorder_depth(self, value: cython.int):
self.ptr.has_b_frames = value

@property
def coded_width(self):
"""
Expand Down
1 change: 1 addition & 0 deletions av/video/codeccontext.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class VideoCodecContext(CodecContext):
sample_aspect_ratio: Fraction | None
display_aspect_ratio: Fraction | None
has_b_frames: bool
reorder_depth: int
max_b_frames: int
coded_width: int
coded_height: int
Expand Down
Loading