Recording jweb mediapipe video using script?

F_Dos's icon

I’m trying to record the camera input using jit.record while also using the jweb mediapipe module, but without success (I’m guessing only one destination can access the camera at a time).
Is there a way to record it to the computer using a script?

This post is a continuation of the previous post - after identifying the issue, I thought it would be better to open a new thread.

Source Audio's icon

look into ffmpeg suite

TFL's icon

As you noticed by yourself in your previous thread, you can definitely have the same camera used in [jweb] w/ mediapipe while recording it with [jit.grab] + [jit.record]. I just tested and it works, at least with one camera.

Your description of the problem seems more accurate in the previous thread:

I manage to make all 4 cameras work and also to record their output but then I cannot pass two of the camera via the jweb media pipe section. I'm getting an error

What is that error you get? Is it the same as that one?

F_Dos's icon

I'm sorry if not being clear.

I manage to make it work the following to scenarios:

1) recording all 4 cameras using jit.grab + jit.record - in this case I can't make the jweb mediapipe work. i'm getting error "Failed to acquire camera feed.."

2) recording 2 cameras using jit.grab + jit.record and using the other 2 cameras with the jweb mediapipe in order to do the eye tracking processing.

What I want to be able to make without success is to record all 4 camera as well to make eye tracking processing for 2 camera out of the 4 using the jweb mediapipe.

I hope this more clear of my situation.

What is that error you get? Is it the same as that one?


Yes

TFL's icon

That's indeed more clear! Sadly, I can't do further testing on my side since I only have one camera.

Could you try with just two cameras, both being recorded and used in mediapipe at the same time?

F_Dos's icon

Could you try with just two cameras, both being recorded and used in mediapipe at the same time?

Yes, but will do it only on Monday when will be in the place with the 4 cameras.

Rob Ramirez's icon

if on Windows, the OS prevents more than one application from accessing a single camera, which may be what you are experiencing. this is not unique to max or mediapipe, and i unfortunately do not know of any workarounds, except for duplicating feeds using Spout.

F_Dos's icon

if on Windows, the OS prevents more than one application from accessing a single camera, which may be what you are experiencing. this is not unique to max or mediapipe, and i unfortunately do not know of any workarounds, except for duplicating feeds using Spout.

Thanks for your answer. Yes I'm using Windows so it sounds that this is the problem I'm facing.

I will try source audio suggestion using "ffmpeg suite", or might will look as well to add recording into the js code (?) I asked chatgpt and this is an option he gave so I will look into that as well