Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random Access Point clarifications #503

Closed
wants to merge 1 commit into from
Closed

Conversation

robUx4
Copy link
Contributor

@robUx4 robUx4 commented Apr 23, 2021

Following the discussions from #419, we need some explanations on RAP.

Historically the keyframe flag was not always set for audio blocks even though each audio (Simple)Block could be seeked to. So there's some room in the rules for that.

In the thread we also proposed a new flag (in the Simple|Block or in the Track) to specify how strict it is to the rule. With such a flag we could make rules stricter for future files as long as they use that flag.

Another rule that may not correctly apply to existing files is the fact the ReferenceBlock must list all the frames it references. I'm not sure this is the case. We should study what mkvmerge/libavformat/libwebm do.

This patches sits on top of #495 so it's a draft for now.

@robUx4 robUx4 added bug clarifications spec_main Main Matroska spec document target labels Apr 23, 2021
@robUx4 robUx4 requested a review from mbunkus April 23, 2021 13:32
@robUx4
Copy link
Contributor Author

robUx4 commented Apr 23, 2021

  • libavformat is only writing one ReferenceBlock and it does not always use the proper value:
    if (blockid == MATROSKA_ID_BLOCK && !keyframe)
        put_ebml_sint(pb, MATROSKA_ID_BLOCKREFERENCE, track->last_timestamp - ts);
    track->last_timestamp = ts;

The referenced frame may not always the previous one. And for a B-frame there are 2 frames to reference.

@robUx4 robUx4 marked this pull request as ready for review May 25, 2021 19:30
* audio & subtitles are considered RAP by default (noone cared to set the proper flags in SimpleBlock)
* video are RAP if the keyframe flag is set or the BlockGroup has no ReferenceBlock.
* all video reference needed for a frame must be listed in a ReferenceBlock (if using a BlockGroup)
* intro-only (AV1) frames use a ReferenceBlock value of 0
@robUx4
Copy link
Contributor Author

robUx4 commented Oct 17, 2021

This is actually a duplicate of #555 which more comments and more up to date text...

@robUx4 robUx4 closed this Oct 17, 2021
@robUx4 robUx4 deleted the RAP-clarifications branch July 2, 2023 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug clarifications spec_main Main Matroska spec document target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant