SamuelScheit / puppeteer-stream

A Library for puppeteer to retrieve audio and/or video streams
MIT License
358 stars 114 forks source link

Resolution issue #22

Closed ptorrent closed 2 years ago

ptorrent commented 2 years ago

Hello,

I'm using xvfb with this parameters:

-screen 0 1920x1080x16

And puppeteer-stream like that:

var screenWidth = 1920
var screenHeight = 1080
var xvfb        = new Xvfb({
    silent: true,
    xvfb_args:["-screen", "0", screenWidth+"x"+screeHeight+"x16", "-ac"],
});

xvfb.startSync();
var browser  = await puppeteerStream.launch({
    defaultViewport: {
        width   : screenWidth ,
        height  : screenHeight 
    },
    args: ['--no-sandbox']
});
var stream = await puppeteerStream.getStream(page, { 
    audio: false, 
    video: true 
});

But I'm never able to get correct resolution.. If i print screen.width and screen.height (you can see it in the middle of screenshots), I correctyl have 1920x1080. With window.innerWidth / window.innerHeight I also have have good value ! Looks like an issue with the stream..

What I have (this is the video output): image

What I must have: (from browser): image

One more issue:

I'm not able to restart the video, it's looks like there is no video duration, M I missing something ?

image

Video cursor is always at 0. Don't know if it's an issue with windows video reader or.. Same issue with VLC:

image

This is how I stop the record:

await stream.destroy();
file.close();
await browser.close(); 
xvfb.stopSync();

Don't know where to start to debug this issue, any idea?

Your help is welcome !

ptorrent commented 2 years ago

maybe related to https://github.com/Flam3rboy/puppeteer-stream/issues/15

SamuelScheit commented 2 years ago

resolved with #32