jsmpeg
jsmpeg copied to clipboard
Upgrade Required
Running the jsmpeg as per your example produces an error via websocket, claiming Upgrade Required. This happens on two different machines, both my local linux mint 17.2 and my remote ubuntu 16.04 lts.
I've attempted to load an older ws module to attempt to bypass with no luck so far.
ffmpeg -f v4l2 -framerate 30 -video_size 640x360 -i /dev/video0 -f mpegts -codec:v mpeg1video -s 640x360 -b:v 1000k -bf 0 http://localhost:8081/password
node websocket-relay.js password 8081 8082
Listening for incomming MPEG-TS Stream on http://127.0.0.1:8081/
loaded/tested in current stable Chrome, Chromium and Firefox http://127.0.0.1:8082/view-stream.html Upgrade Required
node.js -v v10.4.1
package-lock.json
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"async-limiter": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
"integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg=="
},
"ws": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-5.2.1.tgz",
"integrity": "sha512-2NkHdPKjDBj3CHdnAGNpmlliryKqF+n9MYXX7/wsVC4yqYocKreKNjydPDvT3wShAZnndlM0RytEfTALCDvz7A==",
"requires": {
"async-limiter": "~1.0.0"
}
}
}
}
Your first two steps are correct, but the final step is a little off. The last step should be open "view-stream.html" from a standard Apache or nginx installation.
For example, you are on Mint/Ubuntu so install apache sudo apt install apache2 then copy the jsmpeg directory to /var/www/html/ and open "view-stream.html" in your browser: http://127.0.0.1/jsmpeg/view-stream.html