Class Transformer.Builder

    • Constructor Detail

      • Builder

        public Builder()
        Creates a builder with default values.
    • Method Detail

      • setRemoveAudio

        public Transformer.Builder setRemoveAudio​(boolean removeAudio)
        Sets whether to remove the audio from the output. The default value is false.

        The audio and video cannot both be removed because the output would not contain any samples.

        Parameters:
        removeAudio - Whether to remove the audio.
        Returns:
        This builder.
      • setRemoveVideo

        public Transformer.Builder setRemoveVideo​(boolean removeVideo)
        Sets whether to remove the video from the output. The default value is false.

        The audio and video cannot both be removed because the output would not contain any samples.

        Parameters:
        removeVideo - Whether to remove the video.
        Returns:
        This builder.
      • setFlattenForSlowMotion

        public Transformer.Builder setFlattenForSlowMotion​(boolean flattenForSlowMotion)
        Sets whether the input should be flattened for media containing slow motion markers. The transformed output is obtained by removing the slow motion metadata and by actually slowing down the parts of the video and audio streams defined in this metadata. The default value for flattenForSlowMotion is false.

        Only Samsung Extension Format (SEF) slow motion metadata type is supported. The transformation has no effect if the input does not contain this metadata type.

        For SEF slow motion media, the following assumptions are made on the input:

        • The input container format is (unfragmented) MP4.
        • The input contains an AVC video elementary stream with temporal SVC.
        • The recording frame rate of the video is 120 or 240 fps.

        If specifying a MediaSourceFactory using setMediaSourceFactory(MediaSourceFactory), make sure that Mp4Extractor.FLAG_READ_SEF_DATA is set on the Mp4Extractor used. Otherwise, the slow motion metadata will be ignored and the input won't be flattened.

        Parameters:
        flattenForSlowMotion - Whether to flatten for slow motion.
        Returns:
        This builder.
      • setLooper

        public Transformer.Builder setLooper​(Looper looper)
        Sets the Looper that must be used for all calls to the transformer and that is used to call listeners on. The default value is the Looper of the thread that this builder was created on, or if that thread does not have a Looper, the Looper of the application's main thread.
        Parameters:
        looper - A Looper.
        Returns:
        This builder.