microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
67.26k stars 3.7k forks source link

[Feature]: test execution video recording quality control #31424

Open svlobanov opened 5 months ago

svlobanov commented 5 months ago

πŸš€ Feature Request

Currently video recording has only mode and size options, it's not possible to configure quality. For chromium-based browsers target bitrate = 1Mbit/s is hardcoded here https://github.com/microsoft/playwright/blob/47fb9a080d9dd4c1dff062c56060b86b621485ac/packages/playwright-core/src/server/chromium/videoRecorder.ts#L101 , also it's limited to one thread and target cpu usage is 50% (8/16). My tested system is video recording/playback platform so when I record in 1280x720, quality is very poor (because it plays video and requires more cpu, more bitrate for better quality) In firefox and webkit it's done without ffmpeg, but video recording quality-related parameters are not available to playwright user. I propose to expose quality controls (like bitrate, threads, speed for ffmpeg and similar thing for firefox/webkit) as test video options (like size option)

Example

No response

Motivation

Playwright will be able to record videos where you can read the text and see what is happening that might be useful if tested system playbacks/generates video (like video player, video editor, 3d design systems and so on)

EiffelFly commented 1 month ago

I also have the similar needs when I need to record the whole screen with as high quality as possible. It will be great if we can have this option!