use of android.media.videoeditor.MediaVideoItem in project android_frameworks_base by ParanoidAndroid.
the class MediaPropertiesTest method testPropertiesH264HD1080WithAudio.
/**
*To test media properties for H264 1080x720 + AAC file
*/
@LargeTest
public void testPropertiesH264HD1080WithAudio() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "H264_BP_1080x720_30fps_12Mbps_AACLC_44.1khz_64kbps_s_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 = 77500;
final int videoBitrate = 1190000;
final int audioBitrate = 64000;
final int fps = 10;
final int audioCodecType = MediaProperties.ACODEC_AAC_LC;
final int audioSamplingFrequency = 44100;
final int audioChannel = 2;
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 MediaPropertiesTest method testPropertiesMPEG4854_480.
/**
*To test Media Properties for file MPEG4 854 x 480
*/
@LargeTest
public void testPropertiesMPEG4854_480() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "MPEG4_SP_854x480_15fps_256kbps_AACLC_16khz_48kbps_s_0_26.mp4";
final int aspectRatio = MediaProperties.ASPECT_RATIO_16_9;
final int fileType = MediaProperties.FILE_MP4;
final int videoCodecType = MediaProperties.VCODEC_MPEG4;
final int duration = 26933;
final int videoBitrate = 319000;
final int audioBitrate = 48000;
final int fps = 15;
final int audioCodecType = MediaProperties.ACODEC_AAC_LC;
final int audioSamplingFrequency = 16000;
final int audioChannel = 2;
final int videoProfile = MediaProperties.MPEG4Profile.MPEG4ProfileSimple;
final int videoLevel = MediaProperties.MPEG4Level.MPEG4Level1;
final int width = 854;
final int height = MediaProperties.HEIGHT_480;
final MediaVideoItem mvi = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, MediaItem.RENDERING_MODE_BLACK_BORDER);
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 testPropertiesH264WVGA.
/**
*To test media properties for H264 800x480 (WVGA) + AAC file.
*/
@LargeTest
public void testPropertiesH264WVGA() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "H264_BP_800x480_15fps_512kbps_AACLC_24KHz_38Kbps_s_1_17.mp4";
final int aspectRatio = MediaProperties.ASPECT_RATIO_5_3;
final int fileType = MediaProperties.FILE_MP4;
final int videoCodecType = MediaProperties.VCODEC_H264;
final int duration = 77466;
final int videoBitrate = 528000;
final int audioBitrate = 38000;
final int fps = 15;
final int audioCodecType = MediaProperties.ACODEC_AAC_LC;
final int audioSamplingFrequency = 24000;
final int audioChannel = 2;
final int videoProfile = MediaProperties.H264Profile.H264ProfileBaseline;
final int videoLevel = MediaProperties.H264Level.H264Level13;
final int width = 800;
final int height = MediaProperties.HEIGHT_480;
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 testThumbnailWithWidthAsZero.
/**
* Check the thumbnail / frame list extraction for Width zero
*/
@LargeTest
public void testThumbnailWithWidthAsZero() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "MPEG4_SP_176x144_30fps_256kbps_AACLC_44.1kHz_96kbps_s_1_17.3gp";
final int atTime = 1000;
final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
boolean flagForException = false;
try {
final MediaVideoItem mediaVideoItem = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
final int outWidth = 0;
final int outHeight = mediaVideoItem.getHeight() / 2;
mediaVideoItem.getThumbnail(outWidth, outHeight, atTime);
} catch (IllegalArgumentException e) {
flagForException = true;
}
assertTrue("Thumbnail List with Zero Width", flagForException);
}
use of android.media.videoeditor.MediaVideoItem in project android_frameworks_base by ParanoidAndroid.
the class MediaItemThumbnailTest method testThumbnailForH264854_480.
/**
* To test thumbnail / frame extraction on H264 854x480.
*/
@LargeTest
public void testThumbnailForH264854_480() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "MPEG4_SP_854x480_15fps_256kbps_AACLC_16khz_48kbps_s_0_26.mp4";
final int outWidth = 128;
final int outHeight = 128;
final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
MediaVideoItem mediaVideoItem = null;
mediaVideoItem = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
final long atTime = mediaVideoItem.getDuration() - 1000;
final Bitmap thumbNailBmp = mediaVideoItem.getThumbnail(outWidth, outHeight, atTime);
validateThumbnail(thumbNailBmp, outWidth, outHeight);
}
Aggregations