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);
}
Aggregations