mirror of
https://github.com/koush/scrypted.git
synced 2026-03-20 16:40:24 +00:00
snapshot: use internal prebuffer converter rather than media manager
This commit is contained in:
2
plugins/snapshot/.vscode/settings.json
vendored
2
plugins/snapshot/.vscode/settings.json
vendored
@@ -1,4 +1,4 @@
|
||||
|
||||
{
|
||||
"scrypted.debugHost": "koushik-windows",
|
||||
"scrypted.debugHost": "127.0.0.1",
|
||||
}
|
||||
4
plugins/snapshot/package-lock.json
generated
4
plugins/snapshot/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/snapshot",
|
||||
"version": "0.2.14",
|
||||
"version": "0.2.15",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/snapshot",
|
||||
"version": "0.2.14",
|
||||
"version": "0.2.15",
|
||||
"dependencies": {
|
||||
"@koush/axios-digest-auth": "^0.8.5",
|
||||
"@types/node": "^18.16.18",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/snapshot",
|
||||
"version": "0.2.14",
|
||||
"version": "0.2.15",
|
||||
"description": "Snapshot Plugin for Scrypted",
|
||||
"scripts": {
|
||||
"scrypted-setup-project": "scrypted-setup-project",
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import fs from 'fs';
|
||||
import { addVideoFilterArguments } from '@scrypted/common/src/ffmpeg-helpers';
|
||||
import { ffmpegLogInitialOutput, safeKillFFmpeg, safePrintFFmpegArguments } from '@scrypted/common/src/media-helpers';
|
||||
import { timeoutFunction } from '@scrypted/common/src/promise-utils';
|
||||
import { sleep } from '@scrypted/common/src/sleep';
|
||||
import child_process, { ChildProcess } from 'child_process';
|
||||
import { once } from 'events';
|
||||
import { Writable } from 'stream';
|
||||
import { Pipe2Jpeg } from './pipe2jpeg';
|
||||
import { timeoutFunction } from '@scrypted/common/src/promise-utils';
|
||||
|
||||
export interface FFmpegImageFilterOptions {
|
||||
console?: Console,
|
||||
|
||||
@@ -176,7 +176,12 @@ class SnapshotMixin extends SettingsMixinDeviceBase<Camera> implements Camera {
|
||||
request.refresh = false;
|
||||
takePrebufferPicture = async () => {
|
||||
// this.console.log('snapshotting active prebuffer');
|
||||
return mediaManager.convertMediaObjectToBuffer(await realDevice.getVideoStream(request), 'image/jpeg');
|
||||
const ffmpegInput = await sdk.mediaManager.convertMediaObjectToJSON<FFmpegInput>(await realDevice.getVideoStream(request), ScryptedMimeTypes.FFmpegInput);
|
||||
return ffmpegFilterImage(ffmpegInput.inputArguments, {
|
||||
console: this.debugConsole,
|
||||
ffmpegPath: await mediaManager.getFFmpegPath(),
|
||||
timeout: 10000,
|
||||
});
|
||||
};
|
||||
return takePrebufferPicture;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user