This is an experiment which aims to capture HTML5 MediaStream
coming from a web browser webcam, pass it to Express server through a Socket.IO namespace which will be buffered and stream through Express endpoint in form of HTTP partial/range requests
- FireFox or Chrome (but not Safari)
- Node & NPM
npm i
from the project directory
npm start
: to start the express server- Open
http://localhost:3000
in Firefox or Chrome, and accept the webcam access dialog.
- Open
http://localhost:3000/view
from web browser to stream
npm run ffmpeg -- -i http://localhost:3000/chunked output.webm
:http://localhost:3000/chunked
will be visible once it was opened in Firefox/Chrome and they'll keep requesting till the end of stream or server down.- note,
npm run ffmpeg -- ...
is a just a shortcut to ffmpeg executable dependency which should be installed at startup innode_modules/@ffmpeg-installer/linux-x64/ffmpeg
(which may differ depending on your OS) - note,
--
is used to pass flags
npm run ffmpeg -- -i http://localhost:3000/view output.webm
: TODO: this doesn't output the full stream to FFmpeghttp://localhost:3000/view
will be visible once it was opened in Firefox/Chrome and they'll keep requesting till the end of stream or server down.- note,
npm run ffmpeg -- ...
is a just a shortcut to ffmpeg executable dependency which should be installed at startup innode_modules/@ffmpeg-installer/linux-x64/ffmpeg
(which may differ depending on your OS) - note,
--
is used to pass flags