You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.1 KiB
47 lines
1.1 KiB
// lib/media.js
|
|
// Copyright (C) 2024 DTP Technologies, LLC
|
|
// All Rights Reserved
|
|
|
|
'use strict';
|
|
|
|
import mongoose from 'mongoose';
|
|
const Schema = mongoose.Schema;
|
|
|
|
const VIDEO_STATUS_LIST = [
|
|
'new', // the video (original) is on storage / queued
|
|
'processing', // the video is being processed for distribution
|
|
'live', // the video is available for distribution
|
|
'removed', // the video has been removed
|
|
];
|
|
|
|
const VideoMetadataSchema = new Schema({
|
|
type: { type: String },
|
|
size: { type: Number },
|
|
bitRate: { type: Number },
|
|
duration: { type: Number },
|
|
video: {
|
|
width: { type: Number },
|
|
height: { type: Number },
|
|
fps: { type: Number },
|
|
},
|
|
});
|
|
|
|
const AudioMetadataSchema = new Schema({
|
|
type: { type: String },
|
|
size: { type: Number },
|
|
bitRate: { type: Number },
|
|
duration: { type: Number },
|
|
audio: {
|
|
codecName: { type: String },
|
|
sampleFormat: { type: String },
|
|
sampleRate: { type: Number },
|
|
bitsPerSample: { type: Number },
|
|
channelCount: { type: Number },
|
|
},
|
|
});
|
|
|
|
export {
|
|
VIDEO_STATUS_LIST,
|
|
VideoMetadataSchema,
|
|
AudioMetadataSchema,
|
|
};
|