An open API service indexing awesome lists of open source software.

https://github.com/andrewjbateman/javascript-webcam

:clipboard: integrate webcam into javascript app, using a server to host the webcam. Manipulate images using image-js
https://github.com/andrewjbateman/javascript-webcam

canvas css html image-js javascript javascript-webcam javascript30 repair tutorial-code

Last synced: 8 months ago
JSON representation

:clipboard: integrate webcam into javascript app, using a server to host the webcam. Manipulate images using image-js

Awesome Lists containing this project

README

          

# :zap: Javascript Webcam

* Javascript control of PC webcam with functions to manipulate image colours etc.
* **Note:** to open web links in a new window use: _ctrl+click on link_

![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/javascript-webcam?style=plastic)
![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/javascript-webcam?style=plastic)
![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/javascript-webcam?style=plastic)
![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/javascript-webcam?style=plastic)

## :page_facing_up: Table of contents

* [:zap: Javascript Webcam](#zap-javascript-webcam)
* [:page_facing_up: Table of contents](#page_facing_up-table-of-contents)
* [:books: General info](#books-general-info)
* [:camera: Screenshots](#camera-screenshots)
* [:signal_strength: Technologies](#signal_strength-technologies)
* [:floppy_disk: Setup](#floppy_disk-setup)
* [:computer: Code Examples](#computer-code-examples)
* [:cool: Features](#cool-features)
* [:clipboard: Status & To-Do List](#clipboard-status--to-do-list)
* [:clap: Inspiration](#clap-inspiration)
* [:file_folder: License](#file_folder-license)
* [:envelope: Contact](#envelope-contact)

## :books: General info

* Webcam in javascript app, using a local server to host the webcam.

## :camera: Screenshots

![Example screenshot](./img/webcam.png).
![Example screenshot](./img/server.png).

## :signal_strength: Technologies

* Ran in Google Chrome browser with: [Javascript engine V8 Windows (x64)](https://v8.dev/).
* [image-js](https://www.npmjs.com/package/image-js) advanced image processing and manipulation in JavaScript.

## :floppy_disk: Setup

* run 'npm i' to install 'browser-sync' package then type 'npm run start'.

## :computer: Code Examples

* function to get video stream data and play it.

```javascript
function getVideo() {
navigator.mediaDevices
.getUserMedia({ video: true, audio: false })
.then(localMediaStream => {
video.srcObject = localMediaStream;
video.play();
})
.catch(err => {
console.error(`oh no!!`, err);
});
}
```

## :cool: Features

* Updated as video.src is deprecated in Chrome Browser: video.srcObject is the new version.
* npm module image-js can manipulate images to change colours etc.

## :clipboard: Status & To-Do List

* Status: Working.
* To-Do: add more image filtering functions

## :clap: Inspiration

* Wes Bos Youtube Tutorial: [Unreal Webcam Fun with getUserMedia() and HTML5 Canvas - #JavaScript30 19/30](https://www.youtube.com/watch?v=ElWFcBlVk-o&list=PLu8EoSxDXHP6CGK4YVJhL_VWetA865GOH&index=19) but most of the Javascript has been superceded

## :file_folder: License

* N/A

## :envelope: Contact

* Repo created by [ABateman](https://github.com/AndrewJBateman), email: gomezbateman@yahoo.com