Mjpeg-Server in RaspPi cockpit:where is mjpeg-server's 'output_ws.so' file?



This is what I have done so far:

  1. Using a NOOBS Jessie system dated Mar. 2017.

  2. Added “sudo modprobe bcm2835-v4l2” to /etc/rc.local
    to allow raspi camera to be accessible as /dev/video0

  3. git clone https://github.com/OpenROV/openrov-cockpit.git
    cd openrov-cockpit
    npm run deploy:prod

  4. Using this cmd line worked through the following issues.
    sudo PLATFORM=raspberrypi LOG_LEVEL=debug node src/cockpit > cockpit.log

  5. Error: Cannot find module 'mjpeg-video-server’
    So I did:
    cd …src/plugins/mjpeg-video
    npm install mjpeg-video-server

  6. Error: Cannot find module 'nedb’
    So I did:
    cd plugins/notifications/
    npm install nedb

  7. Error: ENOENT: no such file or directory, stat ‘/home/pi/openrov-cockpit/src/plugins/peer-view/node_modules/msgpack-lite/dist/msgpack.min.js’ at Error (native)
    Error: ENOENT: no such file or directory, stat '/home/pi/openrov-cockpit/src/plugins/peer-view/node_modules/simple-peer/simplepeer.min.js’
    at Error (native)
    So I did:
    cd src/plugins/peer-view
    npm install simple-peer
    npm install msgpack-lite

  8. error Could not find serial number for camera[/dev/video0]: Cannot read property ‘1’ of null\n",“v”:1}
    So I mucked with the code in vim src/plugins/mjpeg-video/node_modules/mjpeg-video-server/lib/Supervisor.js around line 270 to return a camera serial number of ‘Camera0’ rather than reading the camera special file.

  9. then couldn’t fine mjpg_streamer
    So I found the posting https://blog.miguelgrinberg.com/post/how-to-build-and-run-mjpg-streamer-on-the-raspberry-pi
    and followed the directions for installing mjpg_streamer

  10. But, doesn’t work and seems to be based around the spawning of the server. In particular this code near line 108 of

       // Uses SSL
       return [
           "nice", "--19",
           "-i", `input_uvc.so -r ${this.settings.resolution} -f ${this.settings.framerate} -d ${this.devicePath}`,
           "-o", `output_ws.so -p ${this.wsPort} -s -c ${this.sslInfo.certPath} -k ${this.sslInfo.keyPath}`


There is no plugin called ‘output_ws.so’. I searched and searched the web and not found it. I even brought down BrianAdams mjpg-streamer and not found it

Thanks for guidance.


I don’t know if you are still seeking a solution but after a fair amount of searching I was able to find output_ws. I also found an input_raspicam plugin that will directly stream mjpeg from a Raspberry Pi camera (rather than a USB/UVC one). So here are the steps

To get the modified mjpg_streamer with the raspicam plug in, I retrieved and built the git repository:

This is well documented and you should be able to build it without issue.
To find the magical output_ws plugin you need this git repository:

In case you are wondering, “ws” means “websocket”. To build, I just took the open_ws directory and put it in the mjpg_streamer that had the input_raspicam plugin and modified its CMakelist.txt

You will need to download and build libuv, openssl, zlib and then uWebSockets (https://github.com/uWebSockets/uWebSockets) to build output_ws
You may need to alter your include and lib search paths to get the builds to work.
Once it is all built and installed, output_ws.so can be used.
I hope this helps!