Code Monkey home page Code Monkey logo

Comments (13)

jibon57 avatar jibon57 commented on August 17, 2024

Hi,

If you check code here:

if(platform == "linux"){

You'll see xvfb will enable only for Linux. Because Windows & MacOS have GUI. So, I don't think you'll get any error message if you run.
This line:
if(platform == "linux"){

I have added path for Linux (ubuntu) & MacOS. I don't have any Windows device so don't know the location of Google Chrome. So, you can modify it like this:

if(platform == "linux"){
    options.executablePath = "/usr/bin/google-chrome"
}else if(platform == "darwin"){
    options.executablePath = "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
}else if(platform == "win32"){
	options.executablePath = " " // here you can give full path of chrome.exe
}

Now it should work from any platform.

from bbb-recorder.

jibon57 avatar jibon57 commented on August 17, 2024

OK, in windows 64bit probably location of Google Chrome here:

C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

You can verify. So, modification will be:

if(platform == "linux"){
    options.executablePath = "/usr/bin/google-chrome"
}else if(platform == "darwin"){
    options.executablePath = "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
}else if(platform == "win32"){
    options.executablePath = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" // here you can give full path of chrome.exe
}

from bbb-recorder.

zakcali avatar zakcali commented on August 17, 2024

I've added the path as you said but with doble backslashes, made some changes related with paths:
else if(platform == "win32"){
options.executablePath = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" // here you can give full path of chrome.exe
}

from bbb-recorder.

zakcali avatar zakcali commented on August 17, 2024

I've started to download a recording, I saw a chrome tab with presentation on my desktop (I was expecting not see that tab, but it is okay), but when presentation ends, I got error:
ERROR: The process "18412" not found.
when I checked folders, I see that nothing recorded

from bbb-recorder.

zakcali avatar zakcali commented on August 17, 2024

-------- run the commands below-----------
git clone https://github.com/jibon57/bbb-recorder
cd bbb-recorder
npm install --ignore-scripts
---------------------got the response-----------------------------
C:\Users\zafer\node\bbb-recorder>npm install --ignore-scripts
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
added 48 packages from 35 contributors and audited 48 packages in 3.913s
1 package is looking for funding
run npm fund for details
found 0 vulnerabilities
------------------------------config.json-----------------
{
"rtmpUrl": "rtmp://a.rtmp.youtube.com/live2/MyKey",
"ffmpegServer": "ws://localhost",
"ffmpegServerPort": 4000,
"auth": "mZFZN4yc"
}
-------------------------exportjs-----------------------
deleted lines:
"copyToPath": "/var/www/bigbluebutton-default/record"
const Xvfb = require('xvfb');
-------------------------added path to exportjs----------------------
if(platform == "linux"){
options.executablePath = "/usr/bin/google-chrome"
}else if(platform == "darwin"){
options.executablePath = "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
}else if(platform == "win32"){
options.executablePath = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" // with double backslashes
}
------------- changed lines of exportjs -------------
var copyFromPath = "./downloads";
var copyToPath = "./records";

------------ created downloads and records folders------------
------------started to download a recording------------
------ waited for the end of recording, I got the error----------------------------------------
ERROR: The process "18412" not found.
[Error: EPERM: operation not permitted, unlink 'C:\Users\zafer\AppData\Local\Temp\puppeteer_dev_chrome_profile-EaDRfV\CrashpadMetrics-active.pma'] {
errno: -4048,
code: 'EPERM',
syscall: 'unlink',
path: 'C:\Users\zafer\AppData\Local\Temp\puppeteer_dev_chrome_profile-EaDRfV\CrashpadMetrics-active.pma'
}

from bbb-recorder.

zakcali avatar zakcali commented on August 17, 2024

I commented to skip closing process with this:
// await browser.close()
But this time downloads folder is empty, and ffmpeg gives error
stderr: downloads/Egitim-264-3509-000.webm: No such file or directory

from bbb-recorder.

jibon57 avatar jibon57 commented on August 17, 2024

Give full path of downloads directory. You are doing wrong for copyFromPath. Download directory should be user's download directory where Chrome downloaded. Sorry, don't make windows device with me.

from bbb-recorder.

zakcali avatar zakcali commented on August 17, 2024

Ok. somehow, I managed the filenames with absolute paths, temporarily with this:
function copyOnly(filename){
var copyFrom = "e:\Downloads\" + filename;
var copyToPath = "records";
var copyTo = copyToPath + "\" + filename;

Now, I got the web file without sounds
There is an Opus Audio track in the stream, but I don't hear sounds or speakings

from bbb-recorder.

jibon57 avatar jibon57 commented on August 17, 2024

I don't know how much you have modified the file. I think the default code should work perfectly if you just add chrome path as my example. Try to convert webm file to mp4 & see the result.

from bbb-recorder.

zakcali avatar zakcali commented on August 17, 2024

Here are my thoughts on Linux and Windows versions. Probably I will give up trying because, I see the browsers in Windows 10, unlike Linux version. I will probably not try to build a golang version because I see the browsers in Windows 10.

Linux version:
Pros:

  1. Awesome
  2. I don't see any browser window (maybe xvfb effect), even " headless:false,"
  3. I can start three recording in separate shells with my intel E5450 quad core processor. Each processor is consumed %80 capacity. So I can download 20 presentation in a few hours.

Cons:

  1. I have to start my Linux partition when booting my PC by pressing F11
  2. There are hundreds of educators (M.D.s) in our medical faculty, %95 of them doesn't know what is linux, %4 of them may Install a Linux system to their computers, %1 of them may compile the code and use that program (Probably I'm the only one, between 500+ educators)

Here are my thoughts on Windows version
Pros:

  1. None

Cons:

  1. no sound! no sound! no sound!
    I hear no sound when watching recording in browser windows, when playing webm file, when playing converted mp4 file.
    There is an audio track coded with Opus, stereo channels, sample rate 48000 Hz, bits per sample 32, just like on Linux version.
    I checked that, there is sound if I play the presentation(s) from web.
  2. I see the browser window, because "headless: false". Worse is: it starts in full window. So it is very difficult to do other things at the same time. I didn't try yet what will happen to recording quality if I exit full screen mode.
    I'm curious what will happen if I get sound? Could I start 2 or 3 recordings at the same time, without sound interference? just like on Linux? I don't know.
    Absence of xvfb for windows operating system is terrible. We may not see presentation windows in browsers.
  3.  await page.close();
     await browser.close();
    

commands don't work well on Windows 10. I always got "ERROR: The process "xxxxx" not found."
So I commented browser closing. I'm closing chrome tasks from Windows Task manager manually after program finishes.
// await browser.close();

  1. Even I don't use "await browser.close();" I got error below randomly when program exiting:
[Error: EPERM: operation not permitted, unlink 'C:\Users\zafer\AppData\Local\Temp\puppeteer_dev_chrome_profile-xXxXxX\CrashpadMetrics-active.pma'] {
errno: -4048,
code: 'EPERM',
syscall: 'unlink',
path: 'C:\Users\zafer\AppData\Local\Temp\puppeteer_dev_chrome_profile-xXxXxX\CrashpadMetrics-active.pma'
}
  1. I tried to use chromium from https://download-chromium.appspot.com., extracted the zip file to a suitable directory with options:
    options.executablePath = "./node_modules/puppeteer/.local-chromium/win64-769697/chrome-win/chrome.exe"

Chromium browser doesn't stop at the specified time (default is 10 sn). As always, and expected from chromium, there is no sound !

from bbb-recorder.

jibon57 avatar jibon57 commented on August 17, 2024

I think your concept to use this solution isn't correct. Why are you trying to use this module from your local PC? You should use remote server to process recordings & provide processed MP4 to end users. Anyway I am closing this as it's not an issue.

from bbb-recorder.

zakcali avatar zakcali commented on August 17, 2024

I found another fork of puppetcam, which removed xvfb dependency:
https://github.com/Ventricule/html2screen

from bbb-recorder.

jibon57 avatar jibon57 commented on August 17, 2024

I think you are misunderstanding the purpose of using xvfb. Please read more from here: https://en.wikipedia.org/wiki/Xvfb

from bbb-recorder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.