Is it possible to run jsmpeg in nodejs and access each frame?
I think the possible ways are:
1) I tried modifying jsmpeg v0.2 to emulate DOM environment through jsdom
it failed with the error 'MaybeClampedUint8Array is not a constructor'. Maybe it seems that window object backed by jsdom doesn't support uint8array.
/home/janggwan/Desktop/Dev/node-rtsp-stream-es6/node_modules/jsmpeg/jsmpg.js:765
this.currentY = new MaybeClampedUint8Array(this.codedSize);
^
TypeError: MaybeClampedUint8Array is not a constructor
at module.exports.jsmpeg.initBuffers (/home/janggwan/Desktop/Dev/node-rtsp-stream-es6/node_modules/jsmpeg/jsmpg.js:765:18)
the corresponding code is in jsmpg.js
// Manually clamp values when writing macroblocks for shitty browsers
// that don't support Uint8ClampedArray
var MaybeClampedUint8Array = window.Uint8ClampedArray || window.Uint8Array;
if (!window.Uint8ClampedArray) {
this.copyBlockToDestination = this.copyBlockToDestinationClamp;
this.addBlockToDestination = this.addBlockToDestinationClamp;
}
// Allocated buffers and resize the canvas
this.currentY = new MaybeClampedUint8Array(this.codedSize);
this.currentY32 = new Uint32Array(this.currentY.buffer);
2) try it using 'node-rtsp-stream-es6' module, and decode mpeg1 stream manually in the client code.
(it leveraged jsmpeg v0.2)
Has there been any progress on this? I'm just looking to do some server-side demuxing and thought this sounded promising, but I haven't found any examples of anybody doing this.
Is it possible to run jsmpeg in nodejs and access each frame?
I think the possible ways are: 1) I tried modifying jsmpeg v0.2 to emulate DOM environment through jsdom
the corresponding code is in jsmpg.js
2) try it using 'node-rtsp-stream-es6' module, and decode mpeg1 stream manually in the client code. (it leveraged jsmpeg v0.2)
https://github.com/Janggwan/node-rtsp-stream-es6
How do I manually decode jsmpeg v0.2 stream?
3) Is there a way to do it with jsmpeg master branch?
It seems that functions for accessing each frame disappeared.