electroncapture icon indicating copy to clipboard operation
electroncapture copied to clipboard

Question: Audio recording

Open katoquro opened this issue 10 months ago • 17 comments

Hello, Sorry for asking here - I couldn’t find a better place! 😅

Is there a way to implement a flag to record (locally) a separate audio track on start, along with another option (maybe via a separate window) to record the master sound for synchronization?

If this can already be configured, could you please guide me on how to do it?

Big thanks!

P.S. It looks like the link in the project "About" electroncapture.app isn’t working (Invalid SSL certificate).

katoquro avatar Feb 08 '25 05:02 katoquro

Thank you for reporting the issue with the website. fixed.

If using VDO.Ninja with the ElectronCapture app, you can auto record with some URL parameters specified there:

https://docs.vdo.ninja/advanced-settings/recording-parameters/and-record

&autorecord&record=0 I think would record audio as PCM, for example.

I think this would record each audio track individually, however I've not tested it with the electron app before.

I'm not quite sure this is what you are asking for, but hopefully that does it?

-steve

steveseguin avatar Feb 08 '25 07:02 steveseguin

Thanks for the quick response. It looks like what I'm looking for, but I'm not sure it works (or I can't find where it's recorded on Linux). I also tried using this button in the menu, but nothing happened.

Image

If it's difficult to implement in electron maybe we can audio only option here?

Image

The second part of my question was about recording everything together for synchronization. Separate tracks are great for podcast editing, but before synchronizing them, I need something like a bus channel with any quality. It's not necessary, as I'm currently using OBS for that purpose, but it would be nice to have everything in one tool!

katoquro avatar Feb 09 '25 07:02 katoquro

A little update: I've discovered that Elecap recording starts only if a guest has already entered the room and is stored inside the Home directory.

katoquro avatar Feb 11 '25 18:02 katoquro

&autorecord&record=0 I think would record audio as PCM, for example.

I found an issue with this solution: when person reconnects elecap stars new record in the same file. Can we create new file after guest reconnect?

my version is elecap-2.19.1-x86_64.AppImage

katoquro avatar Mar 25 '25 19:03 katoquro

Image

The file names appear to be getting unique filenames when I'm testing with elecap on windows.

var timestamp = Date.now();
var filename = "";
if (session.rpcs[UUID].label || session.rpcs[UUID].streamID) {
	filename = session.rpcs[UUID].label || session.rpcs[UUID].streamID;
	filename = filename.replace(/[\W]+/g, "_");
	filename = filename.substring(0, 200);
}

filename += "_" + timestamp.toString();

I don't have Desktop Linux running at the moment; I'm not sure if this is a niche issue specific to linux builds, or whether this is something in VDO.Ninja I can address.

Do you have examples of the filenames it's creating? How are persons reconnecting? like after a sub-second temporarily network hiccup? Or is this after a refresh or total disconnect/reconnect?

Every time the recorder starts, it gives a new filename, and it appends a timestamp. There could be a bug, but I'd value some help in reproducing it. If it's a Linux only thing, I can do some research into it.

Thank you for the issue report.

steveseguin avatar Mar 25 '25 22:03 steveseguin

I see, thank you for your research. I'll try to reproduce the issue.

Here's what happened: I had multiple elecap windows open, and we recorded approximately 200 MB (based on a comparison with other recordings). Then, one of the participants lost audio and refreshed the page with the VDO. As a result, I can now see only one file for that guest, starting from the time of their reconnection. Elecap windows wasn't refreshed

katoquro avatar Mar 26 '25 14:03 katoquro

Thank you. That opens up the possibilities I suppose to what could have happened. I'm unsure at the moment what the cause could be however.

steveseguin avatar Mar 26 '25 15:03 steveseguin

It happened again. Guest refreshed page and lost part of track, ~~you can see that creation date is the same, so it was rewritten in the same file~~ I record audio via elecap-2.19.1-x86_64.AppImage &autorecord&record=0 params. Image

katoquro avatar May 06 '25 18:05 katoquro

Sorry for misinformation about creation date. It was modification date, creation is different. These are all files in the folder

Image

katoquro avatar May 06 '25 18:05 katoquro

Oh! I think I reproduced it! It happens not during reconnect, but when I close elecap window - first file disappears!

katoquro avatar May 06 '25 18:05 katoquro

Thank you. That does help. I might have some ideas to try, like adding a delay on app close, so I give things more time to save.

steveseguin avatar May 06 '25 18:05 steveseguin

I threw up a beta version, which essentially just increases the delay between the app closing and it actually closing from 1.5-seconds to 5-second. Maybe on some slower computers, large files will take more than a second to fully save.

I can add more advanced logic if this doesn't work, but I'm trying to keep it simple for now.

it also has some upcoming other code changes in it, which aren't yet cooked, so it's not suitable for a main release.

https://github.com/steveseguin/electroncapture/releases/download/2.19.1/elecap_win_v2.19.5.beta_installer.zip

steveseguin avatar May 07 '25 00:05 steveseguin

Thanks, can you share the branch? I'll build version for Linux. BTW, I managed to reproduce it on one minutes record. It could be Linux related issue 🤔 I use Ubuntu 22.04

katoquro avatar May 07 '25 08:05 katoquro

https://github.com/steveseguin/electroncapture/releases/tag/2.19.1

I added 3 linux options , marked as 2.19.5.beta , to the releases section. If those aren't suitable, you can try just pulling master, and see if it builds.

steveseguin avatar May 07 '25 11:05 steveseguin

I've made several tries with different versions and 100% reproduction. These are result:

First of all: master and built version produces such error during start, but works. My previous version (2.19.1) works correctly

Loading window-audio-capture module...
Error loading window-audio-capture module: Error: Cannot find module './native-modules/window-audio-capture'
Require stack:
- /tmp/.mount_elecapfKkCaW/resources/app.asar/main.js
- 
    at Module._resolveFilename (node:internal/modules/cjs/loader:1232:15)
    at s._resolveFilename (node:electron/js2c/browser_init:2:124109)
    at Module._load (node:internal/modules/cjs/loader:1058:27)
    at c._load (node:electron/js2c/node_init:2:16955)
    at Module.require (node:internal/modules/cjs/loader:1318:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/tmp/.mount_elecapfKkCaW/resources/app.asar/main.js:25:24)
    at Module._compile (node:internal/modules/cjs/loader:1484:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1564:10)
    at Module.load (node:internal/modules/cjs/loader:1295:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/tmp/.mount_elecapfKkCaW/resources/app.asar/main.js', undefined ]
}
APP READY

Already built version additionally shows next error window, compiled version from master - don't. Image

Test with version from master

2 records before closing Image

1 records disappeared when windows was closed Image

Additionally, I've noticed hanging process. Originally I started two windows: one with &autorecord&record=0 and the second - &noaudio (my standard setup of guest and mine videos)

Image

Window ID 1 'close' event triggered.
Window ID 1: Saving state...
Window state saved: {
  bounds: { x: 2880, y: 1405, width: 1280, height: 720 },
  isMaximized: false,
  isFullScreen: false,
  monitor: 0
}
Window ID 1: Hiding window...
Window ID 1: Sending 'hangup' message...
Window ID 1: Starting 5-second timer for destruction...
Window ID 2 'close' event triggered.
Window ID 2: Saving state...
Window state saved: {
  bounds: { x: 2880, y: 1405, width: 1280, height: 720 },
  isMaximized: false,
  isFullScreen: false,
  monitor: 0
}
Window ID 2: Hiding window...
Window ID 2: Sending 'hangup' message...
Window ID 2: Starting 5-second timer for destruction...
browser-window-focus 1
Window ID 1: 5-second timer elapsed. Destroying window.
Window ID 1 'closed' event.
Window ID 2: 5-second timer elapsed. Destroying window.
Window ID 2 'closed' event.
'window-all-closed': All windows are closed. Unregistering all shortcuts and quitting.
Application 'before-quit' event triggered.
'before-quit': No windows open, quitting normally.

ps

In new version I cannot see windows with video or select them like a normal application window, however obs sees them.

katoquro avatar May 08 '25 05:05 katoquro

Thank you for the bug report; screenshots and update on the recording issue.

I've went thru the errors and I don't see anything significant; those errors are generally for me during development and not intended to be user facing.

That JSON pop-up error is something unexpected - the code tries to search for Chrome extensions installed in Chrome, to make available if needed, but it can't find the manifest file for what it found it seems. Anyways, I'm hoping I can silence it / handle it better, as the error shouldn't be popping up.

As per the recordings failing I'm struggling to replicate the issue, but I have a Mint / Ubuntu linux vm setup to test with that I'll try to find time to poke at. I've not figured it out after a few hours of testing, so it might need to be more of a long-term investigation.

steveseguin avatar May 14 '25 18:05 steveseguin

My Ubuntu version is 22.04 Linux nuc 6.8.0-59-generic #61~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 15 17:03:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux and I run several elecaps in terminal inside bash script with next command, maybe something in combination of parameters.

...
for push in "${invite_push_values[@]}"; do
    $ec_bin -t "Stream${push}" -u "https://vdo.ninja/?view=${push}&solo&room=${room}&password=${password}&autorecord&record=0" &
    sleep 5
done

katoquro avatar May 15 '25 07:05 katoquro