This commit is contained in:
2025-11-08 19:41:20 +03:00
commit c4c13268c5
16 changed files with 1966 additions and 0 deletions

45
src/profiles.ts Normal file
View File

@@ -0,0 +1,45 @@
import type { VideoProfile } from './types';
/**
* Default video quality profiles
*/
export const DEFAULT_PROFILES: VideoProfile[] = [
{
name: '1080p',
width: 1920,
height: 1080,
videoBitrate: '5000k',
audioBitrate: '256k'
},
{
name: '720p',
width: 1280,
height: 720,
videoBitrate: '3000k',
audioBitrate: '256k'
},
{
name: '480p',
width: 854,
height: 480,
videoBitrate: '1500k',
audioBitrate: '256k'
},
{
name: '360p',
width: 640,
height: 360,
videoBitrate: '800k',
audioBitrate: '256k'
}
];
/**
* Select appropriate profiles based on input video resolution
*/
export function selectProfiles(inputWidth: number, inputHeight: number): VideoProfile[] {
return DEFAULT_PROFILES.filter(profile => {
return profile.width <= inputWidth && profile.height <= inputHeight;
});
}