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

Conversation

snosenzo
Copy link
Contributor

Timestamp refers to video frame instead of image

Added note to data field to state that B-frames should not be used.

@snosenzo snosenzo requested a review from jtbandes September 28, 2023 19:57
@@ -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

@@ -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.

@jhurliman
Copy link
Contributor

Error response from daemon: Get "https://registry-1.docker.io/v2/": EOF

CI failure due to Docker outage

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). B frames should be avoided because of their inconsistency with recordings directly written from live sources. */
Copy link
Contributor

@james-rms james-rms Sep 29, 2023

Choose a reason for hiding this comment

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

B frames are not inconsistent with live sources, live sources sometimes introduce a buffer and some latency to create them. We don't support them because of our source buffering code in studio, not because of some inherent unsuitability for the task. Therefore, i'd modify this to just say "Note: Foxglove Studio does not support display of video streams that include B frames".

@snosenzo
Copy link
Contributor Author

Thanks for the feedback. I've updated the description to combine both @jhurliman and @james-rms suggestions.
It now reads:

Note: Foxglove Studio does not support video streams that include B frames because they require lookahead.

@snosenzo snosenzo merged commit 03f91d4 into main Sep 29, 2023
8 checks passed
@snosenzo snosenzo deleted the video-followup branch September 29, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants