Search in sources :

Example 21 with VideoEditor

use of android.media.videoeditor.VideoEditor in project android_frameworks_base by ParanoidAndroid.

the class VideoEditorExportTest method testExportDuration1Hour.

/**
     * To Test Export :Media Item having duration of 1 Hour
     *
     * @throws Exception
     */
@Suppress
@LargeTest
public void testExportDuration1Hour() throws Exception {
    final String videoItemFilename1 = INPUT_FILE_PATH + "H264_BP_640x480_15fps_384kbps_60_0.mp4";
    final String outFilename = mVideoEditorHelper.createRandomFile(mVideoEditor.getPath() + "/") + ".3gp";
    final MediaVideoItem mediaItem1 = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename1, MediaItem.RENDERING_MODE_BLACK_BORDER);
    mVideoEditor.addMediaItem(mediaItem1);
    try {
        final int[] progressUpdate = new int[100];
        mVideoEditor.export(outFilename, MediaProperties.HEIGHT_144, MediaProperties.BITRATE_800K, new ExportProgressListener() {

            int i = 0;

            public void onProgress(VideoEditor ve, String outFileName, int progress) {
                progressUpdate[i++] = progress;
            }
        });
        mVideoEditorHelper.checkProgressCBValues(progressUpdate);
    } catch (Exception e) {
        assertTrue("Error in Export" + e.toString(), false);
    }
    mVideoEditorHelper.validateExport(mVideoEditor, outFilename, MediaProperties.HEIGHT_720, 0, mediaItem1.getDuration(), MediaProperties.VCODEC_H264, MediaProperties.ACODEC_AAC_LC);
    mVideoEditorHelper.checkDeleteExistingFile(outFilename);
}
Also used : VideoEditor(android.media.videoeditor.VideoEditor) ExportProgressListener(android.media.videoeditor.VideoEditor.ExportProgressListener) MediaVideoItem(android.media.videoeditor.MediaVideoItem) Suppress(android.test.suitebuilder.annotation.Suppress) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Aggregations

VideoEditor (android.media.videoeditor.VideoEditor)21 LargeTest (android.test.suitebuilder.annotation.LargeTest)19 MediaVideoItem (android.media.videoeditor.MediaVideoItem)15 ExportProgressListener (android.media.videoeditor.VideoEditor.ExportProgressListener)14 MediaImageItem (android.media.videoeditor.MediaImageItem)11 MediaProcessingProgressListener (android.media.videoeditor.VideoEditor.MediaProcessingProgressListener)11 EffectColor (android.media.videoeditor.EffectColor)6 TransitionAlpha (android.media.videoeditor.TransitionAlpha)6 OverlayData (android.media.videoeditor.VideoEditor.OverlayData)6 PreviewProgressListener (android.media.videoeditor.VideoEditor.PreviewProgressListener)6 SurfaceHolder (android.view.SurfaceHolder)6 TransitionCrossfade (android.media.videoeditor.TransitionCrossfade)5 IOException (java.io.IOException)5 TransitionSliding (android.media.videoeditor.TransitionSliding)4 Semaphore (java.util.concurrent.Semaphore)4 Bitmap (android.graphics.Bitmap)3 OverlayFrame (android.media.videoeditor.OverlayFrame)3 TransitionFadeBlack (android.media.videoeditor.TransitionFadeBlack)3 Rect (android.graphics.Rect)2 AudioTrack (android.media.videoeditor.AudioTrack)2