-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/light-adjustment-2023.2.0'
- Loading branch information
Showing
8 changed files
with
100 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Media Processors: ライト調整 + 仮想背景</title> | ||
</head> | ||
<body> | ||
<h1>Media Processors: ライト調整 + 仮想背景</h1> | ||
|
||
<h2>左: 処理後の映像、右: オリジナル映像</h2> | ||
<video id="processedVideo" muted autoplay playsinline></video> | ||
<video id="originalVideo" muted autoplay playsinline></video> | ||
|
||
<script src="./light-adjustment/light_adjustment.js"></script> | ||
<script src="./virtual-background/virtual_background.js"></script> | ||
<script> | ||
if (!Shiguredo.VirtualBackgroundProcessor.isSupported() || !Shiguredo.LightAdjustmentProcessor.isSupported()) { | ||
alert("Unsupported platform"); | ||
throw Error("Unsupported platform"); | ||
} | ||
|
||
function getUserMedia() { | ||
const constraints = { | ||
width: 320, | ||
height: 240, | ||
}; | ||
return navigator.mediaDevices.getUserMedia({video: constraints}); | ||
} | ||
|
||
getUserMedia().then(async (stream) => { | ||
const lightAdjustmentProcessor = new Shiguredo.LightAdjustmentProcessor(); | ||
const virtualBackgroundProcessor = new Shiguredo.VirtualBackgroundProcessor("./virtual-background/"); | ||
|
||
const originalTrack = stream.getVideoTracks()[0]; | ||
const processedTrack0 = await lightAdjustmentProcessor.startProcessing(originalTrack); | ||
const processedTrack1 = await virtualBackgroundProcessor.startProcessing(processedTrack0, {blurRadius: 5}); | ||
|
||
document.getElementById("originalVideo").srcObject = new MediaStream([originalTrack]); | ||
document.getElementById("processedVideo").srcObject = new MediaStream([processedTrack1]); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters