i would like to know if its possible to manipulate/proccess the video stream inside the node media server itself.
I have an ai model that takes frame, and return edited frame. i would like to apply real time video proccessing for the streamers. im currently using node-media-server.
I would love to know if it's possible, and if yes how can i proccess the frames through my ai model?
Thanks!!
const NodeMediaServer = require("node-media-server");
const httpConfig = {
port: 8000,
allow_origin: "*",
mediaroot: "./media",
};
const rtmpConfig = {
port: 1935,
chunk_size: 60000,
gop_cache: true,
ping: 10,
ping_timeout: 60,
};
const transformationConfig = {
ffmpeg: "./ffmpeg.exe",
tasks: [
{
app: "livetest",
hls: true,
hlsFlags: "[hls_time=2:hls_list_size=3:hls_flags=delete_segments]",
hlsKeep: false,
},
],
MediaRoot: "./media",
};
const config = {
http: httpConfig,
rtmp: rtmpConfig,
trans: transformationConfig,
};
const nms = new NodeMediaServer(config);
nms.run();
I have tried adding nms.on("prePublish" ... but without anyhelp!