마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

안드로이드 촬영한 동영상 불러와서 Frame Animation 만들기 ㅠㅠ 살려주세요

0 추천
	// Get your video file
	File myVideo = new File(path);
	// URI to your video file
	Uri myVideoUri = Uri.parse(myVideo.toString());

	// MediaMetadataRetriever instance
	MediaMetadataRetriever mmRetriever = new MediaMetadataRetriever();
	mmRetriever.setDataSource(myVideo.getAbsolutePath());

	// Array list to hold your frames
	ArrayList<Bitmap> frames = new ArrayList<Bitmap>();

		
	// Some kind of iteration to retrieve the frames and add it to Array list

	Log.w(TAG,"covert start 4-1");
		
	for(int i=0;i<3;i++)
	{
		for(int j=0;j<30;j++)
		{
			frames.add(mmRetriever.getFrameAtTime(i*1000000+j*33333, MediaMetadataRetriever.OPTION_CLOSEST_SYNC));
			Log.w(TAG,"covert count//" + i );
		}

	}
										
	Log.w(TAG,"covert end 4-1");
	/////////////////////////////////////////////////////////////////

	ArrayList<Drawable> drawableanimation = new ArrayList<Drawable>();
			
	for(int i=0;i<frames.size();i++)
	{	
		drawableanimation.add(new BitmapDrawable(frames.get(i)));		frameAnimation.addFrame(drawableanimation.get(i), 50);
	}
					
				
	 
	Log.w(TAG,"declarer 4-2");

			    	
	//////////////////////////////////////////////////////////////////
					
					
							
	view = (ImageView) findViewById(R.id.imageAnimation);
	Log.w(TAG,"bitmaptodrawable 4-3");
    	view.setBackgroundDrawable(frameAnimation);

					
        frameAnimation = (AnimationDrawable) view.getBackground();
					

 

이렇게 짜봤는데..계속 out of memory? 계속 그렇게 뜨네요 ㅠㅠ

그래서 bitmap.recycle() 해봤는데.. 그러면 문제가 cannot draw recycled Bitmap 에러가 뜨는데...

 

아무튼..ㅠㅠ 살려주세요 과연 뭐가 문제인가요 ㅠㅠ 아니면

 

동영상을 받아서 Frame animation으로 만들 방법은 없나요??

ridwan (120 포인트) 님이 2013년 12월 30일 질문

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...