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

Update comments for foxglove.CompressedVideo schema #129

Merged
merged 6 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ import { Time } from "./Time";

/** A single frame of a compressed video bitstream */
export type CompressedVideo = {
/** Timestamp of image */
/** Timestamp of video frame */
timestamp: Time;

/** Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this still says "image"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is old right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see the comment below still says image 👍 will fix

frame_id: string;

/** Compressed video frame data. For packet-based video codecs this data must begin and end on packet boundaries (no partial packets), and must contain enough video packets to decode exactly one image (either a keyframe or delta frame). */
/** Compressed video frame data. For packet-based video codecs this data must begin and end on packet boundaries (no partial packets), and must contain enough video packets to decode exactly one image (either a keyframe or delta frame). NOTE: It is strongly recommended to _not_ write B frames/slices to the H264 stream and instead solely use I and P frames because this more closely mirrors live data sources. */
data: Uint8Array;

/**
Expand Down
4 changes: 2 additions & 2 deletions internal/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ const CompressedVideo: FoxgloveMessageSchema = {
{
name: "timestamp",
type: { type: "primitive", name: "time" },
description: "Timestamp of image",
description: "Timestamp of video frame",
},
{
name: "frame_id",
Expand All @@ -810,7 +810,7 @@ const CompressedVideo: FoxgloveMessageSchema = {
name: "data",
type: { type: "primitive", name: "bytes" },
description:
"Compressed video frame data. For packet-based video codecs this data must begin and end on packet boundaries (no partial packets), and must contain enough video packets to decode exactly one image (either a keyframe or delta frame).",
"Compressed video frame data. For packet-based video codecs this data must begin and end on packet boundaries (no partial packets), and must contain enough video packets to decode exactly one image (either a keyframe or delta frame). NOTE: It is strongly recommended to _not_ write B frames/slices to the H264 stream and instead solely use I and P frames because this more closely mirrors live data sources.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this still make sense?

Suggested change
"Compressed video frame data. For packet-based video codecs this data must begin and end on packet boundaries (no partial packets), and must contain enough video packets to decode exactly one image (either a keyframe or delta frame). NOTE: It is strongly recommended to _not_ write B frames/slices to the H264 stream and instead solely use I and P frames because this more closely mirrors live data sources.",
"Compressed video frame data. For packet-based video codecs this data must begin and end on packet boundaries (no partial packets), and must contain enough video packets to decode exactly one image (either a keyframe or delta frame, but not a B-frame).",

I don't know the terminology that well but the "more closely mirrors live data sources" didn't feel like it clearly explained the reasoning. If you want to keep reasoning maybe something more like "to support streaming playback"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a B frame is technically a "delta" frame. What about something like:

Suggested change
"Compressed video frame data. For packet-based video codecs this data must begin and end on packet boundaries (no partial packets), and must contain enough video packets to decode exactly one image (either a keyframe or delta frame). NOTE: It is strongly recommended to _not_ write B frames/slices to the H264 stream and instead solely use I and P frames because this more closely mirrors live data sources.",
"Compressed video frame data. For packet-based video codecs this data must begin and end on packet boundaries (no partial packets), and must contain enough video packets to decode exactly one image (either a keyframe or delta frame). B-frames should be avoided because of their incompatibility with live sources, due to them referencing a future frame.",

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "live sources" is a bit unclear and it's also not obvious why someone who's just writing an mcap file should care about live sources

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a more accurate answer is because of their incompatibility with streaming playback. Displaying B-frame encoded video requires lookahead.

},
{
name: "format",
Expand Down
Loading