Skip to content

DecodeFrameNoDelay yields frames one call later in 2.5.0 than in 2.4.1 #3837

Open
@torokati44

Description

@torokati44

With the same (attached) example program, which has some test frame data hardcoded in it, I get different results with OpenH264 2.4.1 and 2.5.0:

Output of LD_PRELOAD=./libopenh264-2.4.1-linux64.7.so ./test: Version 2.4.1

Decoding nalu 0 succeeded
W/H: 0 0
No output frame

Decoding nalu 1 succeeded
W/H: 0 0
No output frame

Decoding nalu 2 succeeded
W/H: 256 160
No output frame

Decoding nalu 3 succeeded
W/H: 256 160
Output frame:
16 16 16 16 16 16 16 16

Decoding nalu 4 succeeded
W/H: 256 160
No output frame

Decoding nalu 5 succeeded
W/H: 256 160
Output frame:
235 16 16 16 16 16 16 16

Decoding nalu 6 succeeded
W/H: 256 160
Output frame:
235 235 16 16 16 16 16 16

Decoding nalu 7 succeeded
W/H: 256 160
Output frame:
235 235 235 16 16 16 16 16

Decoding nalu 8 succeeded
W/H: 256 160
Output frame:
235 235 235 235 16 16 16 16

Output of LD_PRELOAD=./libopenh264-2.5.0-linux64.7.so ./test: Version 2.5.0

Decoding nalu 0 succeeded
W/H: 0 0
No output frame

Decoding nalu 1 succeeded
W/H: 0 0
No output frame

Decoding nalu 2 succeeded
W/H: 256 160
No output frame

Decoding nalu 3 succeeded
W/H: 256 160
Output frame:
16 16 16 16 16 16 16 16

Decoding nalu 4 succeeded
W/H: 256 160
No output frame

Decoding nalu 5 succeeded
W/H: 256 160
No output frame

Decoding nalu 6 succeeded
W/H: 256 160
Output frame:
235 16 16 16 16 16 16 16

Decoding nalu 7 succeeded
W/H: 256 160
Output frame:
235 235 16 16 16 16 16 16

Decoding nalu 8 succeeded
W/H: 256 160
Output frame:
235 235 235 16 16 16 16 16

The included test data looks like this: https://github.com/user-attachments/assets/76d1ba59-27c2-404b-9a19-6cec64ad216b

hsv.mp4

NALUs 0 and 1 are the SPS and PPS, respectively.

The eight logged numbers for every output frame are the luminosities of each of the 32x32 pixel squares at the top (235 for white, 16 for black).
Notice how in 2.4.1, the 3rd NALU yields the first frame, then the 4th one doesn't (understandably, it has to be reordered), but then decoding NALUs 5th and 6th again result in frames, in the correct order.
In 2.5.0, decoding neither the 4th or 5th NALUs return a frame, and from the 6th one on, they all start coming in again, but with one more call of latency.

This was probably caused by #3752, and blocks ruffle-rs/ruffle#18581.

I honestly don't understand how the "decoding latency on Qualcomm hardware decoders" (as noted in the linked suspect PR) has anything to do with this.

The example program: main.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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