UtilFFMediaToolkitFindColorFrames(MediaFile, Color, Size, Single, ActionInt32, Int32) Method

Finds all the frames that matches the specified color in the source video file and returns the frame numbers.

Note: this method can take several minutes to complete depending on the duration and resolution of the source video.

Definition

Namespace: DevCase.ThirdParty.FFMediaToolkit
Assembly: DevCase.net48.ThirdParty.FFMediaToolkit (in DevCase.net48.ThirdParty.FFMediaToolkit.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static IReadOnlyCollection<int> FindColorFrames(
	MediaFile videoFile,
	Color color,
	Size sampleSize,
	float similarity,
	Action<int, int> callback = null
)

Parameters

videoFile  MediaFile
The video file.
color  Color
The color to match.
sampleSize  Size
The size at which each frame will be resized to analyze their pixels.

It is recommended to use a small size, like 20x20, 50x50 or 100x100. Bigger sizes will take more time to analyze.

similarity  Single
The tolerance of the color comparison. Valid range is from 0.01 (minimum) to 100 (maximum).
callback  ActionInt32, Int32  (Optional)
An encapsulated method that is invoked with {currentFrameNumber, totalFrames} arguments to report progress.

Return Value

IReadOnlyCollectionInt32
A IReadOnlyCollectionT that contains the numbers of the frames that matches the specified color in the source video file.

Remarks

Note: Some functionalities of this assembly may require to install one or all of the listed NuGet packages:

FFMediaToolkit by Radosław Kmiotek

https://www.nuget.org/packages/AForge.Imaging/

https://www.nuget.org/packages/AForge.Math/

Example

This is a code example.
C#
No code example is currently available or this language may not be supported.

See Also