2017-07-07 11 views
1

開始時に、各ストリームリンクのフレームを表示したい。私の現在の解決策はLoaderManagerを使用しており、このテクニックの問題はそれが遅すぎる(アプリケーションがクラッシュした)ことです。私のアンドロイドTVアプリケーションで、グライドでビデオフレームのフレームを取得する方法

FFmpegMediaMetadataRetriever to load and set video stream link. 
this.retriever = new FFmpegMediaMetadataRetriever(); 
Bitmap bitmap = null; 
retriever.setDataSource(this.mSelectedStream.getStreamUrl()); 
bitmap = retriever.getFrameAtTime(); 
drawable = new BitmapDrawable(bitmap); 
retriever.release(); 

this thread私はビデオリンクから画像を読み込むためにグライドを使用できると説明しました。

BitmapPool bitmapPool = Glide.get(getApplicationContext()).getBitmapPool(); 
       int microSecond = 6000000;// 6th second as an example 
       VideoBitmapDecoder videoBitmapDecoder = new VideoBitmapDecoder(microSecond); 
       FileDescriptorBitmapDecoder fileDescriptorBitmapDecoder = new FileDescriptorBitmapDecoder(videoBitmapDecoder, bitmapPool, DecodeFormat.PREFER_ARGB_8888); 
       Glide.with(getApplicationContext()) 
         .load(yourUri) 
         .asBitmap() 
         .override(50,50)// Example 
         .videoDecoder(fileDescriptorBitmapDecoder) 
         .into(yourImageView); 

が、私は上記のコードを使用するとき、私は取得VideoBitmapDecoderのエラー「のパッケージの外からアクセスすることはできません」。

exmapleリンク= "http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8"

任意のアイデア? ありがとう

答えて

1

私はこのスニペットを使用して、ビデオフレームから親指の爪を取得しました。試してみてください

Bitmap thumbnail = ThumbnailUtils.createVideoThumbnail(media_url, 
       MediaStore.Images.Thumbnails.MINI_KIND); 
     BitmapDrawable BD = new BitmapDrawable(thumbnail); 
     videoView.setBackgroundDrawable(BD); 
+0

これは動作していないようです。私は空白のビットマップを得ると思う – destrat18

関連する問題