phoboslab / jsmpeg

MPEG1 Video Decoder in JavaScript
MIT License
6.35k stars 1.43k forks source link

A few questions #312

Closed HenkHull closed 5 years ago

HenkHull commented 5 years ago

1) when I try to record a hardware accelerated window using MPEG on windows using gdigrab it returns records a black video. I tried using OBS and it does work although seems abit overkill for what I want it for -- though not that bad. Has anyone had any luck doing the same?

2) Is it possible to draw part of the video (IE only 25% of the screen or whatever -- looks like it using openGL.js). Imagine 4 player split screen but I only want to show "one player".

3) When I was doing some testing on, using "too high of a bitrate" I found that my video was behind creating latency, possibly the "interval frames". I need to keep latency low-sub-second.

phoboslab commented 5 years ago
  1. I did this a while ago with jsmpeg-vnc. See the grabber.c. Keep in mind that GDI is slow for larger resolutions.

  2. Yes. You can first draw the video into an offscreen canvas and then only draw a portion of that offscreen canvas on your screen.

  3. This could be a number of things. Probably network congestion!?

HenkHull commented 5 years ago

1) Can we pipe the output from jsmpeg-vnc.exe to the jsmpeg player (rather then the jsmpeg-vnc player)? I need to be able to have multiple instances of the app running. So multiple "rooms", imagine if I wanted to have 4 player mario kart (lets say) and multiple matches.

2) What do you think would be the best way of scaling this up, lets say if you wanted hundreds or thousands of instances running at the same time? I mean amazon AWS servers would be insanely expensive

phoboslab commented 5 years ago
  1. Not without modifying jsmpeg-vnc. It currently uses an older jsmpeg player version with a custom wrapper protocol for the video stream. It needs to send MPEG-TS packets instead to work with the current jsmpeg player version.

  2. Not sure what you want to do. Distributing the video streams is not very compute intensive. You can easily serve ~200 clients on a modest server. At AWS you'd be mostly paying for the bandwidth. Try http://hetzner.de for cheap servers.

HenkHull commented 5 years ago

Okay even the VNC recorder doesnt seem to work. Maybe it has something to do with unity

BelleNottelling commented 5 years ago

@HenkHull That issue is fixed by using a different capturing method, specifically the desktop duplication API. Work for that is done here: https://github.com/Integrated-Media/jsmpeg-vnc/

HenkHull commented 5 years ago

Okay it probably has something to do with the newest version of unity, I was able to make it work using the game dusk.