Skip to content

Disable or decrease stream read buffer size  #956

@zbyte

Description

@zbyte

Overview

I`m read RTSP stream with PyAV frame by frame. And for each frame make some processing. All good, but sometimes processing takes longer than the time between frames and my processed video starts lagging behind real time. This gap is constantly growing.
Obviously it's because of the input buffer.

Expected behavior

I want to decrease buffer size to one frame.

Actual behavior

To synchronize with real time i need read all frames from buffer.

Investigation

try set flag:
container.flags |= av.container.Flags.NOBUFFER

try set low delay:
container.streams.video[0].codec_context.flags |= av.codec.context.Flags.LOW_DELAY

Research

I have done the following:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions