aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/ScreenshotBox.tsx1
-rw-r--r--src/server/DashUploadUtils.ts15
-rw-r--r--src/server/SharedMediaTypes.ts2
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"];
}