The Kotlin Camera2 API Video Thumbnail Android development tutorial describes how to create an round thumbnail image from the recorded video file.
This Kotlin tutorial follows on from the record video episode.
The thumbnail will be created upon completion of the video capture.
In this Kotlin on Android tutorial we will cover:
- Creating a thumbnail from video file
- Converting a square thumbnail to round thumbnail
- Updating an ImageView with a drawable
Episodes
- Icons
- MediaRecorder
- Rear Camera Record
- Round preview thumbnail
- Sharing Uri with ViewModel
- Video Playback with ExoPlayer
- Video PIP
- Front Camera Record (Premium)
- Video Record with Audio (Premium)
- Replace TextureView with SurfaceView (Premium)
Disclaimer, it is recommended to follow this Kotlin on Android tutorial series using a Google Pixel or Nexus device.
Please do not try it with the Android Emulator. Bugs have also been observed in camera stacks of none Google devices, which may be exposed by this tutorial series.
Conclusion
This Kotlin on Android tutorial described how to use the ThumbnailUtils library to created a thumbnail.
The MICRO_KIND was selected for its square output. Which is required to generate a round thumbnail image.
The round image thumbnail gets generated once the video record has completed.
The following Kotlin on Android tutorial describes how to use the Andriod ViewModel for passing a Uri between Android fragments.