use of android.media.videoeditor.MediaVideoItem in project android_frameworks_base by ParanoidAndroid.
the class MediaPropertiesTest method testPropertiesMPEGQCIF.
/**
*To test Media Properties for file MPEG4 QCIF
*/
@LargeTest
public void testPropertiesMPEGQCIF() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "MPEG4_SP_176x144_12fps_92kbps_AMRNB_8KHz_12.2kbps_m_0_27.3gp";
final int aspectRatio = MediaProperties.ASPECT_RATIO_11_9;
final int fileType = MediaProperties.FILE_3GP;
final int videoCodecType = MediaProperties.VCODEC_MPEG4;
final int duration = 27000;
final int videoBitrate = 384000;
final int audioBitrate = 12200;
final int fps = 12;
final int audioCodecType = MediaProperties.ACODEC_AMRNB;
final int audioSamplingFrequency = 8000;
final int audioChannel = 1;
final int videoProfile = MediaProperties.MPEG4Profile.MPEG4ProfileSimple;
final int videoLevel = MediaProperties.MPEG4Level.MPEG4Level1;
final int width = 176;
final int height = MediaProperties.HEIGHT_144;
final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
final MediaVideoItem mvi = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
validateVideoProperties(aspectRatio, fileType, videoCodecType, duration, videoBitrate, fps, videoProfile, videoLevel, width, height, audioCodecType, audioSamplingFrequency, audioChannel, audioBitrate, mvi);
}
use of android.media.videoeditor.MediaVideoItem in project android_frameworks_base by ParanoidAndroid.
the class MediaPropertiesTest method testPropertiesH263QCIF.
/**
*To To test media properties for H263 176x144 (QCIF) + AAC (mono) file.
*/
@LargeTest
public void testPropertiesH263QCIF() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "H263_profile0_176x144_15fps_256kbps_AACLC_16kHz_32kbps_m_0_26.3gp";
final int aspectRatio = MediaProperties.ASPECT_RATIO_11_9;
final int fileType = MediaProperties.FILE_3GP;
final int videoCodecType = MediaProperties.VCODEC_H263;
final int duration = 26933;
final int videoBitrate = 384000;
final int audioBitrate = 64000;
final int fps = 15;
final int audioCodecType = MediaProperties.ACODEC_AAC_LC;
final int audioSamplingFrequency = 16000;
final int audioChannel = 1;
final int videoProfile = MediaProperties.H263Profile.H263ProfileBaseline;
final int videoLevel = MediaProperties.H263Level.H263Level10;
final int width = 176;
final int height = MediaProperties.HEIGHT_144;
final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
final MediaVideoItem mvi = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
validateVideoProperties(aspectRatio, fileType, videoCodecType, duration, videoBitrate, fps, videoProfile, videoLevel, width, height, audioCodecType, audioSamplingFrequency, audioChannel, audioBitrate, mvi);
}
use of android.media.videoeditor.MediaVideoItem in project android_frameworks_base by ParanoidAndroid.
the class MediaPropertiesTest method testPropertiesH264HD1080WithoutAudio.
/**
*To test Media Properties for file H264 HD1080
*/
@LargeTest
public void testPropertiesH264HD1080WithoutAudio() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "H264_BP_1080x720_30fps_800kbps_1_17.mp4";
final int aspectRatio = MediaProperties.ASPECT_RATIO_3_2;
final int fileType = MediaProperties.FILE_MP4;
final int videoCodecType = MediaProperties.VCODEC_H264;
final int duration = 77366;
final int videoBitrate = 859000;
final int audioBitrate = 0;
final int fps = 30;
final int audioCodecType = -1;
final int audioSamplingFrequency = 0;
final int audioChannel = 0;
final int videoProfile = MediaProperties.H264Profile.H264ProfileBaseline;
final int videoLevel = MediaProperties.H264Level.H264Level13;
final int width = 1080;
final int height = MediaProperties.HEIGHT_720;
final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
final MediaVideoItem mvi = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
validateVideoProperties(aspectRatio, fileType, videoCodecType, duration, videoBitrate, fps, videoProfile, videoLevel, width, height, audioCodecType, audioSamplingFrequency, audioChannel, audioBitrate, mvi);
}
use of android.media.videoeditor.MediaVideoItem in project android_frameworks_base by ParanoidAndroid.
the class MediaItemThumbnailTest method testThumbnailListForH264WVGAWithSetBoundaries.
/**
*To test ThumbnailList for H264 WVGA with setExtractboundaries
*/
@LargeTest
public void testThumbnailListForH264WVGAWithSetBoundaries() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "H264_BP_800x480_15fps_512kbps_1_17.mp4";
final int thumbNailStartTime = 10000;
final int thumbNailEndTime = 12000;
final int tnCount = 10;
final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
final MediaVideoItem mediaVideoItem = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
final int outWidth = (mediaVideoItem.getWidth() / 2);
final int outHeight = (mediaVideoItem.getHeight() / 2);
mediaVideoItem.setExtractBoundaries(10000, 12000);
final Bitmap[] thumbNailBmp = mediaVideoItem.getThumbnailList(outWidth, outHeight, thumbNailStartTime, thumbNailEndTime, tnCount);
assertNotNull("Thumbnail Retrived is Null", thumbNailBmp);
assertTrue("Thumbnail Size", (thumbNailBmp.length > 0) ? true : false);
for (int i = 0; i < thumbNailBmp.length; i++) {
validateThumbnail(thumbNailBmp[i], outWidth, outHeight);
thumbNailBmp[i] = null;
}
}
use of android.media.videoeditor.MediaVideoItem in project android_frameworks_base by ParanoidAndroid.
the class MediaItemThumbnailTest method testThumbnailForH264WVGA.
/**
* To test thumbnail / frame extraction on H264 WVGA.
*/
@LargeTest
public void testThumbnailForH264WVGA() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "H264_BP_800x480_15fps_512kbps_AACLC_24KHz_38Kbps_s_1_17.mp4";
final int outWidth = 64;
final int outHeight = 64;
final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
final MediaVideoItem mediaVideoItem = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
final long atTime = mediaVideoItem.getDuration() / 2;
final Bitmap thumbNailBmp = mediaVideoItem.getThumbnail(outWidth, outHeight, atTime);
validateThumbnail(thumbNailBmp, outWidth, outHeight);
}
Aggregations