Skip to content

fix(screencast):Unstable video frame rate due to accumulated timestam… #35777

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 1 commit into
base: main
Choose a base branch
from

Conversation

ZeroWangZY
Copy link

…p (#35776)

Copy link
Contributor

Test results for "tests 1"

17 failed
❌ [chromium-library] › library/video.spec.ts:237:5 › screencast › should expose video path @chromium-ubuntu-22.04-node18
❌ [chromium-library] › library/video.spec.ts:323:5 › screencast › should work with weird screen resolution @chromium-ubuntu-22.04-node18
❌ [chromium-library] › library/video.spec.ts:341:5 › screencast › should work with relative path for recordVideo.dir @chromium-ubuntu-22.04-node18
❌ [chromium-library] › library/video.spec.ts:237:5 › screencast › should expose video path @chromium-ubuntu-22.04-node20
❌ [chromium-library] › library/video.spec.ts:306:5 › screencast › should expose video path blank page @chromium-ubuntu-22.04-node20
❌ [chromium-library] › library/video.spec.ts:323:5 › screencast › should work with weird screen resolution @chromium-ubuntu-22.04-node20
❌ [chromium-library] › library/video.spec.ts:341:5 › screencast › should work with relative path for recordVideo.dir @chromium-ubuntu-22.04-node20
❌ [chromium-library] › library/video.spec.ts:358:5 › screencast › should expose video path blank popup @chromium-ubuntu-22.04-node20
❌ [chromium-library] › library/video.spec.ts:237:5 › screencast › should expose video path @chromium-ubuntu-22.04-node22
❌ [chromium-library] › library/video.spec.ts:306:5 › screencast › should expose video path blank page @chromium-ubuntu-22.04-node22
❌ [chromium-library] › library/video.spec.ts:323:5 › screencast › should work with weird screen resolution @chromium-ubuntu-22.04-node22
❌ [chromium-library] › library/video.spec.ts:341:5 › screencast › should work with relative path for recordVideo.dir @chromium-ubuntu-22.04-node22
❌ [chromium-library] › library/video.spec.ts:358:5 › screencast › should expose video path blank popup @chromium-ubuntu-22.04-node22
❌ [chromium-library] › library/video.spec.ts:237:5 › screencast › should expose video path @ubuntu-22.04-chromium-tip-of-tree
❌ [chromium-library] › library/video.spec.ts:306:5 › screencast › should expose video path blank page @ubuntu-22.04-chromium-tip-of-tree
❌ [chromium-library] › library/video.spec.ts:323:5 › screencast › should work with weird screen resolution @ubuntu-22.04-chromium-tip-of-tree
❌ [chromium-library] › library/video.spec.ts:341:5 › screencast › should work with relative path for recordVideo.dir @ubuntu-22.04-chromium-tip-of-tree

9 flaky ⚠️ [chromium-library] › library/video.spec.ts:306:5 › screencast › should expose video path blank page @chromium-ubuntu-22.04-node18
⚠️ [chromium-library] › library/video.spec.ts:358:5 › screencast › should expose video path blank popup @chromium-ubuntu-22.04-node18
⚠️ [chromium-library] › library/chromium/oopif.spec.ts:284:3 › should click @chromium-ubuntu-22.04-node20
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:986:7 › cli codegen › should not throw csp directive violation errors @firefox-ubuntu-22.04-node18
⚠️ [firefox-page] › page/page-evaluate.spec.ts:424:3 › should throw for too deep reference chain @firefox-ubuntu-22.04-node18
⚠️ [chromium-library] › library/video.spec.ts:358:5 › screencast › should expose video path blank popup @ubuntu-22.04-chromium-tip-of-tree
⚠️ [playwright-test] › ui-mode-test-output.spec.ts:80:5 › should show console messages for test @ubuntu-latest-node22-1
⚠️ [webkit-library] › library/browsercontext-device.spec.ts:45:5 › device › should scroll to click @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:345:5 › page screenshot › should work while navigating @webkit-ubuntu-22.04-node18

39065 passed, 809 skipped
✔️✔️✔️

Merge workflow run.

@ZeroWangZY
Copy link
Author

@ZeroWangZY please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree [company="Tencent"]

@ZeroWangZY
Copy link
Author

@ZeroWangZY the command you issued was incorrect. Please try again.

Examples are:

@microsoft-github-policy-service agree

and

@microsoft-github-policy-service agree company="your company"

@microsoft-github-policy-service agree company="Tencent"

@dgozman dgozman requested a review from yury-s April 28, 2025 14:16
Copy link
Member

@yury-s yury-s left a comment

Choose a reason for hiding this comment

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

It's not obvious to me that this improves our video recording logic. Can you add a test that clearly demonstrates the benefit?


const expectedFrames = Math.round(fps * (timestamp - this._firstFrameTimestamp));

const repeatCount = Math.max(0, expectedFrames - this._framesWritten);
Copy link
Member

Choose a reason for hiding this comment

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

It should be max(1,.. to not miss the frame.

this._isStopped = true;

if (this._firstFrameTimestamp === null || !this._lastFrameBuffer) {
if (this._gracefullyClose)
Copy link
Member

Choose a reason for hiding this comment

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

The callback should never be null at this point. We didn't have this check before, why do you need it now?


const expectedFrames = Math.round(fps * (finalTimestamp - this._firstFrameTimestamp));

const repeatCount = Math.max(0, expectedFrames - this._framesWritten);
Copy link
Member

Choose a reason for hiding this comment

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

Please don't lose frames, max(1,...

}

if (repeatCount > 0)
Copy link
Member

Choose a reason for hiding this comment

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

This should stay under the if above, as that's where the queue is populated.

const repeatCount = Math.max(0, expectedFrames - this._framesWritten);

for (let i = 0; i < repeatCount; ++i)
this._frameQueue.push(this._lastFrameBuffer);
Copy link
Member

Choose a reason for hiding this comment

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

This entire enqueue logic is repeated twice and should be in a shared method.

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.

2 participants