胡斌

add -h and -w to input width and heigh

正在显示 1 个修改的文件 包含 11 行增加1 行删除
... ... @@ -65,6 +65,14 @@ if(!argv.f){//framerate
argv.f = "20";
}
if(!argv.w){//width
argv.w = "800";
}
if(!argv.h){//width
argv.h = "600";
}
function startFFmpeg(videosize) {
const args = ['-y','-f', 'rawvideo', '-pix_fmt', 'bgra', '-s' ];
... ... @@ -93,6 +101,8 @@ app.disableHardwareAcceleration()
let win
app.once('ready', () => {
win = new BrowserWindow({
width:argv.w,
height:argv.h,
webPreferences: {
offscreen: true
}
... ... @@ -119,7 +129,7 @@ win.webContents.executeJavaScript('const ipcToMain = require("electron").ipcRend
streamIn = null;
}
console.log("done")
if(elapsed > duration + 5000){//delay 5s after closing pipe ,then close
if(elapsed > duration + 5000){//delay 5s after closingSgit l pipe ,then close
win.webContents.executeJavaScript('require("electron").ipcRenderer.send("close-main-window")');
}
}
... ...