Webrtc stream instead of camera feed ?
wardhanster opened this issue · 6 comments
Is there possibly a way to achieve that ? I was able to get demo up with tensor flow but the frame rates are really low, and In my research this module pops up ! - Amazing work guys !
Now because the detection API of the TF demo is exposed over http POST request, I have to resort to traditional pooling for object detection . which works but has serious framerate issues.
I am not sure how to do this over a socket and if TF is efficient enough to work with the requirements.
This brings to my next question - is there a way I can use webrtc API in the browser to a locally running server running node-yolo ?
Hi @wardhanster,
the easiest way to implement streaming is too use ffmpeg. What we tried is streaming results to a ffmpeg server like shown here https://github.com/moovel/node-yolo/blob/master/test/darknetImageFfmpegTest.js
ffmpeg server allows users to access and see the stream in the browser. Probably you can write an own frontend which connects to the ffmpeg server. See docs about the service https://www.ffmpeg.org/ffserver.html
I am not familiar with WebRTC to give any other hints.
Oh Okay , I will try that approach - I am not familiar with a lot of the things that you mentioned here.
also webrtc is extremely easy to implement on a local machine, something that might interest you in future.
I will try to implement this with webrtc and create a PR if things went well
How can use ffserver to process video from webcam and stream it at the same time?
I tried reading docs from fserver, but I just can't seem to decode the modified
chunks.
@tanmoy12 ffmpeg is capable of transforming raw chunks into the suitable format. See here https://github.com/moovel/node-yolo/blob/master/test/darknetTest.js#L17 the input is raw video in bgr24 and ffmpeg transforms it to the output format. Instead of the filename one can define a URL for a ffmpeg server which can then broadcast the stream.
I tried defining an URL like
'localhost:8080'
in place of
detected.mp4
Invalid error.
Do i have to define another child process for ffserver?