]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/constants.ts
Fix migration and test
[github/Chocobozzz/PeerTube.git] / server / initializers / constants.ts
index 79e6a744c27a0110c7d050e1c4449fc02500bd7e..6c44d703e78813510ea410ccd596b540f2cc4c73 100644 (file)
@@ -24,7 +24,7 @@ import { CONFIG, registerConfigChangedHandler } from './config'
 
 // ---------------------------------------------------------------------------
 
-const LAST_MIGRATION_VERSION = 555
+const LAST_MIGRATION_VERSION = 560
 
 // ---------------------------------------------------------------------------
 
@@ -291,7 +291,7 @@ const CONSTRAINTS_FIELDS = {
     PRIVATE_KEY: { min: 10, max: 5000 }, // Length
     URL: { min: 3, max: 2000 }, // Length
     AVATAR: {
-      EXTNAME: [ '.png', '.jpeg', '.jpg' ],
+      EXTNAME: [ '.png', '.jpeg', '.jpg', '.gif' ],
       FILE_SIZE: {
         max: 2 * 1024 * 1024 // 2MB
       }
@@ -336,6 +336,17 @@ const VIDEO_TRANSCODING_FPS: VideoTranscodingFPS = {
   KEEP_ORIGIN_FPS_RESOLUTION_MIN: 720 // We keep the original FPS on high resolutions (720 minimum)
 }
 
+const VIDEO_TRANSCODING_ENCODERS = {
+  VIDEO: [ 'libx264' ],
+
+  // Try the first one, if not available try the second one etc
+  AUDIO: [
+    // we favor VBR, if a good AAC encoder is available
+    'libfdk_aac',
+    'aac'
+  ]
+}
+
 const DEFAULT_AUDIO_RESOLUTION = VideoResolution.H_480P
 
 const VIDEO_RATE_TYPES: { [ id: string ]: VideoRateType } = {
@@ -804,6 +815,7 @@ export {
   ACTOR_FOLLOW_SCORE,
   PREVIEWS_SIZE,
   REMOTE_SCHEME,
+  VIDEO_TRANSCODING_ENCODERS,
   FOLLOW_STATES,
   DEFAULT_USER_THEME_NAME,
   SERVER_ACTOR_NAME,