Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

#5618 - added configuration fields for Thumbnails and Previews, if no config is provided, the previous, default values are configured

Gergo Bogdan3fbe84918392
diff --git a/config/default.yaml b/config/default.yaml
index d2e69030d7..bfae6490f8 100644
--- a/config/default.yaml
+++ b/config/default.yaml
@@ -469,6 +469,16 @@ thumbnails:
# Increasing this value will increase CPU and memory usage when generating the thumbnail, especially for high video resolution
# Minimum value is 2
frames_to_analyze: 50
+ size:
+ width: 280
+ height: 157
+ min_width: 150
+
+previews:
+ size:
+ width: 850
+ height: 480
+ min_width: 400
stats:
# Display registration requests stats (average response time, total requests...)
diff --git a/server/core/initializers/config.ts b/server/core/initializers/config.ts
index be8e779108..0e1ea1411a 100644
--- a/server/core/initializers/config.ts
+++ b/server/core/initializers/config.ts
@@ -371,6 +371,18 @@ const CONFIG = {
THUMBNAILS: {
GENERATION_FROM_VIDEO: {
FRAMES_TO_ANALYZE: config.get<number>('thumbnails.generation_from_video.frames_to_analyze')
+ },
+ SIZE: {
+ WIDTH: config.get<number>('thumbnails.size.width'),
+ HEIGHT: config.get<number>('thumbnails.size.height'),
+ MIN_WIDTH: config.get<number>('thumbnails.size.min_width'),
+ }
+ },
+ PREVIEWS: {
+ SIZE: {
+ WIDTH: config.get<number>('previews.size.width'),
+ HEIGHT: config.get<number>('previews.size.height'),
+ MIN_WIDTH: config.get<number>('previews.size.min_width'),
}
},
STATS: {
diff --git a/server/core/initializers/constants.ts b/server/core/initializers/constants.ts
index 181169a50d..e0a3cecb0e 100644
--- a/server/core/initializers/constants.ts
+++ b/server/core/initializers/constants.ts
@@ -903,14 +903,14 @@ const STATIC_MAX_AGE = {
// Videos thumbnail size
const THUMBNAILS_SIZE = {
- width: 280,
- height: 157,
- minWidth: 150
+ width: CONFIG.THUMBNAILS.SIZE.WIDTH || 280,
+ height: CONFIG.THUMBNAILS.SIZE.HEIGHT || 157,
+ minWidth: CONFIG.THUMBNAILS.SIZE.MIN_WIDTH || 150
}
const PREVIEWS_SIZE = {
- width: 850,
- height: 480,
- minWidth: 400
+ width: CONFIG.PREVIEWS.SIZE.WIDTH || 850,
+ height: CONFIG.PREVIEWS.SIZE.HEIGHT || 480,
+ minWidth: CONFIG.PREVIEWS.SIZE.MIN_WIDTH || 400
}
const ACTOR_IMAGES_SIZE: { [key in ActorImageType_Type]: { width: number, height: number }[] } = {
[ActorImageType.AVATAR]: [ // 1/1 ratio