
Thriving in Android Development Using Kotlin
By :

In this section, we will learn how to add a filter to our video. A popular filter that is visually impactful is the “vignette” effect – this effect typically darkens the edges of the frame, drawing the viewer’s attention toward the center of the image or video, and can add a dramatic or cinematic quality to the footage. FFmpeg has the capability to apply this artistic filter to videos, so let’s try it out!
As we did with the caption, we will start by creating the use case: AddVignetteEffectUseCase
. The primary role of AddVignetteEffectUseCase
is to execute the business logic for applying the vignette effect to a given video file by using mobile-ffmpeg
. We will use a specific FFmpeg
command, as follows:
class AddVignetteEffectUseCase() { suspend fun addVignetteEffect(videoFile: File): Result<File> = withContext(Dispatchers.IO) { ...