aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/constants.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-02-11 10:51:33 +0100
committerChocobozzz <chocobozzz@cpy.re>2022-02-28 10:42:19 +0100
commitc729caf6cc34630877a0e5a1bda1719384cd0c8a (patch)
tree1d2e13722e518c73d2c9e6f0969615e29d51cf8c /server/initializers/constants.ts
parenta24bf4dc659cebb65d887862bf21d7a35e9ec791 (diff)
downloadPeerTube-c729caf6cc34630877a0e5a1bda1719384cd0c8a.tar.gz
PeerTube-c729caf6cc34630877a0e5a1bda1719384cd0c8a.tar.zst
PeerTube-c729caf6cc34630877a0e5a1bda1719384cd0c8a.zip
Add basic video editor support
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r--server/initializers/constants.ts22
1 files changed, 21 insertions, 1 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 9b972b87e..4d2a6fc63 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -152,6 +152,7 @@ const JOB_ATTEMPTS: { [id in JobType]: number } = {
152 'activitypub-refresher': 1, 152 'activitypub-refresher': 1,
153 'video-redundancy': 1, 153 'video-redundancy': 1,
154 'video-live-ending': 1, 154 'video-live-ending': 1,
155 'video-edition': 1,
155 'move-to-object-storage': 3 156 'move-to-object-storage': 3
156} 157}
157// Excluded keys are jobs that can be configured by admins 158// Excluded keys are jobs that can be configured by admins
@@ -168,6 +169,7 @@ const JOB_CONCURRENCY: { [id in Exclude<JobType, 'video-transcoding' | 'video-im
168 'activitypub-refresher': 1, 169 'activitypub-refresher': 1,
169 'video-redundancy': 1, 170 'video-redundancy': 1,
170 'video-live-ending': 10, 171 'video-live-ending': 10,
172 'video-edition': 1,
171 'move-to-object-storage': 1 173 'move-to-object-storage': 1
172} 174}
173const JOB_TTL: { [id in JobType]: number } = { 175const JOB_TTL: { [id in JobType]: number } = {
@@ -178,6 +180,7 @@ const JOB_TTL: { [id in JobType]: number } = {
178 'activitypub-cleaner': 1000 * 3600, // 1 hour 180 'activitypub-cleaner': 1000 * 3600, // 1 hour
179 'video-file-import': 1000 * 3600, // 1 hour 181 'video-file-import': 1000 * 3600, // 1 hour
180 'video-transcoding': 1000 * 3600 * 48, // 2 days, transcoding could be long 182 'video-transcoding': 1000 * 3600 * 48, // 2 days, transcoding could be long
183 'video-edition': 1000 * 3600 * 10, // 10 hours
181 'video-import': 1000 * 3600 * 2, // 2 hours 184 'video-import': 1000 * 3600 * 2, // 2 hours
182 'email': 60000 * 10, // 10 minutes 185 'email': 60000 * 10, // 10 minutes
183 'actor-keys': 60000 * 20, // 20 minutes 186 'actor-keys': 60000 * 20, // 20 minutes
@@ -351,6 +354,10 @@ const CONSTRAINTS_FIELDS = {
351 }, 354 },
352 COMMONS: { 355 COMMONS: {
353 URL: { min: 5, max: 2000 } // Length 356 URL: { min: 5, max: 2000 } // Length
357 },
358 VIDEO_EDITOR: {
359 TASKS: { min: 1, max: 10 }, // Number of tasks
360 CUT_TIME: { min: 0 } // Value
354 } 361 }
355} 362}
356 363
@@ -365,6 +372,7 @@ const VIDEO_TRANSCODING_FPS: VideoTranscodingFPS = {
365 MIN: 1, 372 MIN: 1,
366 STANDARD: [ 24, 25, 30 ], 373 STANDARD: [ 24, 25, 30 ],
367 HD_STANDARD: [ 50, 60 ], 374 HD_STANDARD: [ 50, 60 ],
375 AUDIO_MERGE: 25,
368 AVERAGE: 30, 376 AVERAGE: 30,
369 MAX: 60, 377 MAX: 60,
370 KEEP_ORIGIN_FPS_RESOLUTION_MIN: 720 // We keep the original FPS on high resolutions (720 minimum) 378 KEEP_ORIGIN_FPS_RESOLUTION_MIN: 720 // We keep the original FPS on high resolutions (720 minimum)
@@ -434,7 +442,8 @@ const VIDEO_STATES: { [ id in VideoState ]: string } = {
434 [VideoState.LIVE_ENDED]: 'Livestream ended', 442 [VideoState.LIVE_ENDED]: 'Livestream ended',
435 [VideoState.TO_MOVE_TO_EXTERNAL_STORAGE]: 'To move to an external storage', 443 [VideoState.TO_MOVE_TO_EXTERNAL_STORAGE]: 'To move to an external storage',
436 [VideoState.TRANSCODING_FAILED]: 'Transcoding failed', 444 [VideoState.TRANSCODING_FAILED]: 'Transcoding failed',
437 [VideoState.TO_MOVE_TO_EXTERNAL_STORAGE_FAILED]: 'External storage move failed' 445 [VideoState.TO_MOVE_TO_EXTERNAL_STORAGE_FAILED]: 'External storage move failed',
446 [VideoState.TO_EDIT]: 'To edit*'
438} 447}
439 448
440const VIDEO_IMPORT_STATES: { [ id in VideoImportState ]: string } = { 449const VIDEO_IMPORT_STATES: { [ id in VideoImportState ]: string } = {
@@ -855,6 +864,16 @@ const FILES_CONTENT_HASH = {
855 864
856// --------------------------------------------------------------------------- 865// ---------------------------------------------------------------------------
857 866
867const VIDEO_FILTERS = {
868 WATERMARK: {
869 SIZE_RATIO: 1 / 10,
870 HORIZONTAL_MARGIN_RATIO: 1 / 20,
871 VERTICAL_MARGIN_RATIO: 1 / 20
872 }
873}
874
875// ---------------------------------------------------------------------------
876
858export { 877export {
859 WEBSERVER, 878 WEBSERVER,
860 API_VERSION, 879 API_VERSION,
@@ -893,6 +912,7 @@ export {
893 PLUGIN_GLOBAL_CSS_FILE_NAME, 912 PLUGIN_GLOBAL_CSS_FILE_NAME,
894 PLUGIN_GLOBAL_CSS_PATH, 913 PLUGIN_GLOBAL_CSS_PATH,
895 PRIVATE_RSA_KEY_SIZE, 914 PRIVATE_RSA_KEY_SIZE,
915 VIDEO_FILTERS,
896 ROUTE_CACHE_LIFETIME, 916 ROUTE_CACHE_LIFETIME,
897 SORTABLE_COLUMNS, 917 SORTABLE_COLUMNS,
898 HLS_STREAMING_PLAYLIST_DIRECTORY, 918 HLS_STREAMING_PLAYLIST_DIRECTORY,