Skip to content

Add session metadata for video stream #6159

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

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open

Add session metadata for video stream #6159

wants to merge 4 commits into from

Conversation

rom1v
Copy link
Collaborator

@rom1v rom1v commented Jun 15, 2025

Introduce a new packet type, a "session" packet, containing metadata about the encoding session. It is used only for the video stream, and currently includes the video resolution.

For illustration, here is a sequence of packets on the video stream:

                                    device rotation
                                    v
CODEC | SESSION | MEDIA | MEDIA | … | SESSION | MEDIA | MEDIA | …
       1920x1080 <-----------------> 1080x1920 <------------------
                  encoding session 1            encoding session 2

This metadata is not strictly necessary, since the video resolution can be determined after decoding. However, it allows detection of cases where the encoder does not respect the requested size (and logs a warning), even without decoding (e.g., when there is no video playback).

Additional metadata could be added later if necessary, for example the actual device rotation.

Refs #5918
Refs #5984

rom1v and others added 4 commits June 13, 2025 14:04
The stream metadata will contain both:
 - the codec id at the start of the stream
 - the session metadata (video width and height) at the start of every
   "session" (typically on rotation)
Introduce a new packet type, a "session" packet, containing metadata
about the encoding session. It is used only for the video stream,
and currently includes the video resolution.

For illustration, here is a sequence of packets on the video stream:

                                        device rotation
                                        v
    CODEC | SESSION | MEDIA | MEDIA | … | SESSION | MEDIA | MEDIA | …
           1920x1080 <-----------------> 1080x1920 <------------------
                      encoding session 1            encoding session 2

This metadata is not strictly necessary, since the video resolution can
be determined after decoding. However, it allows detection of cases
where the encoder does not respect the requested size (and logs a
warning), even without decoding (e.g., when there is no video playback).

Additional metadata could be added later if necessary, for example the
actual device rotation.

Refs #5918 <#5918>
Refs #5984 <#5894>

Co-authored-by: gz0119 <[email protected]>
The delay buffer must forward the session packets while preserving
their order relative to media packets.
Warn if the size of a decoded video frame does not match the session
metadata.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant