IT. Expert System.

Android Reference

MediaVideoItem


android.media.videoeditor

Class MediaVideoItem



  • public class MediaVideoItem
    extends MediaItem
    This class represents a video clip item on the storyboard
    • Constructor Detail

      • MediaVideoItem

        public MediaVideoItem(VideoEditor editor,
                      String mediaItemId,
                      String filename,
                      int renderingMode)
                       throws IOException
        Constructor
        Parameters:
        editor - The video editor reference
        mediaItemId - The MediaItem id
        filename - The image file name
        renderingMode - The rendering mode
        Throws:
        IOException - if the file cannot be opened for reading
    • Method Detail

      • setExtractBoundaries

        public void setExtractBoundaries(long beginMs,
                                long endMs)
        Sets the start and end marks for trimming a video media item. This method will adjust the duration of bounding transitions, effects and overlays if the current duration of the transactions become greater than the maximum allowable duration.
        Parameters:
        beginMs - Start time in milliseconds. Set to 0 to extract from the beginning
        endMs - End time in milliseconds. Set to MediaItem.END_OF_FILE to extract until the end
        Throws:
        IllegalArgumentException - if the start time is greater or equal than end time, the end time is beyond the file duration, the start time is negative
      • getBoundaryBeginTime

        public long getBoundaryBeginTime()
        Returns:
        The boundary begin time
      • getBoundaryEndTime

        public long getBoundaryEndTime()
        Returns:
        The boundary end time
      • addEffect

        public void addEffect(Effect effect)
        Description copied from class: MediaItem
        Add the specified effect to this media item. Note that certain types of effects cannot be applied to video and to image media items. For example in certain implementation a Ken Burns implementation cannot be applied to video media item. This method invalidates transition video clips if the effect overlaps with the beginning and/or the end transition.
        Overrides:
        addEffect in class MediaItem
        Parameters:
        effect - The effect to apply
      • getThumbnail

        public Bitmap getThumbnail(int width,
                          int height,
                          long timeMs)
        Description copied from class: MediaItem
        Create a thumbnail at specified time in a video stream in Bitmap format
        Specified by:
        getThumbnail in class MediaItem
        Parameters:
        width - width of the thumbnail in pixels
        height - height of the thumbnail in pixels
        timeMs - The time in the source video file at which the thumbnail is requested (even if trimmed).
        Returns:
        The thumbnail as a Bitmap.
      • getThumbnailList

        public void getThumbnailList(int width,
                            int height,
                            long startMs,
                            long endMs,
                            int thumbnailCount,
                            int[] indices,
                            MediaItem.GetThumbnailListCallback callback)
                              throws IOException
        Description copied from class: MediaItem
        Get the array of Bitmap thumbnails between start and end.
        Specified by:
        getThumbnailList in class MediaItem
        Parameters:
        width - width of the thumbnail in pixels
        height - height of the thumbnail in pixels
        startMs - The start of time range in milliseconds
        endMs - The end of the time range in milliseconds
        thumbnailCount - The thumbnail count
        indices - The indices of the thumbnails wanted
        callback - The callback used to pass back the bitmaps
        Throws:
        IOException - if a file error occurs
      • getAspectRatio

        public int getAspectRatio()
        Description copied from class: MediaItem
        Get aspect ratio of the source media item.
        Specified by:
        getAspectRatio in class MediaItem
        Returns:
        the aspect ratio as described in MediaProperties. MediaProperties.ASPECT_RATIO_UNDEFINED if aspect ratio is not supported as in MediaProperties
      • getFileType

        public int getFileType()
        Specified by:
        getFileType in class MediaItem
        Returns:
        The source file type
      • getWidth

        public int getWidth()
        Specified by:
        getWidth in class MediaItem
        Returns:
        Get the native width of the media item
      • getHeight

        public int getHeight()
        Specified by:
        getHeight in class MediaItem
        Returns:
        Get the native height of the media item
      • getDuration

        public long getDuration()
        Specified by:
        getDuration in class MediaItem
        Returns:
        The is the full duration of the media item (not trimmed)
      • getTimelineDuration

        public long getTimelineDuration()
        Specified by:
        getTimelineDuration in class MediaItem
        Returns:
        The timeline duration. This is the actual duration in the timeline (trimmed duration)
      • renderFrame

        public long renderFrame(SurfaceHolder surfaceHolder,
                       long timeMs)
        Render a frame according to the playback (in the native aspect ratio) for the specified media item. All effects and overlays applied to the media item are ignored. The extract boundaries are also ignored. This method can be used to playback frames when implementing trimming functionality.
        Parameters:
        surfaceHolder - SurfaceHolder used by the application
        timeMs - time corresponding to the frame to display (relative to the the beginning of the media item).
        Returns:
        The accurate time stamp of the frame that is rendered .
        Throws:
        IllegalStateException - if a playback, preview or an export is already in progress
        IllegalArgumentException - if time is negative or greater than the media item duration
      • extractAudioWaveform

        public void extractAudioWaveform(ExtractAudioWaveformProgressListener listener)
                                  throws IOException
        This API allows to generate a file containing the sample volume levels of the Audio track of this media item. This function may take significant time and is blocking. The file can be retrieved using getAudioWaveformFilename().
        Parameters:
        listener - The progress listener
        Throws:
        IOException - if the output file cannot be created
        IllegalArgumentException - if the mediaItem does not have a valid Audio track
      • setVolume

        public void setVolume(int volumePercent)
        Set volume of the Audio track of this mediaItem
        Parameters:
        volumePercent - in %/. 100% means no change; 50% means half value, 200% means double, 0% means silent.
        Throws:
        UsupportedOperationException - if volume value is not supported
      • getVolume

        public int getVolume()
        Get the volume value of the audio track as percentage. Call of this method before calling setVolume will always return 100%
        Returns:
        the volume in percentage
      • setMute

        public void setMute(boolean muted)
        Parameters:
        muted - true to mute the media item
      • isMuted

        public boolean isMuted()
        Returns:
        true if the media item is muted
      • getVideoType

        public int getVideoType()
        Returns:
        The video type
      • getVideoProfile

        public int getVideoProfile()
        Returns:
        The video profile
      • getVideoLevel

        public int getVideoLevel()
        Returns:
        The video profile
      • getVideoBitrate

        public int getVideoBitrate()
        Returns:
        The video bitrate
      • getAudioBitrate

        public int getAudioBitrate()
        Returns:
        The audio bitrate
      • getFps

        public int getFps()
        Returns:
        The number of frames per second
      • getAudioType

        public int getAudioType()
        Returns:
        The audio codec
      • getAudioChannels

        public int getAudioChannels()
        Returns:
        The number of audio channels
      • getAudioSamplingFrequency

        public int getAudioSamplingFrequency()
        Returns:
        The audio sample frequency


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 278 / 158697787. Delta: 0.02662 с