Bläddra i källkod

Update docs and CHANGELOG

DarthSim 1 år sedan
förälder
incheckning
c200fc2a0a
4 ändrade filer med 49 tillägg och 2 borttagningar
  1. 6 0
      CHANGELOG.md
  2. 3 2
      docs/configuration.md
  3. 31 0
      docs/generating_the_url.md
  4. 9 0
      docs/getting_the_image_info.md

+ 6 - 0
CHANGELOG.md

@@ -1,6 +1,12 @@
 # Changelog
 
 ## [Unreleased]
+### Add
+- (pro) Add the `IMGPROXY_VIDEO_THUMBNAIL_KEYFRAMES` config and the [video_thumbnail_keyframes](https://docs.imgproxy.net/latest/generating_the_url?id=video-thumbnail-keyframes) processing option.
+- (pro) Add the [video_thumbnail_tile](https://docs.imgproxy.net/latest/generating_the_url?id=video-thumbnail-tile) processing option.
+
+### Fix
+- (pro) Fix detection of some videos.
 
 ## [3.20.0] - 2023-10-09
 ### Add

+ 3 - 2
docs/configuration.md

@@ -263,9 +263,10 @@ imgproxy can use the `Width` and `DPR` HTTP headers to determine default width a
 imgproxy Pro can extract specific video frames to create thumbnails. This feature is disabled by default, but can be enabled with `IMGPROXY_ENABLE_VIDEO_THUMBNAILS`.
 
 * `IMGPROXY_ENABLE_VIDEO_THUMBNAILS`: ![pro](./assets/pro.svg) when `true`, enables video thumbnail generation. Default: `false`
-* `IMGPROXY_VIDEO_THUMBNAIL_SECOND`: ![pro](./assets/pro.svg) the timestamp of the frame (in seconds) that will be used for a thumbnail. Default: 1
+* `IMGPROXY_VIDEO_THUMBNAIL_SECOND`: ![pro](./assets/pro.svg) the timestamp of the frame (in seconds) that will be used for a thumbnail. Default: `1`
+* `IMGPROXY_VIDEO_THUMBNAIL_KEYFRAMES`: ![pro](./assets/pro.svg) when `true`, imgproxy will use the latest keyframe before `IMGPROXY_VIDEO_THUMBNAIL_SECOND` for video thumbnail generation. This makes video thumbnail generation faster yet the used frame timestamp will not be exactly equal to the requested one. Default: `false`
 * `IMGPROXY_VIDEO_THUMBNAIL_PROBE_SIZE`: ![pro](./assets/pro.svg) the maximum amount of bytes used to determine the format. Lower values can decrease memory usage but can produce inaccurate data, or even lead to errors. Default: 5000000
-* `IMGPROXY_VIDEO_THUMBNAIL_MAX_ANALYZE_DURATION`: ![pro](./assets/pro.svg) the maximum number of milliseconds used to get the stream info. Lower values can decrease memory usage but can produce inaccurate data, or even lead to errors. When set to 0, the heuristic is used. Default: 0
+* `IMGPROXY_VIDEO_THUMBNAIL_MAX_ANALYZE_DURATION`: ![pro](./assets/pro.svg) the maximum number of milliseconds used to get the stream info. Lower values can decrease memory usage but can produce inaccurate data, or even lead to errors. When set to `0`, the heuristic is used. Default: `0`
 
 **⚠️ Warning:** Though using `IMGPROXY_VIDEO_THUMBNAIL_PROBE_SIZE` and `IMGPROXY_VIDEO_THUMBNAIL_MAX_ANALYZE_DURATION` can lower the memory footprint of video thumbnail generation, they should be used in production only when you know what you're doing.
 

+ 31 - 0
docs/generating_the_url.md

@@ -722,6 +722,37 @@ vts:%second
 
 Allows redefining `IMGPROXY_VIDEO_THUMBNAIL_SECOND` config.
 
+### Video thumbnail keyframes![pro](./assets/pro.svg) :id=video-thumbnail-keyframes
+
+```
+video_thumbnail_keyframes:%keyframes
+vts:%keyframes
+```
+
+Allows redefining `IMGPROXY_VIDEO_THUMBNAIL_KEYFRAMES` config.
+
+### Video thumbnail tile![pro](./assets/pro.svg) :id=video-thumbnail-tile
+
+```
+video_thumbnail_tile:%step:%columns:%rows:%tile_width:%tile_height:%extend_tile:%trim
+vtt:%step:%columns:%rows:%tile_width:%tile_height:%extend_tile:%trim
+```
+
+When `step` is larger than `0`, imgproxy will generate a tiled sprite using the source video frames.
+
+* `step`: the step of timestamp (in seconds) between video frames that should be used for the sprite generation
+* `columns`: the number of columns in the sprite
+* `rows`: the number of rows in the sprite
+* `tile_width`, `tile_height`: the width and height of each tile in the sprite. imgproxy will resize each used frame to fit the provided size
+* `extend_tile`: _(optional)_ when set to `1`, `t` or `true`, imgproxy will extend each tile to the requested size using a black background
+* `trim`: _(optional)_ when set to `1`, `t` or `true`, imgproxy will trim the unused space from the sprite
+
+The timestamp of the first frame can be set using the `IMGPROXY_VIDEO_THUMBNAIL_SECOND` config or the [video_thumbnail_second](#video-thumbnail-keyframes) option.
+
+You can make imgproxy use only keyframes with the `IMGPROXY_VIDEO_THUMBNAIL_KEYFRAMES` config or the [video_thumbnail_keyframes](#video-thumbnail-keyframes) option.
+
+Default: `0:0:0:0:0`
+
 ### Fallback image URL![pro](./assets/pro.svg) :id=fallback-image-url
 
 You can use a custom fallback image by specifying its URL with the `fallback_image_url` processing option:

+ 9 - 0
docs/getting_the_image_info.md

@@ -417,6 +417,15 @@ vts:%second
 
 Allows redefining `IMGPROXY_VIDEO_THUMBNAIL_SECOND` config.
 
+### Video thumbnail keyframes![pro](./assets/pro.svg) :id=video-thumbnail-keyframes
+
+```
+video_thumbnail_keyframes:%keyframes
+vts:%keyframes
+```
+
+Allows redefining `IMGPROXY_VIDEO_THUMBNAIL_KEYFRAMES` config.
+
 ### Cache buster
 
 ```