IT. Expert System.

Android Reference

VideoEditorImpl


android.media.videoeditor

Class VideoEditorImpl

    • Constructor Detail

      • VideoEditorImpl

        public VideoEditorImpl(String projectPath)
                        throws IOException
        Constructor
        Parameters:
        projectPath - - The path where the VideoEditor stores all files related to the project
        Throws:
        IOException
    • Method Detail

      • addAudioTrack

        public void addAudioTrack(AudioTrack audioTrack)
        Description copied from interface: VideoEditor
        Add the specified AudioTrack to the storyboard. Note: Specific implementations may support a limited number of audio tracks (e.g. only one audio track)
        Specified by:
        addAudioTrack in interface VideoEditor
        Parameters:
        audioTrack - The AudioTrack to add
      • addMediaItem

        public void addMediaItem(MediaItem mediaItem)
        Description copied from interface: VideoEditor
        Add a media item at the end of the storyboard.
        Specified by:
        addMediaItem in interface VideoEditor
        Parameters:
        mediaItem - The media item object to add
      • addTransition

        public void addTransition(Transition transition)
        Description copied from interface: VideoEditor
        Add a transition between the media items specified by the transition. If a transition existed at the same position it is invalidated and then the transition is replaced. Note that the new transition video clip is not automatically generated by this method. The Transition.generate() method must be invoked to generate the transition video clip. Note that the TransitionAtEnd and TransitionAtStart are special kinds that can not be applied between two media items. A crossfade audio transition will be automatically applied regardless of the video transition.
        Specified by:
        addTransition in interface VideoEditor
        Parameters:
        transition - The transition to apply
      • cancelExport

        public void cancelExport(String filename)
        Description copied from interface: VideoEditor
        Cancel the running export operation. This method blocks until the export is cancelled and the exported file (if any) is deleted. If the export completed by the time this method is invoked, the export file will be deleted.
        Specified by:
        cancelExport in interface VideoEditor
        Parameters:
        filename - The filename which identifies the export operation to be canceled.
      • export

        public void export(String filename,
                  int height,
                  int bitrate,
                  int audioCodec,
                  int videoCodec,
                  VideoEditor.ExportProgressListener listener)
                    throws IOException
        Description copied from interface: VideoEditor
        Create the output movie based on all media items added and the applied storyboard items. This method can take a long time to execute and is blocking. The application will receive progress notifications via the ExportProgressListener. Specific implementations may not support multiple simultaneous export operations. Note that invoking methods which would change the contents of the output movie throw an IllegalStateException while an export operation is pending.
        Specified by:
        export in interface VideoEditor
        Parameters:
        filename - The output file name (including the full path)
        height - The height of the output video file. The supported values for height are described in the MediaProperties class, for example: HEIGHT_480. The width will be automatically computed according to the aspect ratio provided by VideoEditor.setAspectRatio(int)
        bitrate - The bitrate of the output video file. This is approximate value for the output movie. Supported bitrate values are described in the MediaProperties class for example: BITRATE_384K
        audioCodec - The audio codec to be used for the export. The audio codec values are defined in the MediaProperties class (e.g. ACODEC_AAC_LC). Note that not all audio codec types are supported for export purposes.
        videoCodec - The video codec to be used for the export. The video codec values are defined in the MediaProperties class (e.g. VCODEC_H264). Note that not all video codec types are supported for export purposes.
        listener - The listener for progress notifications. Use null if export progress notifications are not needed.
        Throws:
        IOException - if output file cannot be created
      • export

        public void export(String filename,
                  int height,
                  int bitrate,
                  VideoEditor.ExportProgressListener listener)
                    throws IOException
        Description copied from interface: VideoEditor
        Create the output movie based on all media items added and the applied storyboard items. This method can take a long time to execute and is blocking. The application will receive progress notifications via the ExportProgressListener. Specific implementations may not support multiple simultaneous export operations. Note that invoking methods which would change the contents of the output movie throw an IllegalStateException while an export operation is pending. The audio and video codecs are automatically selected by the underlying implementation.
        Specified by:
        export in interface VideoEditor
        Parameters:
        filename - The output file name (including the full path)
        height - The height of the output video file. The supported values for height are described in the MediaProperties class, for example: HEIGHT_480. The width will be automatically computed according to the aspect ratio provided by VideoEditor.setAspectRatio(int)
        bitrate - The bitrate of the output video file. This is approximate value for the output movie. Supported bitrate values are described in the MediaProperties class for example: BITRATE_384K
        listener - The listener for progress notifications. Use null if export progress notifications are not needed.
        Throws:
        IOException - if output file cannot be created
      • getAllAudioTracks

        public List<AudioTrack> getAllAudioTracks()
        Description copied from interface: VideoEditor
        Get the list of AudioTracks in order in which they appear in the storyboard. Note that if any AudioTrack source files are not accessible anymore, this method will still provide the full list of audio tracks.
        Specified by:
        getAllAudioTracks in interface VideoEditor
        Returns:
        The list of AudioTracks. If no audio tracks exist an empty list will be returned.
      • getAllMediaItems

        public List<MediaItem> getAllMediaItems()
        Description copied from interface: VideoEditor
        Get the list of media items in the order in which it they appear in the storyboard timeline. Note that if any media item source files are no longer accessible, this method will still provide the full list of media items.
        Specified by:
        getAllMediaItems in interface VideoEditor
        Returns:
        The list of media items. If no media item exist an empty list will be returned.
      • getAllTransitions

        public List<Transition> getAllTransitions()
        Description copied from interface: VideoEditor
        Get the list of transitions
        Specified by:
        getAllTransitions in interface VideoEditor
        Returns:
        The list of transitions. If no transitions exist an empty list will be returned.
      • getAspectRatio

        public int getAspectRatio()
        Description copied from interface: VideoEditor
        Get current aspect ratio.
        Specified by:
        getAspectRatio in interface VideoEditor
        Returns:
        The aspect ratio as described in MediaProperties
      • getAudioTrack

        public AudioTrack getAudioTrack(String audioTrackId)
        Description copied from interface: VideoEditor
        Find the AudioTrack with the specified id
        Specified by:
        getAudioTrack in interface VideoEditor
        Parameters:
        audioTrackId - The AudioTrack id
        Returns:
        The AudioTrack with the specified id (null if it does not exist)
      • getDuration

        public long getDuration()
        Description copied from interface: VideoEditor
        Get the preview (and output movie) duration.
        Specified by:
        getDuration in interface VideoEditor
        Returns:
        The duration of the preview (and output movie)
      • getMediaItem

        public MediaItem getMediaItem(String mediaItemId)
        Description copied from interface: VideoEditor
        Find the media item with the specified id
        Specified by:
        getMediaItem in interface VideoEditor
        Parameters:
        mediaItemId - The media item id
        Returns:
        The media item with the specified id (null if it does not exist)
      • getPath

        public String getPath()
        Specified by:
        getPath in interface VideoEditor
        Returns:
        The path where the VideoEditor stores all files related to the project
      • getTransition

        public Transition getTransition(String transitionId)
        Description copied from interface: VideoEditor
        Find the transition with the specified transition id.
        Specified by:
        getTransition in interface VideoEditor
        Parameters:
        transitionId - The transition id
        Returns:
        The transition
      • insertAudioTrack

        public void insertAudioTrack(AudioTrack audioTrack,
                            String afterAudioTrackId)
        Description copied from interface: VideoEditor
        Insert an audio track after the audio track with the specified id. Use addAudioTrack to add an audio track at the end of the storyboard timeline.
        Specified by:
        insertAudioTrack in interface VideoEditor
        Parameters:
        audioTrack - The audio track object to insert
        afterAudioTrackId - Insert the audio track after the audio track identified by this parameter. If this parameter is null the audio track is added at the beginning of the timeline.
      • insertMediaItem

        public void insertMediaItem(MediaItem mediaItem,
                           String afterMediaItemId)
        Description copied from interface: VideoEditor
        Insert a media item after the media item with the specified id.
        Specified by:
        insertMediaItem in interface VideoEditor
        Parameters:
        mediaItem - The media item object to insert
        afterMediaItemId - Insert the mediaItem after the media item identified by this id. If this parameter is null, the media item is inserted at the beginning of the timeline.
      • moveAudioTrack

        public void moveAudioTrack(String audioTrackId,
                          String afterAudioTrackId)
        Description copied from interface: VideoEditor
        Move an AudioTrack after the AudioTrack with the specified id.
        Specified by:
        moveAudioTrack in interface VideoEditor
        Parameters:
        audioTrackId - The id of the AudioTrack to move
        afterAudioTrackId - Move the AudioTrack identified by audioTrackId after the AudioTrack identified by this parameter. If this parameter is null the audio track is added at the beginning of the timeline.
      • moveMediaItem

        public void moveMediaItem(String mediaItemId,
                         String afterMediaItemId)
        Description copied from interface: VideoEditor
        Move a media item after the media item with the specified id. Note: The project thumbnail is regenerated if the media item is or becomes the first media item in the storyboard timeline.
        Specified by:
        moveMediaItem in interface VideoEditor
        Parameters:
        mediaItemId - The id of the media item to move
        afterMediaItemId - Move the media item identified by mediaItemId after the media item identified by this parameter. If this parameter is null, the media item is moved at the beginning of the timeline.
      • release

        public void release()
        Description copied from interface: VideoEditor
        This method releases all in-memory resources used by the VideoEditor instance. All pending operations such as preview, export and extract audio waveform must be canceled.
        Specified by:
        release in interface VideoEditor
      • removeAllMediaItems

        public void removeAllMediaItems()
        Description copied from interface: VideoEditor
        Remove all media items in the storyboard. All effects, overlays and all transitions are also removed. Note: The project thumbnail will be set to a black frame and the aspect ratio will revert to the default aspect ratio.
        Specified by:
        removeAllMediaItems in interface VideoEditor
      • removeAudioTrack

        public AudioTrack removeAudioTrack(String audioTrackId)
        Description copied from interface: VideoEditor
        Remove the audio track with the specified id. If the extraction of the audio waveform is in progress, the extraction is canceled and the file is deleted.
        Specified by:
        removeAudioTrack in interface VideoEditor
        Parameters:
        audioTrackId - The id of the audio track to be removed
        Returns:
        The audio track that was removed
      • removeMediaItem

        public MediaItem removeMediaItem(String mediaItemId)
        Description copied from interface: VideoEditor
        Remove the media item with the specified id. If there are transitions before or after this media item, then this/these transition(s) are removed from the storyboard. If the extraction of the audio waveform is in progress, the extraction is canceled and the file is deleted. Effects and overlays associated with the media item will also be removed. Note: The project thumbnail is regenerated if the media item which is removed is the first media item in the storyboard or if the media item is the only one in the storyboard. If the media item is the only one in the storyboard, the project thumbnail will be set to a black frame and the aspect ratio will revert to the default aspect ratio and this method is equivalent to removeAllMediaItems() in this case.
        Specified by:
        removeMediaItem in interface VideoEditor
        Parameters:
        mediaItemId - The unique id of the media item to be removed
        Returns:
        The media item that was removed
      • removeTransition

        public Transition removeTransition(String transitionId)
        Description copied from interface: VideoEditor
        Remove the transition with the specified id.
        Specified by:
        removeTransition in interface VideoEditor
        Parameters:
        transitionId - The id of the transition to be removed
        Returns:
        The transition that was removed
      • renderPreviewFrame

        public long renderPreviewFrame(SurfaceHolder surfaceHolder,
                              long timeMs,
                              VideoEditor.OverlayData overlayData)
        Description copied from interface: VideoEditor
        Render a frame according to the preview aspect ratio and activating all storyboard items relative to the specified time.
        Specified by:
        renderPreviewFrame in interface VideoEditor
        Parameters:
        surfaceHolder - SurfaceHolder used by the application
        timeMs - time corresponding to the frame to display
        overlayData - The overlay data
        Returns:
        The accurate time stamp of the frame that is rendered.
      • save

        public void save()
                  throws IOException
        Description copied from interface: VideoEditor
        Persist the current internal state of VideoEditor to the project path. The VideoEditor state may be restored by invoking the VideoEditorFactory#load(String) method. This method does not release the internal in-memory state of the VideoEditor. To release the in-memory state of the VideoEditor the VideoEditor.release() method must be invoked. Pending transition generations must be allowed to complete before the state is saved. Pending audio waveform generations must be allowed to complete. Pending export operations must be allowed to continue.
        Specified by:
        save in interface VideoEditor
        Throws:
        IOException - if the internal state cannot be saved to project file
      • setAspectRatio

        public void setAspectRatio(int aspectRatio)
        Description copied from interface: VideoEditor
        Set the aspect ratio used in the preview and the export movie. The default aspect ratio is ASPECTRATIO_16_9 (16:9).
        Specified by:
        setAspectRatio in interface VideoEditor
        Parameters:
        aspectRatio - to apply. If aspectRatio is the same as the current aspect ratio, then this function just returns. The supported aspect ratio are defined in the MediaProperties class for example: ASPECTRATIO_16_9
      • startPreview

        public void startPreview(SurfaceHolder surfaceHolder,
                        long fromMs,
                        long toMs,
                        boolean loop,
                        int callbackAfterFrameCount,
                        VideoEditor.PreviewProgressListener listener)
        Description copied from interface: VideoEditor
        Start the preview of all the storyboard items applied on all MediaItems This method does not block (does not wait for the preview to complete). The PreviewProgressListener allows to track the progress at the time interval determined by the callbackAfterFrameCount parameter. The SurfaceHolder has to be created and ready for use before calling this method. The method is a no-op if there are no MediaItems in the storyboard.
        Specified by:
        startPreview in interface VideoEditor
        Parameters:
        surfaceHolder - SurfaceHolder where the preview is rendered.
        fromMs - The time (relative to the timeline) at which the preview will start
        toMs - The time (relative to the timeline) at which the preview will stop. Use -1 to play to the end of the timeline
        loop - true if the preview should be looped once it reaches the end
        callbackAfterFrameCount - The listener interface should be invoked after the number of frames specified by this parameter.
        listener - The listener which will be notified of the preview progress
      • stopPreview

        public long stopPreview()
        Description copied from interface: VideoEditor
        Stop the current preview. This method blocks until ongoing preview is stopped. Ignored if there is no preview running.
        Specified by:
        stopPreview in interface VideoEditor
        Returns:
        The accurate current time when stop is effective expressed in milliseconds
      • clearSurface

        public void clearSurface(SurfaceHolder surfaceHolder)
        Clears the preview surface
        Specified by:
        clearSurface in interface VideoEditor
        Parameters:
        surfaceHolder - SurfaceHolder where the preview is rendered and needs to be cleared.


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: 3748 / . Delta: 0.06270 с