Class VideoThumbnailProcessingOptions
Specifies the options for processing videos to create a thumbnail with a VideoThumbnailProcessor.
If IncludeThumbnailVideoStreams is true and there is a video stream marked as a thumbnail stream, the thumbnail image is taken from that stream.
Otherwise, the thumbnail image is taken from the earlier of ImageTimestamp and ImageTimestampFraction if both are specified and in range (this allows specifying options that work well for both long and short videos, e.g., by specifying 5s and 30%, for short videos 5s may be way too far in, it could be the end of the video so it takes 30%, and for long videos 30% could be way too far in, whereas 5s would be better).
The thumbnail image is taken from the first video stream that is most likely to be the main video based on dispositions.
The default format for the extracted thumbnail image is PNG.
The default options result in no thumbnail extraction options being applied.
Note: If no thumbnail is able to be extracted, then a FileProcessingException will be thrown when processing.
Note: Does not attempt to remove alpha channels, nor attempt to reduce bit depth to 8; callers can utilize additional image processing if needed for these.
Implements
Namespace: FulcrumFS.Videos
Assembly: FulcrumFS.Videos.dll
Syntax
public sealed record VideoThumbnailProcessingOptions : IEquatable<VideoThumbnailProcessingOptions>
Properties
| Name | Description |
|---|---|
| ForceSquarePixels | Gets or initializes a value indicating whether to force square pixels in the output video streams. Default is true. Note: when set to true, if the source video has non-square pixels (i.e., a sample aspect ratio different from 1:1), the frame will be rescaled to have square pixels. Note: when set to false, scaling the frame will preserve the original display aspect ratio by adjusting the pixel dimensions and sample aspect ratio accordingly. Note: most photo viewers and web browsers expect images to have square pixels, so keeping this as true may improve compatibility. |
| ImageTimestamp | Gets or initializes the timestamp within the video at which to capture the thumbnail image. Default is null, meaning this option is not used. |
| ImageTimestampFraction | Gets or initializes the fraction of the video's duration at which to capture the thumbnail image. Default is null, meaning this option is not used. |
| IncludeThumbnailVideoStreams | Gets or initializes a value indicating whether video streams marked as thumbnail streams should be considered for thumbnail extraction. Default is false, meaning this option is not used. |
| RemapHDRToSDR | Gets or initializes a value indicating whether to remap HDR to SDR for the thumbnail. Note: this uses a basic tone-mapping algorithm and may not produce optimal results for all content. Note: color profile, transfer, and matrix information will be updated if needed to reflect the remapping (but the file will still have color metadata). Default is true. |
| Standard | Gets an options instance with standard thumbnail extraction settings - ignores thumbnail streams, and selects from the lesser of 5 seconds and 30% of the video duration. |