Skip to content

feed decoder with End-of-Stream frame flag reduce latency #5

@qiximenghu

Description

@qiximenghu
Hello. When I send IDR or P frame with frame flag End-of-Stream to the haerdware decoder and add vui information as your code, the MediaCodec decode H264 will not buffer frame, it will output frame immediately. Then after releaseOutputBuffer, flush the decoder, and queueInputBuffer make decoder Running again. I tested 720P@30fps h264 video on XiaoMi Mi8 device, the average decode time is about 7ms while without End-of-Stream flag is about 30ms. 
Howerver, when I render frame to surface and then flush decoder, it display little normal frame and lots of black frame.
Here is a test log. pts_times is  queueInputBuffer, pts_time_sb is dequeueOutputBuffer time, pts_time_sf is releaseOutputBuffer time.
Hope it helps you.

latency

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions