Skip to content

yoga1290/ffmpeg-usermedia-experiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What's this?

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

Environment

Install

  • npm i from the project directory

Run

  • npm start: to start the express server
  • Open http://localhost:3000 in Firefox or Chrome, and accept the webcam access dialog.

Stream to Web browser

  • Open http://localhost:3000/view from web browser to stream

Passing stream to FFmpeg (chunked)

  • 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 in node_modules/@ffmpeg-installer/linux-x64/ffmpeg (which may differ depending on your OS)
    • note, -- is used to pass flags

Passing stream to FFmpeg (range-request)

  • npm run ffmpeg -- -i http://localhost:3000/view output.webm: TODO: this doesn't output the full stream to FFmpeg
    • http://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 in node_modules/@ffmpeg-installer/linux-x64/ffmpeg (which may differ depending on your OS)
    • note, -- is used to pass flags

About

Experiment to pass HTML5 MediaStrem to FFMPEG thru Express endpoint

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published