@Override
          protected @Nullable CloseableReference<CloseableImage> getResult() throws Exception {
            Bitmap thumbnailBitmap = null;
            String path;
            try {
              path = getLocalFilePath(imageRequest);
            } catch (IllegalArgumentException e) {
              path = null;
            }

            if (path != null) {
              thumbnailBitmap =
                  ThumbnailUtils.createVideoThumbnail(path, calculateKind(imageRequest));
            }

            if (thumbnailBitmap == null) {
              thumbnailBitmap =
                  createThumbnailFromContentProvider(mContentResolver, imageRequest.getSourceUri());
            }

            if (thumbnailBitmap == null) {
              return null;
            }

            CloseableStaticBitmap closeableStaticBitmap =
                CloseableStaticBitmap.of(
                    thumbnailBitmap,
                    SimpleBitmapReleaser.getInstance(),
                    ImmutableQualityInfo.FULL_QUALITY,
                    0);
            producerContext.putExtra(HasExtraData.KEY_IMAGE_FORMAT, "thumbnail");
            closeableStaticBitmap.putExtras(producerContext.getExtras());
            return CloseableReference.<CloseableImage>of(closeableStaticBitmap);
          }
A producer that creates video thumbnails.

<p>At present, these thumbnails are created on the java heap rather than being pinned purgeables.
This is deemed okay as the thumbnails are only very small.
imagepipeline/src/main/java/com/facebook/imagepipeline/producers/LocalVideoThumbnailProducer.java