Update index.html
logo download
This commit is contained in:
+3
-5
@@ -5,14 +5,13 @@ ini_set('display_errors', 1);
|
|||||||
|
|
||||||
class WebcamManager {
|
class WebcamManager {
|
||||||
private $videoSrc = 'test_video.m3u8';
|
private $videoSrc = 'test_video.m3u8';
|
||||||
|
private $logoPath = 'logo.png';
|
||||||
public function displayWebcam() {
|
public function displayWebcam() {
|
||||||
return '<video id="webcam-player" controls autoplay muted></video>';
|
return '<video id="webcam-player" controls autoplay muted></video>';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function captureSnapshot() {
|
public function captureSnapshot() {
|
||||||
$outputFile = 'snapshot_' . date('YmdHis') . '.jpg';
|
$outputFile = 'snapshot_' . date('YmdHis') . '.jpg';
|
||||||
$command = "ffmpeg -i {$this->videoSrc} -vframes 1 -q:v 2 {$outputFile}";
|
$command = "ffmpeg -i {$this->videoSrc} -i {$this->logoPath} -filter_complex 'overlay=10:10' -vframes 1 -q:v 2 {$outputFile}";
|
||||||
|
|
||||||
exec($command, $output, $returnVar);
|
exec($command, $output, $returnVar);
|
||||||
|
|
||||||
@@ -29,7 +28,7 @@ class WebcamManager {
|
|||||||
|
|
||||||
public function captureVideoSequence($duration = 10) {
|
public function captureVideoSequence($duration = 10) {
|
||||||
$outputFile = 'sequence_' . date('YmdHis') . '.mp4';
|
$outputFile = 'sequence_' . date('YmdHis') . '.mp4';
|
||||||
$command = "ffmpeg -i {$this->videoSrc} -t {$duration} -c copy {$outputFile}";
|
$command = "ffmpeg -i {$this->videoSrc} -i {$this->logoPath} -filter_complex 'overlay=10:10' -t {$duration} -c:v libx264 -preset fast -crf 23 {$outputFile}";
|
||||||
|
|
||||||
exec($command, $output, $returnVar);
|
exec($command, $output, $returnVar);
|
||||||
|
|
||||||
@@ -51,7 +50,6 @@ class WebcamManager {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function getJavaScript() {
|
public function getJavaScript() {
|
||||||
|
|||||||
Reference in New Issue
Block a user