diff options
author | bobzel <zzzman@gmail.com> | 2021-03-21 10:23:57 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-03-21 10:23:57 -0400 |
commit | 217594bb340afa6e98449624e7c7b2175e77bff4 (patch) | |
tree | 9186f8abd62f4c120d48a2fcd34445ffe1b8bd77 /src | |
parent | 72631204e8ed6cfa230fd623eb02d5217efe3b04 (diff) |
from last. tweaks to uploading video screengrabs.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/ScreenshotBox.tsx | 1 | ||||
-rw-r--r-- | src/server/DashUploadUtils.ts | 15 | ||||
-rw-r--r-- | src/server/SharedMediaTypes.ts | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/client/views/nodes/ScreenshotBox.tsx b/src/client/views/nodes/ScreenshotBox.tsx index 0a62a8de1..087a1be7a 100644 --- a/src/client/views/nodes/ScreenshotBox.tsx +++ b/src/client/views/nodes/ScreenshotBox.tsx @@ -166,7 +166,6 @@ export class ScreenshotBox extends ViewBoxBaseComponent<FieldViewProps, Screensh this.dataDoc.type = DocumentType.VID; this.layoutDoc.layout = VideoBox.LayoutString(this.fieldKey); this.dataDoc[this.props.fieldKey] = new VideoField(Utils.prepend(result.accessPaths.agnostic.client)); - console.log(this.props.Document[this.props.fieldKey]); } else alert("video conversion failed"); }; this._recorder.start(); diff --git a/src/server/DashUploadUtils.ts b/src/server/DashUploadUtils.ts index 5f329094d..e2c0e7ac9 100644 --- a/src/server/DashUploadUtils.ts +++ b/src/server/DashUploadUtils.ts @@ -63,7 +63,7 @@ export namespace DashUploadUtils { const category = types[0]; let format = `.${types[1]}`; - console.log(green(`Processing upload of file (${name}) and form (${format}) with upload type (${type}) in category (${category}).`)); + console.log(green(`Processing upload of file (${name}) and format (${format}) with upload type (${type}) in category (${category}).`)); switch (category) { case "image": @@ -72,13 +72,14 @@ export namespace DashUploadUtils { return { source: file, result }; } case "video": + if (format.includes("x-matroska")) { + await new Promise(res => ffmpeg(file.path) + .videoCodec("copy") // this will copy the data instead of reencode it + .save(file.path.replace(".mkv", ".mp4")).on('end', () => res())); + file.path = file.path.replace(".mkv", ".mp4"); + format = ".mp4"; + } if (videoFormats.includes(format)) { - if (format.includes("x-matroska")) { - await new Promise(res => ffmpeg(file.path) - .videoCodec("copy") // this will copy the data instead or reencode it - .save(file.path.replace(".mkv", ".mp4")).on('end', () => res())); - file.path = file.path.replace(".mkv", ".mp4"); - } return MoveParsedFile(file, Directory.videos); } case "application": diff --git a/src/server/SharedMediaTypes.ts b/src/server/SharedMediaTypes.ts index 0c823b8fc..fdc65188f 100644 --- a/src/server/SharedMediaTypes.ts +++ b/src/server/SharedMediaTypes.ts @@ -8,7 +8,7 @@ export namespace AcceptableMedia { export const webps = [".webp"]; export const tiffs = [".tiff"]; export const imageFormats = [...pngs, ...jpgs, ...gifs, ...webps, ...tiffs]; - export const videoFormats = [".mov", ".mp4", ".quicktime", ".x-matroska;codecs=avc1"]; + export const videoFormats = [".mov", ".mp4", ".quicktime", ".mkv", ".x-matroska;codecs=avc1"]; export const applicationFormats = [".pdf"]; export const audioFormats = [".wav", ".mp3", ".mpeg", ".flac", ".au", ".aiff", ".m4a", ".webm"]; } |