Class VideoUtils


  • public class VideoUtils
    extends java.lang.Object
    • Constructor Detail

      • VideoUtils

        public VideoUtils()
    • Method Detail

      • I420toNV21Frame

        public static VideoFrame I420toNV21Frame​(VideoFrame frame)
        Parameters:
        frame - A frame in I420 format.
        Returns:
        A copy of the I420 YUV frame converted to NV21 YUV format.
      • convertToBlackAndWhite

        public static void convertToBlackAndWhite​(VideoFrame frame)
        Demo method that shows how to process in-place VideoFrame by converting it to black-and-white image.
        Parameters:
        frame - - VideoFrame in YUV 420 planar or semi-planar format - DO NOT assume continuity of planes. Pixels of one line occupy adjacent bytes in memory, but lines of the same plane can be separated from each other - use yuvStrides[] fields! NB: VideoFrame's planes backing memory buffer most of the time is allocated as direct buffer from native code and thus it is NOT backed by Java's byte[] array. Use slow but secure 'put' methods, or delegate processing to your native C++ code via JNI.