fix(session-replay): revert max key-frame interval to once per video segment #5156
+9
−7
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.
📜 Description
Changes the session replay video segment keyframe interval to 1.
💡 Motivation and Context
H.264 uses different types of frames:
I‑frames
are the least compressible but don't require other video frames to decode.P‑frames
can use data from previous frames to decompress and are more compressible than I‑frames.In #5134 we introduced a change in the video segment configuration to only use
I-Frame
by settingAVVideoMaxKeyFrameIntervalKey
to increase (browser) compatibility.Further testing surfaced now that the browser compatibility is not affected by this option, but it increases the file size of video segments:
The actual difference in size varies depending on the amount of changes in the video, but we could see up to 100% larger sizes.
Using the latest changes on main this replay works in Chrome, Firefox and Safari.
💚 How did you test it?
For this replay I changed I-Frames interval to 6 (1 I-Frame per 5 second video segment at 1 FPS, the others are P-Frames) which reduced the size from 19KB to 6KB for the first segment, while it still works in all browsers.
📝 Checklist
You have to check all boxes before merging:
sendDefaultPII
is enabled.