-
-
Notifications
You must be signed in to change notification settings - Fork 6
rfc(feature): Video replay envelope #129
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
Merged
bruno-garcia
merged 26 commits into
getsentry:main
from
vaind:feat/video-replay-envelope
Feb 9, 2024
Merged
Changes from 9 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
8ccece4
rfc(feature): Video replay envelope
vaind 985c32c
basics
vaind 7691ba5
intro
vaind 26ee3cc
some ideas
vaind b4d3723
motivation update
vaind ae41a9d
Update text/0129-video-replay-envelope.md
vaind a653d99
review changes
vaind 5574b37
rework the proposed option
vaind 14f517b
cleanups
vaind 3c60f03
apply review suggestions
vaind 75aba68
Update text/0129-video-replay-envelope.md
vaind 46c72b8
review suggestions and clarification
vaind ab3db0d
improvements
vaind 8843512
details
vaind c2e004e
fixup rrweb json
vaind e22a091
cleanup
vaind cb938e5
Update text/0129-video-replay-envelope.md
vaind e9488b1
camel case & header cleanup
vaind 78987fb
add meta event & left+top
vaind 79ef51f
fixup case on relay header
vaind 1e20ad4
Update text/0129-video-replay-envelope.md
romtsn 2424b31
Update text/0129-video-replay-envelope.md
vaind 70e1b05
cleanup & clarify envelope items headers vs payloads
vaind 6260eaa
Update text/0129-video-replay-envelope.md
vaind d4dd02a
update the RFC status
vaind fc78a2b
add rough image vs video size comparison info
vaind File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| - Start Date: 2024-02-06 | ||
| - RFC Type: feature | ||
| - RFC PR: [#129](https://github.com/getsentry/rfcs/pull/129) | ||
| - RFC Status: draft | ||
|
|
||
| # Summary | ||
|
|
||
| In order to capture video replays and present them to the user, we need to define/decide: | ||
|
|
||
| - how to transport the video data to the server | ||
| - how to integrate the video data into the RRWeb JSON format | ||
| - how to combine multiple replay chunks to a single replay session | ||
|
|
||
| All of these influence one another and need to be considered together in a single RFC. | ||
|
|
||
| Note: SDK-side implementation that is currently being worked on relies on taking screenshots and encoding them to a video. | ||
| This is based on an evaluation where a video has much smaller size than a sequence of images (**TODO fix these: factor of X for 720p video**). | ||
|
|
||
| # Motivation | ||
|
|
||
| We need this to to capture replays on platforms where it's not possible/feasible to produce an HTML DOM (i.e. the native format supported by RRWeb). For example: mobile apps. | ||
|
|
||
| <!-- # Supporting Data --> | ||
| <!-- Metrics to help support your decision (if applicable). --> | ||
|
|
||
| # Options Considered | ||
|
|
||
| ## Using a video, with EnvelopeItem:ReplayVideo | ||
|
|
||
| - From the SDK, we would send a new envelope item type, [`ReplayVideo`](https://github.com/getsentry/relay/blob/5fd3969e88d3eea1f2849e55b61678cac6b14e44/relay-server/src/envelope.rs#L115C5-L115C20) to transport the video data. | ||
vaind marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| The envelope item would consist of a single header line (JSON), followed by a new line and the raw video data. | ||
vaind marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - The header should contain at least the following metadata: | ||
vaind marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - the raw size of the video data | ||
vaind marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - the duration of the video in milliseconds | ||
| - the encoder format | ||
romtsn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - the container format | ||
| - the video resolution | ||
| - Additionally, it may be useful to include more information, such as: | ||
| - the number of frames in the video | ||
| - the frame rate type (constant, variable) | ||
| - the frame rate value | ||
vaind marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Additionally, it would be accompanied by an item [`ReplayRecording`](https://github.com/getsentry/relay/blob/5fd3969e88d3eea1f2849e55b61678cac6b14e44/relay-server/src/envelope.rs#L113), containing a header, e.g. `{"segment_id": 12}`, followed by a new line and the RRWeb JSON. | ||
| - The RRWeb JSON should start with an event of type [`EventType.Custom`](https://github.com/rrweb-io/rrweb/blob/8aea5b00a4dfe5a6f59bd2ae72bb624f45e51e81/packages/types/src/index.ts#L8-L16), containing the type `video`. If there's other data the UI needs, we can add it alongside the `type` to the `data` field. Because there's only a single `ReplayVideo` sent with a single `ReplayRecording`, there's a one-to-one mapping without further details necessary in the actual RRWeb JSON. | ||
|
|
||
| ```json | ||
vaind marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| "type": 5, | ||
| "data": { | ||
| "type": "video", | ||
| } | ||
| } | ||
vaind marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ## Other considered options | ||
|
|
||
| ### Using the existing RRWeb canvas replay format (image snapshots) | ||
|
|
||
| It would be easy to implement this because the SDK already captures screenshots and with RRWeb being able to show them, there's not much to do. However, this would come with significantly larger data transfer size (compared to video), which should be kept as low as reasonably possible, considering this is currently aimed at mobile apps. Additionally, these images would need to be encoded in base64 so that they can be embedded in the RRWeb JSON. | ||
|
|
||
| <!-- | ||
| # Drawbacks | ||
|
|
||
| Why should we not do this? What are the drawbacks of this RFC or a particular option if | ||
| multiple options are presented. | ||
|
|
||
| # Unresolved questions | ||
|
|
||
| - What parts of the design do you expect to resolve through this RFC? | ||
| - What issues are out of scope for this RFC but are known? --> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.