Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor fecxelmin's Avatar
    Join Date
    Nov 2009
    Posts
    80
    i want to get the frames of the video file. file type is .avi. how to do it?

  2. #2
    Nokia Developer Champion im2amit's Avatar
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    2,903
    Try to play the video file using player, get Video Control from it and use getSnapshot() method to capture frames.

    thanks,
    ~Amitabh

  3. #3
    Regular Contributor fecxelmin's Avatar
    Join Date
    Nov 2009
    Posts
    80
    thanks im2amit,

    but i dont want to use snapshot(). anyone can suggest any other way?

  4. #4
    Nokia Developer Champion im2amit's Avatar
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    2,903
    If you dont want to use getSnapshot() then a more complex way will be to exlpore and find (pure java) decoder for .avi and fetch the frames from the actual bytes read from the avi file and create Image for each frame.


    thanks,
    ~Amitabh

  5. #5
    Regular Contributor fecxelmin's Avatar
    Join Date
    Nov 2009
    Posts
    80
    I tried to use getSnapshot(). The code is as below:

    playerVideo = Manager.createPlayer(PATH);
    playerVideo.realize();
    control = (VideoControl)playerVideo.getControl("VideoControl");
    playerVideo.start();
    raw = control.getSnapshot("encoding=bmp");

    where PATH is string of location where the video file is stored. the last line of the code tries to get the frame of the video. However, there's error when the last line is executed. Im not sure what's the error.

    Anyone can tell me did i code the coding for getting video frame right?

    Thanks

  6. #6
    Nokia Developer Champion im2amit's Avatar
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    2,903
    Put a try catch and see what exception is thrown, try putting a small sleep b4 catpuring the frame and try default encoding.

    You VC is not visible:
    try
    PHP Code:
    javax.microedition.lcdui.Canvas canvas;
          :
       try {
           
    Player p Manager.createPlayer("http://abc.mpg");
           
    p.realize();
           
    VideoControl vc;
           if ((
    vc = (VideoControl)p.getControl("VideoControl")) != null)
               
    vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEOcanvas));
           
    vc.setVisible(true);
           
    p.start();
           
    // sleep for sometime
           
    raw vc.getSnapshot(null); // if null is give it defaults to PNG
       
    } catch (MediaException pe) {
       } catch (
    IOException ioe) {
       } 
    thanks,
    ~Amitabh

Similar Threads

  1. Problems with MBM and MBG file
    By rsiudak in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 5
    Last Post: 2010-02-19, 02:23
  2. Replies: 0
    Last Post: 2008-01-30, 13:51
  3. [announce] PyUIQ. Python for UIQ 2.1 and 3.x
    By OscarBernabeu in forum Python
    Replies: 35
    Last Post: 2008-01-17, 09:12
  4. Error with makesis.exe and creating the .pkg file
    By gramya87 in forum Symbian Tools & SDKs
    Replies: 7
    Last Post: 2007-10-10, 13:53
  5. Help needed with a 3gp file...
    By joedoe_1981 in forum Streaming and Video
    Replies: 0
    Last Post: 2007-07-18, 18:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved