From 217594bb340afa6e98449624e7c7b2175e77bff4 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sun, 21 Mar 2021 10:23:57 -0400 Subject: from last. tweaks to uploading video screengrabs. --- src/client/views/nodes/ScreenshotBox.tsx | 1 - src/server/DashUploadUtils.ts | 15 ++++++++------- src/server/SharedMediaTypes.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') 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 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"]; } -- cgit v1.2.3-70-g09d2