2

I'm currently trying a little project. I have a canvas I can draw in with simple strokes. Now I want to send this canvas content to a MPV player to receive it there, so something like a live stream of the canvas to another computer (in the same network), which receives the live stream via MPV.

I thought about using FFMPEG to send the live stream then, but the question is how..

I found WebRTC (click here) to be able to send a canvas to a peer connection as well as to a video element. Sending it to a video element also works fine, sending to a peer connection didn't work so far.

However I'm still not sure how to send it to FFMPEG or something else in order to receive it on another PC.

Other ideas are also welcome, its mainly about sending the live image of the canvas to another client with a static IP adress.

This, by the way, is the code I tried in order to send the canvas content to a video element:

var canvas = $('#can')[0];
var ctx = canvas.getContext('2d');
var stream = canvas.captureStream(60);

var video = $('#video')[0];
video.srcObject = stream;
nameless
  • 1,483
  • 5
  • 32
  • 78
  • WebRTC is P2P. Do you want to send this stream to only one other PC or to broadcast it ? To grab it from ffmpeg, you would need to install an RTC client on your server. But an gateway like janus might help you. Bit anyway, dealing with CanvasStream is no different than dealing with MediaStream, and I would be rather surprised that there is not yet an question asking exactly this – Kaiido Jun 23 '17 at 09:33
  • @Kaiido In the end, I want to send it to a Multicast Stream most propably, but first I want to send it so a single PC. I couldn't find a question like this so far... – nameless Jun 23 '17 at 10:07

0 Answers0