puppeteer-stream is using using the resolution of the screen instead of the resolution of the browser
See original GitHub issueSo puppeteer-stream is recording the video in 1440x900 (The resolution of my screen) instead of 1350x2400 (The resolution of the browser)
The code to record is this:
browser = await puppeteer_stream.launch(puppeteer, {
//headless: true,
executablePath: "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
args: [`--window-size=1350,2400`],
//args: ["--start-maximized"],
defaultViewport: null
})
page = await browser.newPage()
await page.setViewport({
width: 1350,
height: 2400
})
await page.goto("http://localhost:5085/player.html", { waitUntil: "networkidle2" })
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
How to solve difference between Browser Resolution and ...
The problem of difference between Screen and Browser Resolution Starts with devices having width 1600 and above. Actually some browser are ...
Read more >Screen Resolution ≠ Browser Window | CSS-Tricks
The most popular screen resolution is 1680 x 1050 with almost 13% of visits having a monitor of that size. Predictably, there is...
Read more >Set the screen resolution in the Web Transaction Recorder
Set the screen resolution in the Web Transaction Recorder. When you record a sequence, the Web Transaction Recorder captures browser dimensions for use...
Read more >Change desktop screen resolution in Selenium tests
Change desktop screen resolution for Selenium tests using the resolution capability on BrowserStack Automate.
Read more >Issues · SamuelScheit/puppeteer-stream - GitHub
puppeteer-stream is using using the resolution of the screen instead of the resolution of the browser. #50 opened on Jun 6 by JijaProGamer....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi. I managed to record to a resolution that I desired using this code. Hopefully it helps
In my case I set width and height to 1280 and 720.
(This code has been tested on windows. I dont think it works on linux)
ffmpeg -y -rtbufsize 30M -f gdigrab -thread_queue_size 4096 -probesize 5M -draw_mouse 0 -i title=“Page Tittle - Google Chrome” -vcodec libx264 -preset slow -crf 0 -b:v 5M -pix_fmt rgb24 ./video.mkv
This basically records a application by the name of “Page Tittle - Google Chrome”.
When you open a page, chrome sets the title of the process “Tittle - Google Chrome”. Not sure about chromium and other browsers but it should be similar.
The page should be the one selected for ffmpeg to record. If you switch the page it will still record until closing ffmpeg.
-draw_mouse 0 will not show the mouse and -draw_mouse 1 will show it.
Example with audio (Using VB-Audio Virtual Cable, a audio loopback device. Set Chrome to use it instead of auto-selecting a audio device.):
ffmpeg -y -rtbufsize 30M -f gdigrab -thread_queue_size 4096 -probesize 5M -draw_mouse 0 -i title=“Page Tittle - Google Chrome” -f dshow -thread_queue_size 4096 -itsoffset 0.5 -rtbufsize 30M -i audio=“CABLE Output (VB-Audio Virtual Cable)” -acodec flac -vcodec libx264 -preset slow -crf 0 -b:a 328k -b:v 5M -pix_fmt rgb24 ./video.mkv
If the audio is out of sync change -itsoffset 0.5 to another number