W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
媒體元數(shù)據(jù)是描述多媒體數(shù)據(jù)的數(shù)據(jù),例如媒體標題、媒體時長、媒體的幀數(shù)據(jù)等。
接口名 | 描述 |
---|---|
setSource(String path) | 讀取指定路徑的媒體文件,將其設(shè)置為媒體源。 |
setSource(FileDescriptor fd) | 讀取指定的媒體文件描述符,設(shè)置媒體源。 |
setSource(FileDescriptor fd, long offset, long length) | 讀取指定的媒體文件描述符,讀取數(shù)據(jù)的起始位置的偏移量以及讀取的數(shù)據(jù)長度,設(shè)置媒體源。 |
setSource(String uri, Map<String, String> headers) | 讀取指定的媒體文件 Uri,設(shè)置媒體源。 |
setSource(Context context, Uri uri) | 讀取指定的媒體的 Uri 和上下文,設(shè)置媒體源。 |
resolveMetadata(int keyCode) | 獲取媒體元數(shù)據(jù)中指定 keyCode 對應(yīng)的值。 |
fetchVideoScaledPixelMapByTime(long timeUs, int option, int dstWidth, int dstHeight) | 根據(jù)視頻源中時間戳、獲取選項以及圖像幀縮放大小,獲取幀數(shù)據(jù)。 |
fetchVideoPixelMapByTime(long timeUs, int option) | 根據(jù)視頻源中時間戳和獲取選項,獲取幀數(shù)據(jù)。 |
fetchVideoPixelMapByTime(long timeUs) | 根據(jù)視頻源中時間戳,獲取最靠近時間戳的幀的數(shù)據(jù)。 |
fetchVideoPixelMapByTime() | 隨機獲取數(shù)據(jù)源中某一幀的數(shù)據(jù)。 |
resolveImage() | 獲取音頻源中包含的圖像數(shù)據(jù),比如專輯封面,如果有多個圖像,返回任意一個圖像的數(shù)據(jù)。 |
fetchVideoPixelMapByIndex(int frameIndex, PixelMapConfigs configs) | 根據(jù)指定的圖像像素格式選項,獲取視頻源中指定一幀的數(shù)據(jù)。 |
fetchVideoPixelMapByIndex(int frameIndex) | 獲取視頻源中指定一幀的數(shù)據(jù)。 |
fetchVideoPixelMapByIndex(int frameIndex, int numFrames, PixelMapConfigs configs) | 根據(jù)指定的圖像像素格式選項,獲取視頻源中指定的連續(xù)多幀的數(shù)據(jù)。 |
fetchVideoPixelMapByIndex(int frameIndex, int numFrames) | 獲取視頻源中指定的連續(xù)多幀的數(shù)據(jù)。 |
fetchImagePixelMapByIndex(int imageIndex, PixelMapConfigs configs) | 根據(jù)指定的圖像像素格式選項,獲取源圖像中指定的圖像。 |
fetchImagePixelMapByIndex(int imageIndex) | 獲取源圖像中指定的圖像。 |
fetchImagePrimaryPixelMap(PixelMapConfigs configs) | 據(jù)指定的圖像像素格式選項,獲取源圖像中默認圖像。 |
fetchImagePrimaryPixelMap() | 獲取源圖像中默認圖像。 |
release() | 釋放讀取的媒體資源。 |
AVMetadataHelper avMetadataHelper = new AVMetadataHelper ();
avMetadataHelper.setSource("/path/short_video.mp4");
PixelMap pixelMap = avMetadataHelper.fetchVideoPixelMapByTime(1000L, 0x00);
avMetadataHelper.release();
AVMetadataHelper avMetadataHelper= new AVMetadataHelper();
avMetadataHelper.setSource("/path/short_video.mp4");
String result = avMetadataHelper.resolveMetadata(AVMetadataHelper.AV_KEY_DURATION);
avMetadataHelper.release();
AVMetadataHelper avMetadataHelper= new AVMetadataHelper();avMetadataHelper.setSource("/path/short_video.mp4");
byte[] data = avMetadataHelper.resolveImage();
avMetadataHelper.release();
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: