You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a basic test of the library working, it's great.
I wanted to move the receiver to a worker thread to free up resources on the main thread, but when I do I either get "No data received" timeouts on the receiver.video() call. The exact same code works fine and I receive streams when in the main thread.
Here's the code for "ndi_worker.js"
const{ workerData, parentPort }=require('worker_threads')constgrandiose=require('grandiose');console.log(grandiose.version(),grandiose.isSupportedCPU())asyncfunctionrun(){letsources=awaitgrandiose.find()console.log(sources);if(!sources.length)returnletreceiver=awaitgrandiose.receive({source: sources[0],});console.log(receiver)lettimeout=1000;// Optional timeout, default is 10000mswhile(true){try{letvideoFrame=awaitreceiver.video(timeout);//console.log(videoFrame);}catch(e){console.error(e);}}}run()
NewTek NDI Copyright (C)2015-2018 NewTek, inc. v3.5.9.0
NDI SDK WIN64 00:29:47 Jun 26 2018 3.5.9.0 true
Wait is 10000.
Find status is 1.
Destroying find carrier.
[
{ name: 'DESKTOP-P5UKCTA (OBS)', urlAddress: '130.63.209.196:5961' }
]
Completing some receive creation work.
{
embedded: [External: 17124ce13d0],
video: [Function: video],
audio: [Function: audio],
metadata: [Function: metadata],
data: [Function: data],
source: { name: 'DESKTOP-P5UKCTA (OBS)', urlAddress: '130.63.209.196:5961' },
colorFormat: 100,
bandwidth: 100,
allowVideoFields: true
}
No data received.
[Error: In file ... found error: No video data received
in the requested time interval.] {
code: '4040'
}
It's baffling why it would work on the main thread but not on a worker thread. Could there be something in the implementation that assumes main thread somehow?
The text was updated successfully, but these errors were encountered:
I have a basic test of the library working, it's great.
I wanted to move the receiver to a worker thread to free up resources on the main thread, but when I do I either get "No data received" timeouts on the receiver.video() call. The exact same code works fine and I receive streams when in the main thread.
Here's the code for "ndi_worker.js"
And to launch it:
Output:
It's baffling why it would work on the main thread but not on a worker thread. Could there be something in the implementation that assumes main thread somehow?
The text was updated successfully, but these errors were encountered: