cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1163
Views
0
Helpful
2
Replies

Auto stop content sharing if no faces detected

thombrooks
Level 1
Level 1

We have a group policy on Conference Room PCs which keeps their monitor output enabled all the time, so end users won't be confused when they try to present a sleeping PC and don't see an image without waking it up first.

 

The trade-off is that the constant signal from the PC (or a Mersive Solstice) keeps the system awake, so it never goes to sleep.

 

On newer systems which can count faces, I'd like to make a Macro which turns off Content Sharing under the following criteria:

 

- Not in a call;

- Currently presenting locally;

- No faces detected for arbitrary_fixed_number_of_seconds (user-determined);
  (If a face is detected, reset this counter)

 

What about systems which can't count faces - is Ultrasonic accurate enough to detect when the room has settled down? If so, is there a command to retrieve that data from a Macro?

 

Thank you!

 

2 Replies 2

thombrooks
Level 1
Level 1

 

Hey @Magnus Ohm - per our chat, here's what I have so far. Wondering if I should simplify this to only consider peoplePresence since my initial testing on a Room Kit system (running ce 9.9.2)  seemed to think there was always one face detected (room was empty, lights out, I was remote). Have others seen that 'false positive' behavior much?  (The camera guys told us there is an 'ignore even a picture of a face if it hasn't moved in ten minutes', so I'm confused about that.) Thank you!

 

// *s Standby State: Off
// *s Standby State: Standby

//*s Conference Presentation LocalInstance 1 SendingMode: LocalOnly
//*s Conference Presentation Mode: Off

const xapi = require('xapi');
const everyMinute = 60 * 1000; // In milliseconds
var emptyRoomPresentationMinuteCount = 0;

xapi.event.on('Conference Presentation LocalInstance 1 SendingMode: LocalOnly', (event) => {
	// start checking
	var timerId = setInterval(check_presentation, everyMinute);
});

xapi.event.on('Conference Presentation LocalInstance 1 (ghost=True)', (event) => {
	// stop checking
	clearInterval(timerId);
});

xapi.event.on('RoomAnalytics PeopleCount', (event) => {
	if (event.Current > 0) {
		emptyRoomPresentationMinuteCount = 0; // reset since we saw a face	
	}
});

xapi.event.on('RoomAnalytics PeoplePresence', (event) => {
	if (event === 'Yes') {
		emptyRoomPresentationMinuteCount = 0; // reset since we heard a person
	}
});

function check_presentation() {
	const p1 = xapi.status.get('RoomAnalytics PeopleCount Current', checkPeopleCount)
	.catch(console.log);
	const p2 = xapi.status.get('RoomAnalytics PeoplePresence', checkPeoplePresence)
	.catch(console.log);
//	const p3 = xapi.status.get('')

	Promise.all([p1, p2]).then(results => {
		const peopleCount = results[0];
		const peoplePresence = results[1];
		if (peopleCount < 1 && peoplePresence === 'No') {
			emptyRoomPresentationMinuteCount += 1;	

			if (emptyRoomPresentationMinuteCount > 5) {
				xapi.command('Presentation Stop');
				emptyRoomPresentationMinuteCount = 0; // reset since we stopped the presentation
			}
		}
		else
		{
			emptyRoomPresentationMinuteCount = 0;
			// we either heard or saw somebody
		}
	});
}

@Magnus Ohm @thombrooks  Where you able to get this working  ? i been trying this on Cisco Room Bar, it loads in fine but does nothing.