-
input_container = av.open(RTSP_URL)
video_stream: av.VideoStream = input_container.streams.video[0]
print(video_stream)
print(video_stream.gop_size)
Shouldn't it be a simple int? Line 33 in ee30e4f |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Because the
|
Beta Was this translation helpful? Give feedback.
-
Thank you! |
Beta Was this translation helpful? Give feedback.
Because the
gop_size
value for a decoder would, at best, produce a nonsense answer, and at worst, be slightly wrong or coincidentally correct.gop_size
tells the encoder how many non-keyframes there should be between each keyframe. Of course, the encoder might use that as only a rough guideline or ignore it completely. If you want to know the "gop_size" for a decoder. You can decode the frames in a loop, then checkframe.is_keyframe
to calculate the value.