So my play loop is

loadFrame()   {
   frames.incrementProgressBy(326-(playSpeed*30));     frames is a seekbar
   frame = frames.getProgress();
   pict     = retriever.getFrameAtTime(frame*1000);
mBitmap = Bitmap.createBitmap(pict, 0, 0, 1060, 600, matrix, false);
   super.setImageBitmap(mBitmap);
}

@Override protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        if (isPlaying)  loadFrame();
}

so essentially  frame is incremented by 326
thus  getFrame  is in steps of  326,000

I think this is generating the jumpiness I see,
But if I make this any smaller it will play slower than what was recorded.
the 326 allows a 15 second video to play back in 15 seconds.

So is there anyway to speed up the time it takes to recall loadFrame() thus allowing for a smaller step value ?


Thanks in advance


On 11/15/2011 11:22 PM, New Developer wrote:
Horay ! ! ! !
funny that just
retrieve.getFrameAtTime(frame); vs retrieve.getFrameAtTime(frame * 1000);
can make such a HUGE difference, now  If I can just make it smoother

Thanks all


On 11/14/2011 01:34 PM, New Developer wrote:
No matter what I pass as a value to getFrameAtTime() always displays the first frame If I keep a copy of the past frames and compare them they are not the same neither is the pixel array from getPixels
So the bitmap must be updating but just not displaying on screen.

I have tried setting the layer type to Hardware accelerated will not work isHardwareAccelerated returns false even after layout.setLayerType(View.LAYER_TYPE_HARDWARE, null);


tried to use runOnUiThread
           mActivity.runOnUiThread(new Runnable() {
                public void run() {
                    mBitmap.prepareToDraw();
                    ImageDisplay.imageView.setImageBitmap(mBitmap);
                    ImageDisplay.imageView.invalidate();
                }
            });

No Joy

Please any advice on how to get these bitmaps to show ? ? ?

Main Activity   has  a FrameLayout
    the FrameLayout is fille with a call to a Fragment  inflate
    The fragment extends an ImageView Type
    Works great with jpg  and png     will not work with  3gp

Thanks again



On 11/13/2011 07:41 PM, New Developer wrote:
No matter what value is passed to
          pict     = retrieve.getFrameAtTime(frame);
You always have the first frame never anything else ?
Why ?



On 11/13/2011 04:04 PM, New Developer wrote:
Called from a class that implements  ImageView

    @Override protected void onDraw(Canvas canvas) {
Log.e("Video Media" , "on Draw Called    ");
        super.onDraw(canvas);
Log.e("Media", "draw    step 2    ");
        if (isPlaying)  loadFrame();
Log.e("Media", "draw    step 3    ");
    }

    private void loadFrame() {
        if (isPlaying) {
            frames.incrementProgressBy(11-playSpeed);
            if (frame == duration)  {
                isPlaying = false;
                frame     = 0;
                frames.setProgress(0);
                frames.setEnabled(true);
                speed.setEnabled(true);
play.setBackgroundDrawable(getResources().getDrawable(R.drawable.play));
            }
            pict.recycle();         mBitmap.recycle();
retrieve.getFrameAtTime(frame);retrieve.getFrameAtTime(frame);retrieve.getFrameAtTime(frame);retrieve.getFrameAtTime(frame); mBitmap = Bitmap.createBitmap(pict, 0, 0, pict.getWidth(), pict.getHeight(), matrix, true); Log.e("Media", "load Frame " + frame + " ("+ (11-playSpeed) +") " + pict.getWidth() + " x " + pict.getHeight() );
Log.e("Media", "load Frame    step 1   ");
            super.setImageBitmap(mBitmap);
Log.e("Media", "load Frame    step 2   ");
            super.invalidate();
Log.e("Media", "load Frame    step 3   ");
        }
    }


frame get inremented in steps of 10 , thus pict = retrieve.getFrameAtTime(frame); loads every 10 frames
mBitmap as you can see is set to update the super.setImageBitmap()

resulting in the following logcat

11-13 15:47:52.605: E/Video Media(4647): on Draw Called
11-13 15:47:52.615: E/Media(4647): draw    step 2
11-13 15:47:52.915: E/Media(4647): load Frame 2450 (10) 1280 x 720
11-13 15:47:52.915: E/Media(4647): load Frame    step 1
11-13 15:47:52.915: E/Media(4647): load Frame    step 2
11-13 15:47:52.915: E/Media(4647): load Frame    step 3
11-13 15:47:52.915: E/Media(4647): draw    step 3

11-13 15:47:52.935: E/Video Media(4647): on Draw Called
11-13 15:47:52.945: E/Media(4647): draw    step 2
11-13 15:47:53.255: E/Media(4647): load Frame 2460 (10) 1280 x 720
11-13 15:47:53.255: E/Media(4647): load Frame    step 1
11-13 15:47:53.255: E/Media(4647): load Frame    step 2
11-13 15:47:53.255: E/Media(4647): load Frame    step 3
11-13 15:47:53.255: E/Media(4647): draw    step 3

11-13 15:47:53.275: E/Video Media(4647): on Draw Called
11-13 15:47:53.285: E/Media(4647): draw    step 2
11-13 15:47:53.585: E/Media(4647): load Frame 2470 (10) 1280 x 720
11-13 15:47:53.585: E/Media(4647): load Frame    step 1
11-13 15:47:53.585: E/Media(4647): load Frame    step 2
11-13 15:47:53.585: E/Media(4647): load Frame    step 3
11-13 15:47:53.585: E/Media(4647): draw    step 3

11-13 15:47:53.605: E/Video Media(4647): on Draw Called
11-13 15:47:53.615: E/Media(4647): draw    step 2
11-13 15:47:53.925: E/Media(4647): load Frame 2480 (10) 1280 x 720
11-13 15:47:53.925: E/Media(4647): load Frame    step 1
11-13 15:47:53.925: E/Media(4647): load Frame    step 2
11-13 15:47:53.925: E/Media(4647): load Frame    step 3
11-13 15:47:53.925: E/Media(4647): draw    step 3

11-13 15:47:53.945: E/Video Media(4647): on Draw Called
11-13 15:47:53.955: E/Media(4647): draw    step 2
11-13 15:47:54.255: E/Media(4647): load Frame 2490 (10) 1280 x 720
11-13 15:47:54.255: E/Media(4647): load Frame    step 1
11-13 15:47:54.255: E/Media(4647): load Frame    step 2
11-13 15:47:54.255: E/Media(4647): load Frame    step 3
11-13 15:47:54.255: E/Media(4647): draw    step 3

11-13 15:47:54.285: E/Video Media(4647): on Draw Called
11-13 15:47:54.295: E/Media(4647): draw    step 2
11-13 15:47:54.595: E/Media(4647): load Frame 2500 (10) 1280 x 720
11-13 15:47:54.595: E/Media(4647): load Frame    step 1
11-13 15:47:54.595: E/Media(4647): load Frame    step 2
11-13 15:47:54.595: E/Media(4647): load Frame    step 3
11-13 15:47:54.595: E/Media(4647): draw    step 3

11-13 15:47:54.615: E/Video Media(4647): on Draw Called
11-13 15:47:54.625: E/Media(4647): draw    step 2
11-13 15:47:54.925: E/Media(4647): load Frame 2510 (10) 1280 x 720
11-13 15:47:54.925: E/Media(4647): load Frame    step 1
11-13 15:47:54.925: E/Media(4647): load Frame    step 2
11-13 15:47:54.925: E/Media(4647): load Frame    step 3
11-13 15:47:54.925: E/Media(4647): draw    step 3

11-13 15:47:54.945: E/Video Media(4647): on Draw Called
11-13 15:47:54.955: E/Media(4647): draw    step 2
11-13 15:47:55.255: E/Media(4647): load Frame 2520 (10) 1280 x 720
11-13 15:47:55.255: E/Media(4647): load Frame    step 1
11-13 15:47:55.265: E/Media(4647): load Frame    step 2
11-13 15:47:55.265: E/Media(4647): load Frame    step 3
11-13 15:47:55.265: E/Media(4647): draw    step 3

11-13 15:47:55.275: E/Video Media(4647): on Draw Called
11-13 15:47:55.285: E/Media(4647): draw    step 2
11-13 15:47:55.595: E/Media(4647): load Frame 2530 (10) 1280 x 720
11-13 15:47:55.595: E/Media(4647): load Frame    step 1
11-13 15:47:55.595: E/Media(4647): load Frame    step 2
11-13 15:47:55.595: E/Media(4647): load Frame    step 3
11-13 15:47:55.595: E/Media(4647): draw    step 3

11-13 15:47:55.615: E/Video Media(4647): on Draw Called
11-13 15:47:55.625: E/Media(4647): draw    step 2
11-13 15:47:55.925: E/Media(4647): load Frame 2540 (10) 1280 x 720
11-13 15:47:55.925: E/Media(4647): load Frame    step 1
11-13 15:47:55.925: E/Media(4647): load Frame    step 2
11-13 15:47:55.925: E/Media(4647): load Frame    step 3
11-13 15:47:55.925: E/Media(4647): draw    step 3


My question is Why Does the frame NOT change visually. It constantly shows the first FRAME only
Why ?

Thanks in advance

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to