Motion Vectors in AfterEffects

Hi,
The plugin i am developing needs Motion vectors. Looking at the SDK documentation the only  reference I have found in the sdk docs for motion vectors are in relation to the PF_CHANNELSUITE1, PF_GetLayerChannelTypedRefAndDesc. Which I read to only be availiable if they were in the underlying "file type", not quite sure what that means but doesn't sound like something I can depend on. Does after effects provide access to motion vectors for the input layer of effects?
Thanks,
Cian.

Thank you for your response. I am not really interested in identifing objects or surfaces in frame.
I am refereing to  http://en.wikipedia.org/wiki/Motion_vector that would descibe a pixels or block of pixels movement from one frame to another. These might be used for creating motion compensated frames (http://en.wikipedia.org/wiki/Motion_compensation).  
So I am hearing this is a no?
Thanks,
Cian.

Similar Messages

  • Overlay motion vectors

    Hi all! I solve the problem in which I want to find all the motion vector image, as in the picture. I am using the Overlay motion vectors function. But I do not know what the rate should be applied to the inputs Velocity Component 1 and Velocity Component 2. Help me, maybe I need to use the function Optical flow. But I also could not use it.
    Attachments:
    Overlay motion vectors.vi ‏1328 KB
    22da17293663c2056496223d23a577b2.png ‏151 KB

    Hi! Thank you! Success came. I used the feature, about which you say and even replaced the function of capturing video.
    And to the same set of the same types of values of the image as a example of the Optical Flow example.vi. But I do not stand on the spot and wanted to
    ask if there is one more thing.
    How to use this algorithm to a few areas of interest(ROI)? To one ROI algorithm applicable well, and here's to more does not work.
    Attachments:
    Снимок.JPG ‏84 KB
    Снимок1.JPG ‏56 KB
    Снимок2.JPG ‏47 KB

  • Extract motion vectors in MPEG-1 using JMF?

    Is there a way to extract motion vectors in MPEG-1 using JMF?
    Thanks in advance.

    That's a bizarre question... you're going to have to explain yourself better.
    A "motion vector"... what's that ?
    I'm guessing that you automatically want to compute the directions of one or more arbitrary objects in a video clip ????
    Are you expecting it to be 2D or 3D ?
    Any video clip, or a pre-defined scene like a table top experiment ?
    regards,
    Owen

  • What Program Should I use to create motion vector intro?

    Hello,
    I am creating an intro to a series I am making for a client. I will be animating vector images that I have created in Illustrator by saving them as ".ai" files. In the past I have created a similar project using Premiere Pro CS6 using ".png" files in hopes of saving time and processing power.(However, the final product's quality was not where it should have been.) Would it be more beneficial to create this project in After Effects CS6? What are the benefits of using vector images in After Effects rather than Premiere? Are they any benefits? Also if you have any experience creating animation in these programs I would love to hear any advice seeing that I am new to this type of work.
    Thanks,
    Alex

    What is the final destination of your animation, are you producing this to go on a DVD, or a website. After Effects is superior to Premiere in animation capabilities of vector objects (which really turn into bitmpaped objects for the final rendering no matter what program you use) , but Premiere is quicker for splicing videos together and putting transitions in between them.
    If the final quality is not where it should have been your settings were not correct. My advice is to  use an experienced professional to do this job for you, until you learn more about quality control for animation.

  • B-frames, 4 motion vectors, I-frames, trellis quantization, quarter pixel??

    i'm using the program ffmpegx and it has all these options that I don't know anything about. can anyone tell me what these different options do and their advantages/disadvantages?

    i dont know casue im not a video wiz. but have you tried these porgrams for converting video on a mac. I use all 3 depending on the type of video.
    quicktime pro 7
    handbrake
    http://diveintomark.org/howto/ipod-dvd-ripping-guide/
    or pspware
    http://www.versiontracker.com/dyn/moreinfo/macosx/26153
    did you see this
    http://homepage.mac.com/major4/ipod.html
    give those a try to. im sure 1 or all will prove easier.
    GFF

  • For all of you who are having Motion Menu render problems - try this

    Just humour me for a minute.
    I have another Sonic application, and a known bug in the Motion Menu rendering applies to 29.97DF projects only.
    IE, NTSC.
    Often the video in a motion menu will fail to mux.
    There are workarounds though.
    1 - Make sure your GOP structure is 15 at most
    2 - Make certain the frame length of your video file is divisible by the GOP structure. IE, it must be a multiple of 15 frames.
    3 - if these both fail, reduce the bitrate of the video 500kbps at a time until it muxes. Most will work at 7,000, some need to be 6,000 and there are even times when you need to go as low as 4000.
    Try it - Encore uses a Sonic Authorcore, so it's worth a look.

    >Are you saying that NTSC 29.97 divided by 15 is okay?
    Not really.
    What I am saying is that your movie frame length should be divisible by the GOP structure with a GOP of 15.
    With NTSC video, you can have GOP lengths
    i up to
    18, but it is not mandatory to go to 18 - 15 is a perfectly acceptable figure. You could use a GOP of 12 if you really wanted to. What this means is typically the number of frames between I-Frames.
    MPEG-2 encoding (AKA "Moving Pictures by Educated Guesswork") P & B frames work something like this:
    i P-frames provide more compression than I-frames because they take advantage of the data in the previous I-frame or P-frame. I-frames and P-frames are called reference frames. To generate a P-frame, the previous reference frame is reconstructed, just as it would be in a TV receiver or DVD player. The frame being compressed is divided into 16 pixel by 16 pixel macroblocks. Then, for each of those macroblocks, the reconstructed reference frame is searched to find that 16 by 16 macroblock that best matches the macroblock being compressed. The offset is encoded as a "motion vector." Frequently, the offset is zero. But, if something in the picture is moving, the offset might be something like 23 pixels to the right and 4 pixels up. The match between the two macroblocks will often not be perfect. To correct for this, the encoder computes the strings of coefficient values as described above for both macroblocks and, then, subtracts one from the other. This "residual" is appended to the motion vector and the result sent to the receiver or stored on the DVD for each macroblock being compressed. Sometimes no suitable match is found. Then, the macroblock is treated like an I-frame macroblock. The processing of B-frames is similar to that of P-frames except that B-frames use the picture in the following reference frame as well as the picture in the preceding reference frame. As a result, B-frames usually provide more compression than P-frames. B-frames are never reference frames.
    In short, the I-Frame is the full description reference frame. A P frame is also a reference frame but describes the difference between the last I-Frame & itself. A good analogy is when you are on the telephone & describing what you see to a friend. The initial background description (The street, the sky, what you can see etc) would be an I-Frame. Then you describe a person walking down the street - that would be your P-Frames, as you are only describing the i changes
    in the scene.
    The bitrate can also affect things - I mentioned this too, and if a motion menu will not mux, first make sure that the film length is divisible by the GOP, and that the GOP is 15.
    If it
    i still
    won't mux, drop the bitrate by factors of 500 until it will.

  • How to minimise motion artefacts in the time warp effect?

    Iv'e got a scene in disco where the subjects move quite quickly. How can I minimise the motion artefacts? What are the best settings? It looks sometimes quite 'digital' as if filtered with a median filter and sometimes there are ripple-like structures on the faces as if processed with wavelets.

    I've experimented for a while now and setting the error threshold to 10 (from 1) and the motion detail to 5 makes it look pretty good. The error threshold essentially decides when to switch to frame blending instead of motion estimation. With a motion detail of 5 the motion vectors are quite coarse and the hopping looks natural. Hope that saves somebody else's time!

  • Slow Motion Problems With Twixtor Pro in AE CS5.5

    Hello forum! I recorded some footage at 1080p and at 60 fps. My shutter speed was 1/1000 and the ISO was 3200. After importing my footage and applying twixtor pro to a solid and setting the color source to my footage, i get a lot of ghosting effects. Some other things i did with Twixtor: Changed speed % to 20, Cahnged Frame Interp to Motion Weighted Blend, Changed, Input Frame Rate to 29.97, and Finally Changed Warping to Inverse w/ smart blend. Below is my video. If the emedded video below doesn't work (because I'm new to the forums), then heres the link: http://www.youtube.com/watch?v=3qGmW7or3gw

    Peregrinecommando99 wrote:
    I'm a bit confused... How would a 1/2 shutter speed be better than 1/1000? I thought 1/1000 was faster?
    Maybe this will help. If you were going for a target slow mo of 1/2 speed and your playback was going to be at 30 fps then you'd shoot at 60 fps. If you had a film camera with a normal shutter shooting at 60 fps wold give you and exposure of about 1/100 of a second. That means that if you have a video camera that will shoot at 60 P, or even 60I that your shutter speed should not be any faster than 1/100 of a second. Slowing down 60P or 60i footage is easy, It only gets hard when you want to slow something down to 1/4 or even 1/8 normal speed.
    Let's take 1/8 speed. IOW one second of real time takes eight seconds of playback time.
    If your project was set to 24 fps that means your target filming frame rate would be 8 X 24 or 192 fps. That means your shutter speed would be somewhere close to 1/400 of a second or half the duration of the frame rate. So I guess I should have said frame rate times 2.
    Setting the shutter to 1/1000 will give you an unnatural look to the slow mo because the edges will be too sharp. There are some occasions when you want that crystal sharp image in slow mo, but you have to be able to film the original scene at a high frame rate. Images with very sharp fast moving edges give Twixtor a very hard time. The edges end up creating weird ghosting that can’t be interpolated away. It’s just too much information for the motion vectors to successfully recreate. 1/8 speed is about my limit for Twixtor. If the camera was capable of 60i or 60p that that means doesn't mean I could slow down that original footage to 1/16 speed. It means that at 1/8 speed I'd have twice as much original information to work with and would therefore get a better result. It also means that I'd still want a shutter speed that was no faster than 1/400 of a second.
    Did you follow that? First rule of slow mo: Film at as high a frame rate as you can with your camera. Second rule: Try and emulate the shutter speed of a film camera that is over-cranked. Third rule of slow mo: Don't try and slow down too much. The amount of slowdown you can successfully achieve depends entirely on the movement in the frame. Unfortunately, the faster the motion, the harder it is to slow it down using software interpolation.
    I spent several months working with re:vision fx on deinterlacing and speed changes in interlaced footage. This advice comes from several hundred experiments on several types of footage and from 40+ years behind the viewfinder of film cameras. I hope this helps.

  • How to best achieve slow motion and fast motion

    Hi - I am new to the forum and a basic user of Premiere Pro CS5. I am working on a project shot at 24 fps, and would like to do slow and fast motion.
    From what i understand there are 2-3 different ways to do this in Premiere - choosing speed/duration of the clip from timeline, or choosing time remapping form effects panel ot using rate stretch tool. Wondering how do these compare and which is better - any pointers for this will be great help. Also is slow motion and fast motion better done in After Effects than Premiere. Or any recommended plugins that would work on cs5 and cs5.5. Thanks.

    The main difference between using time-remapping and just using time-stretching is that time-remapping allows you to change the speed quite flexibly at different times in the same clip, whereas stretching just changes the rate for the whole clip.
    See this page:
    "Change speed and duration for one or more clips"
    > Also is slow motion and fast motion better done in After Effects than Premiere.
    After Effects has far more control, especially with regard to how new image information is created between the original frames when you change speed and require frame interpolation (frame blending). Pixel Motion and Timewarp use a very advanced motion vector method (based on the Foundry's Kronos software) for doing this.
    See "Time-stretching and time-remapping".

  • Slow Motion Software

    I do a lot of wildlife filming in Africa. Can't afford a camera which will give me the slow motion option. Looked at the TWIXTOR software from www.revisionfx.com, who claim compatibility with PPro CS5. Has anyone any other suggestion of other software which works on a similar principle (creating intermediate frames) and produces good quality slow motion for HD?

    Harm Millaard wrote:
    Twixtor is the first one to think of. I know there are a few more, but can't remember their names. I would not look any further and just choose Twixtor. Be prepared for long rendering times however.
    Yes, Twixtor appears to be the gold standard for this in the Ae community.  I saw a short film by a guy who was slowing down some footage to really small percentages, like 1%, and the outcome was pretty amazing, almost as if it had been shot with a high speed camera.
    The long render times are because Twixtor analyzes the clip before slowing it, and calculates motion vectors, and creates tween frames and blur in accordance with the motion contained in the video.

  • Motion or Twixtor for Speed ramping & Retiming?

    Can anyone tell me if Apple Motion can create "the same" speed ramping & retiming effects that Twixtor does?
    Yeah, I'm new!
    Any help is appreciated.

    Yes, it has optical-flow retiming - it can analyze footage based on motion vectors. But it works pretty straightforward, Twixtor has a lot more options to control the effect, like using massk to track specific motion. So basically the technology is the same, but options are very limited.

  • Problem converting a (working) Java program into an applet

    When I'm trying to access an Image through a call to :
    mediaTracker = new MediaTracker(this);
    backGroundImage = getImage(getDocumentBase(), "background.gif");
    mediaTracker.addImage(backGroundImage, 0);
    I'm getting a nullPointerException as a result of the call to getDocumentBase() :
    C:\Chantier\Java\BallsApplet
    AppletViewer testBallsApplet.htmljava.lang.NullPointerException
    at java.applet.Applet.getDocumentBase(Applet.java:125)
    at Balls.<init>(Balls.java:84)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
    orAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
    onstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    at java.lang.Class.newInstance0(Class.java:296)
    at java.lang.Class.newInstance(Class.java:249)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:548)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:477)
    at sun.applet.AppletPanel.run(AppletPanel.java:290)
    at java.lang.Thread.run(Thread.java:536)
    It seems very weird to me... :-/
    (all the .gif files are in the same directory than the .class files)
    The problem appears with AppletViewer trying to open an HTML file
    containing :
    <HTML>
    <APPLET CODE="Balls.class" WIDTH=300 HEIGHT=211>
    </APPLET>
    </HTML>
    (I tried unsuccessfully the CODEBASE and ARCHIVE attributes, with and without putting the .gif and .class into a .jar file)
    I can't find the solution by myself, so, I'd be very glad if someone could help
    me with this... Thank you very much in advance ! :-)
    You'll find below the source of a small game that I wrote and debugged (without
    problem) and that I'm now (unsuccessfully) trying to convert into an Applet :
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.net.URL;
    public class Balls extends java.applet.Applet implements Runnable, KeyListener
    private Image offScreenImage;
    private Image backGroundImage;
    private Image[] gifImages = new Image[6];
    private Image PressStart ;
    private Sprite pressStartSprite = null ;
    private Image YouLose ;
    private Sprite YouLoseSprite = null ;
    private Image NextStage ;
    private Sprite NextStageSprite = null ;
    private Image GamePaused ;
    private Sprite GamePausedSprite = null ;
    //offscreen graphics context
    private Graphics offScreenGraphicsCtx;
    private Thread animationThread;
    private MediaTracker mediaTracker;
    private SpriteManager spriteManager;
    //Animation display rate, 12fps
    private int animationDelay = 83;
    private Random rand = new Random(System.currentTimeMillis());
    private int message = 0 ; // 0 = no message (normal playing phase)
    // 1 = press space to start
    // 2 = press space for next level
    // 3 = game PAUSED, press space to unpause
    // 4 = You LOSE
    public static void main(String[] args)
    try
    new Balls() ;
    catch (java.net.MalformedURLException e)
    System.out.println(e);
    }//end main
    public void start()
    //Create and start animation thread
    animationThread = new Thread(this);
    animationThread.start();
    public void init()
    try
    new Balls() ;
    catch (java.net.MalformedURLException e)
    System.out.println(e);
    public Balls() throws java.net.MalformedURLException
    {//constructor
    // Load and track the images
    mediaTracker = new MediaTracker(this);
    backGroundImage = getImage(getDocumentBase(), "background.gif");
    mediaTracker.addImage(backGroundImage, 0);
    PressStart = getImage(getDocumentBase(), "press_start.gif");
    mediaTracker.addImage(PressStart, 0);
    NextStage = getImage(getDocumentBase(), "stage_complete.gif");
    mediaTracker.addImage(NextStage, 0);
    GamePaused = getImage(getDocumentBase(), "game_paused.gif");
    mediaTracker.addImage(GamePaused, 0);
    YouLose = getImage(getDocumentBase(), "you_lose.gif");
    mediaTracker.addImage(YouLose, 0);
    //Get and track 6 images to use
    // for sprites
    gifImages[0] = getImage(getDocumentBase(), "blueball.gif");
    mediaTracker.addImage(gifImages[0], 0);
    gifImages[1] = getImage(getDocumentBase(), "redball.gif");
    mediaTracker.addImage(gifImages[1], 0);
    gifImages[2] = getImage(getDocumentBase(), "greenball.gif");
    mediaTracker.addImage(gifImages[2], 0);
    gifImages[3] = getImage(getDocumentBase(), "yellowball.gif");
    mediaTracker.addImage(gifImages[3], 0);
    gifImages[4] = getImage(getDocumentBase(), "purpleball.gif");
    mediaTracker.addImage(gifImages[4], 0);
    gifImages[5] = getImage(getDocumentBase(), "orangeball.gif");
    mediaTracker.addImage(gifImages[5], 0);
    //Block and wait for all images to
    // be loaded
    try {
    mediaTracker.waitForID(0);
    }catch (InterruptedException e) {
    System.out.println(e);
    }//end catch
    //Base the Frame size on the size
    // of the background image.
    //These getter methods return -1 if
    // the size is not yet known.
    //Insets will be used later to
    // limit the graphics area to the
    // client area of the Frame.
    int width = backGroundImage.getWidth(this);
    int height = backGroundImage.getHeight(this);
    //While not likely, it may be
    // possible that the size isn't
    // known yet. Do the following
    // just in case.
    //Wait until size is known
    while(width == -1 || height == -1)
    System.out.println("Waiting for image");
    width = backGroundImage.getWidth(this);
    height = backGroundImage.getHeight(this);
    }//end while loop
    //Display the frame
    setSize(width,height);
    setVisible(true);
    //setTitle("Balls");
    //Anonymous inner class window
    // listener to terminate the
    // program.
    this.addWindowListener
    (new WindowAdapter()
    {public void windowClosing(WindowEvent e){System.exit(0);}});
    // Add a key listener for keyboard management
    this.addKeyListener(this);
    }//end constructor
    public void run()
    Point center_place = new Point(
    backGroundImage.getWidth(this)/2-PressStart.getWidth(this)/2,
    backGroundImage.getHeight(this)/2-PressStart.getHeight(this)/2) ;
    pressStartSprite = new Sprite(this, PressStart, center_place, new Point(0, 0),true);
    center_place = new Point(
    backGroundImage.getWidth(this)/2-NextStage.getWidth(this)/2,
    backGroundImage.getHeight(this)/2-NextStage.getHeight(this)/2) ;
    NextStageSprite = new Sprite(this, NextStage, center_place, new Point(0, 0),true);
    center_place = new Point(
    backGroundImage.getWidth(this)/2-GamePaused.getWidth(this)/2,
    backGroundImage.getHeight(this)/2-GamePaused.getHeight(this)/2) ;
    GamePausedSprite = new Sprite(this, GamePaused, center_place, new Point(0, 0),true);
    center_place = new Point(
    backGroundImage.getWidth(this)/2-YouLose.getWidth(this)/2,
    backGroundImage.getHeight(this)/2-YouLose.getHeight(this)/2) ;
    YouLoseSprite = new Sprite(this, YouLose, center_place, new Point(0, 0),true);
    BackgroundImage bgimage = new BackgroundImage(this, backGroundImage) ;
    for (;;) // infinite loop
    long time = System.currentTimeMillis();
    message = 1 ; // "press start to begin"
    while (message != 0)
    repaint() ;
    try
    time += animationDelay;
    Thread.sleep(Math.max(0,time - System.currentTimeMillis()));
    catch (InterruptedException e)
    System.out.println(e);
    }//end catch
    boolean you_lose = false ;
    for (int max_speed = 7 ; !you_lose && max_speed < 15 ; max_speed++)
    for (int difficulty = 2 ; !you_lose && difficulty < 14 ; difficulty++)
    boolean unfinished_stage = true ;
    spriteManager = new SpriteManager(bgimage);
    spriteManager.setParameters(difficulty, max_speed) ;
    //Create 15 sprites from 6 gif
    // files.
    for (int cnt = 0; cnt < 15; cnt++)
    if (cnt == 0)
    Point position = new Point(
    backGroundImage.getWidth(this)/2-gifImages[0].getWidth(this)/2,
    backGroundImage.getHeight(this)/2-gifImages[0].getHeight(this)/2) ;
    spriteManager.addSprite(makeSprite(position, 0, false));
    else
    Point position = spriteManager.
    getEmptyPosition(new Dimension(gifImages[0].getWidth(this),
    gifImages[0].getHeight(this)));
    if (cnt < difficulty)
    spriteManager.addSprite(makeSprite(position, 1, true));
    else
    spriteManager.addSprite(makeSprite(position, 2, true));
    }//end for loop
    time = System.currentTimeMillis();
    while (!spriteManager.getFinishedStage() && !spriteManager.getGameOver())
    // Loop, sleep, and update sprite
    // positions once each 83
    // milliseconds
    spriteManager.update();
    repaint();
    try
    time += animationDelay;
    Thread.sleep(Math.max(0,time - System.currentTimeMillis()));
    catch (InterruptedException e)
    System.out.println(e);
    }//end catch
    }//end while loop
    if (spriteManager.getGameOver())
    message = 4 ;
    while (message != 0)
    spriteManager.update();
    repaint();
    try
    time += animationDelay;
    Thread.sleep(Math.max(0,time - System.currentTimeMillis()));
    catch (InterruptedException e)
    System.out.println(e);
    }//end catch
    you_lose = true ;
    if (spriteManager.getFinishedStage())
    message = 2 ;
    while (message != 0)
    spriteManager.update();
    repaint();
    try
    time += animationDelay;
    Thread.sleep(Math.max(0,time - System.currentTimeMillis()));
    catch (InterruptedException e)
    System.out.println(e);
    }//end catch
    } // end for difficulty loop
    } // end for max_speed
    } // end infinite loop
    }//end run method
    private Sprite makeSprite(Point position, int imageIndex, boolean wind)
    return new Sprite(
    this,
    gifImages[imageIndex],
    position,
    new Point(rand.nextInt() % 5,
    rand.nextInt() % 5),
    wind);
    }//end makeSprite()
    //Overridden graphics update method
    // on the Frame
    public void update(Graphics g)
    //Create the offscreen graphics
    // context
    if (offScreenGraphicsCtx == null)
    offScreenImage = createImage(getSize().width,
    getSize().height);
    offScreenGraphicsCtx = offScreenImage.getGraphics();
    }//end if
    if (message == 0)
    // Draw the sprites offscreen
    spriteManager.drawScene(offScreenGraphicsCtx);
    else if (message == 1)
    pressStartSprite.drawSpriteImage(offScreenGraphicsCtx);
    else if (message == 2)
    NextStageSprite.drawSpriteImage(offScreenGraphicsCtx);
    else if (message == 3)
    GamePausedSprite.drawSpriteImage(offScreenGraphicsCtx);
    else if (message == 4)
    YouLoseSprite.drawSpriteImage(offScreenGraphicsCtx);
    // Draw the scene onto the screen
    if(offScreenImage != null)
    g.drawImage(offScreenImage, 0, 0, this);
    }//end if
    }//end overridden update method
    //Overridden paint method on the
    // Frame
    public void paint(Graphics g)
    //Nothing required here. All
    // drawing is done in the update
    // method above.
    }//end overridden paint method
    // Methods to handle Keyboard event
    public void keyPressed(KeyEvent evt)
    int key = evt.getKeyCode(); // Keyboard code for the pressed key.
    if (key == KeyEvent.VK_SPACE)
    if (message != 0)
    message = 0 ;
    else
    message = 3 ;
    if (key == KeyEvent.VK_LEFT)
    if (spriteManager != null)
    spriteManager.goLeft() ;
    else if (key == KeyEvent.VK_RIGHT)
    if (spriteManager != null)
    spriteManager.goRight() ;
    else if (key == KeyEvent.VK_UP)
    if (spriteManager != null)
    spriteManager.goUp() ;
    else if (key == KeyEvent.VK_DOWN)
    if (spriteManager != null)
    spriteManager.goDown() ;
    if (spriteManager != null)
    spriteManager.setMessage(message) ;
    public void keyReleased(KeyEvent evt)
    public void keyTyped(KeyEvent e)
    char key = e.getKeyChar() ;
    //~ if (key == 's')
    //~ stop = true ;
    //~ else if (key == 'c')
    //~ stop = false ;
    //~ spriteManager.setStop(stop) ;
    }//end class Balls
    //===================================//
    class BackgroundImage
    private Image image;
    private Component component;
    private Dimension size;
    public BackgroundImage(
    Component component,
    Image image)
    this.component = component;
    size = component.getSize();
    this.image = image;
    }//end construtor
    public Dimension getSize(){
    return size;
    }//end getSize()
    public Image getImage(){
    return image;
    }//end getImage()
    public void setImage(Image image){
    this.image = image;
    }//end setImage()
    public void drawBackgroundImage(Graphics g)
    g.drawImage(image, 0, 0, component);
    }//end drawBackgroundImage()
    }//end class BackgroundImage
    //===========================
    class SpriteManager extends Vector
    private BackgroundImage backgroundImage;
    private boolean finished_stage = false ;
    private boolean game_over = false ;
    private int difficulty ;
    private int max_speed ;
    public boolean getFinishedStage()
    finished_stage = true ;
    for (int cnt = difficulty ; cnt < size(); cnt++)
    Sprite sprite = (Sprite)elementAt(cnt);
    if (!sprite.getEaten())
    finished_stage = false ;
    return finished_stage ;
    public boolean getGameOver() {return game_over ;}
    public void setParameters(int diff, int speed)
    difficulty = diff ;
    max_speed = speed ;
    finished_stage = false ;
    game_over = false ;
    Sprite sprite;
    for (int cnt = 0;cnt < size(); cnt++)
    sprite = (Sprite)elementAt(cnt);
    sprite.setSpeed(max_speed) ;
    public SpriteManager(BackgroundImage backgroundImage)
    this.backgroundImage = backgroundImage ;
    }//end constructor
    public Point getEmptyPosition(Dimension spriteSize)
    Rectangle trialSpaceOccupied = new Rectangle(0, 0,
    spriteSize.width,
    spriteSize.height);
    Random rand = new Random(System.currentTimeMillis());
    boolean empty = false;
    int numTries = 0;
    // Search for an empty position
    while (!empty && numTries++ < 100)
    // Get a trial position
    trialSpaceOccupied.x =
    Math.abs(rand.nextInt() %
    backgroundImage.
    getSize().width);
    trialSpaceOccupied.y =
    Math.abs(rand.nextInt() %
    backgroundImage.
    getSize().height);
    // Iterate through existing
    // sprites, checking if position
    // is empty
    boolean collision = false;
    for(int cnt = 0;cnt < size(); cnt++)
    Rectangle testSpaceOccupied = ((Sprite)elementAt(cnt)).getSpaceOccupied();
    if (trialSpaceOccupied.intersects(testSpaceOccupied))
    collision = true;
    }//end if
    }//end for loop
    empty = !collision;
    }//end while loop
    return new Point(trialSpaceOccupied.x, trialSpaceOccupied.y);
    }//end getEmptyPosition()
    public void update()
    Sprite sprite;
    // treat special case of sprite #0 (the player)
    sprite = (Sprite)elementAt(0);
    sprite.updatePosition() ;
    int hitIndex = testForCollision(sprite);
    if (hitIndex != -1)
    if (hitIndex < difficulty)
    { // if player collides with an hunter (red ball), he loose
    sprite.setEaten() ;
    game_over = true ;
    else
    // if player collides with an hunted (green ball), he eats the green
    ((Sprite)elementAt(hitIndex)).setEaten() ;
    //Iterate through sprite list
    for (int cnt = 1;cnt < size(); cnt++)
    sprite = (Sprite)elementAt(cnt);
    //Update a sprite's position
    sprite.updatePosition();
    //Test for collision. Positive
    // result indicates a collision
    hitIndex = testForCollision(sprite);
    if (hitIndex >= 0)
    //a collision has occurred
    bounceOffSprite(cnt,hitIndex);
    }//end if
    }//end for loop
    }//end update
    public void setMessage(int message)
    Sprite sprite;
    //Iterate through sprite list
    for (int cnt = 0;cnt < size(); cnt++)
    sprite = (Sprite)elementAt(cnt);
    //Update a sprite's stop status
    sprite.setMessage(message);
    }//end for loop
    }//end update
    public void goLeft()
    Sprite sprite = (Sprite)elementAt(0);
    sprite.goLeft() ;
    public void goRight()
    Sprite sprite = (Sprite)elementAt(0);
    sprite.goRight() ;
    public void goUp()
    Sprite sprite = (Sprite)elementAt(0);
    sprite.goUp() ;
    public void goDown()
    Sprite sprite = (Sprite)elementAt(0);
    sprite.goDown() ;
    private int testForCollision(Sprite testSprite)
    //Check for collision with other
    // sprites
    Sprite sprite;
    for (int cnt = 0;cnt < size(); cnt++)
    sprite = (Sprite)elementAt(cnt);
    if (sprite == testSprite)
    //don't check self
    continue;
    //Invoke testCollision method
    // of Sprite class to perform
    // the actual test.
    if (testSprite.testCollision(sprite))
    //Return index of colliding
    // sprite
    return cnt;
    }//end for loop
    return -1;//No collision detected
    }//end testForCollision()
    private void bounceOffSprite(int oneHitIndex, int otherHitIndex)
    //Swap motion vectors for
    // bounce algorithm
    Sprite oneSprite = (Sprite)elementAt(oneHitIndex);
    Sprite otherSprite = (Sprite)elementAt(otherHitIndex);
    Point swap = oneSprite.getMotionVector();
    oneSprite.setMotionVector(otherSprite.getMotionVector());
    otherSprite.setMotionVector(swap);
    }//end bounceOffSprite()
    public void drawScene(Graphics g)
    //Draw the background and erase
    // sprites from graphics area
    //Disable the following statement
    // for an interesting effect.
    backgroundImage.drawBackgroundImage(g);
    //Iterate through sprites, drawing
    // each sprite
    for (int cnt = 0;cnt < size(); cnt++)
    ((Sprite)elementAt(cnt)).drawSpriteImage(g);
    }//end drawScene()
    public void addSprite(Sprite sprite)
    addElement(sprite);
    }//end addSprite()
    }//end class SpriteManager
    //===================================//
    class Sprite
    private Component component;
    private Image image;
    private Rectangle spaceOccupied;
    private Point motionVector;
    private Rectangle bounds;
    private Random rand;
    private int message = 0 ; // number of message currently displayed (0 means "no message" = normal game)
    private int max_speed = 7 ;
    private boolean eaten = false ; // when a green sprite is eaten, it is no longer displayed on screen
    private boolean wind = true ;
    private boolean go_left = false ;
    private boolean go_right = false ;
    private boolean go_up = false ;
    private boolean go_down = false ;
    public Sprite(Component component,
    Image image,
    Point position,
    Point motionVector,
    boolean Wind
    //Seed a random number generator
    // for this sprite with the sprite
    // position.
    rand = new Random(position.x);
    this.component = component;
    this.image = image;
    setSpaceOccupied(new Rectangle(
    position.x,
    position.y,
    image.getWidth(component),
    image.getHeight(component)));
    this.motionVector = motionVector;
    this.wind = Wind ;
    //Compute edges of usable graphics
    // area in the Frame.
    int topBanner = ((Container)component).getInsets().top;
    int bottomBorder = ((Container)component).getInsets().bottom;
    int leftBorder = ((Container)component).getInsets().left;
    int rightBorder = ((Container)component).getInsets().right;
    bounds = new Rectangle( 0 + leftBorder, 0 + topBanner
    , component.getSize().width - (leftBorder + rightBorder)
    , component.getSize().height - (topBanner + bottomBorder));
    }//end constructor
    public void setMessage(int message_number)
    message = message_number ;
    public void setSpeed(int speed)
    max_speed = speed ;
    public void goLeft()
    go_left = true ;
    public void goRight()
    go_right = true ;
    public void goUp()
    go_up = true ;
    public void goDown()
    go_down = true ;
    public void setEaten()
    eaten = true ;
    setSpaceOccupied(new Rectangle(4000,4000,0,0)) ;
    public boolean getEaten()
    return eaten ;
    public Rectangle getSpaceOccupied()
    return spaceOccupied;
    }//end getSpaceOccupied()
    void setSpaceOccupied(Rectangle spaceOccupied)
    this.spaceOccupied = spaceOccupied;
    }//setSpaceOccupied()
    public void setSpaceOccupied(
    Point position){
    spaceOccupied.setLocation(
    position.x, position.y);
    }//setSpaceOccupied()
    public Point getMotionVector(){
    return motionVector;
    }//end getMotionVector()
    public void setMotionVector(
    Point motionVector){
    this.motionVector = motionVector;
    }//end setMotionVector()
    public void setBounds(Rectangle bounds)
    this.bounds = bounds;
    }//end setBounds()
    public void updatePosition()
    Point position = new Point(spaceOccupied.x, spaceOccupied.y);
    if (message != 0)
    return ;
    //Insert random behavior. During
    // each update, a sprite has about
    // one chance in 10 of making a
    // random change to its
    // motionVector. When a change
    // occurs, the motionVector
    // coordinate values are forced to
    // fall between -7 and 7. This
    // puts a cap on the maximum speed
    // for a sprite.
    if (!wind)
    if (go_left)
    motionVector.x -= 2 ;
    if (motionVector.x < -15)
    motionVector.x = -14 ;
    go_left = false ;
    if (go_right)
    motionVector.x += 2 ;
    if (motionVector.x > 15)
    motionVector.x = 14 ;
    go_right = false ;
    if (go_up)
    motionVector.y -= 2 ;
    if (motionVector.y < -15)
    motionVector.y = -14 ;
    go_up = false ;
    if (go_down)
    motionVector.y += 2 ;
    if (motionVector.y > 15)
    motionVector.y = 14 ;
    go_down = false ;
    else if(rand.nextInt() % 7 == 0)
    Point randomOffset =
    new Point(rand.nextInt() % 3,
    rand.nextInt() % 3);
    motionVector.x += randomOffset.x;
    if(motionVector.x >= max_speed)
    motionVector.x -= max_speed;
    if(motionVector.x <= -max_speed)
    motionVector.x += max_speed ;
    motionVector.y += randomOffset.y;
    if(motionVector.y >= max_speed)
    motionVector.y -= max_speed;
    if(motionVector.y <= -max_speed)
    motionVector.y += max_speed;
    }//end if
    //Move the sprite on the screen
    position.translate(motionVector.x, motionVector.y);
    //Bounce off the walls
    boolean bounceRequired = false;
    Point tempMotionVector = new Point(
    motionVector.x,
    motionVector.y);
    //Handle walls in x-dimension
    if (position.x < bounds.x)
    bounceRequired = true;
    position.x = bounds.x;
    //reverse direction in x
    tempMotionVector.x = -tempMotionVector.x;
    else if ((position.x + spaceOccupied.width) > (bounds.x + bounds.width))
    bounceRequired = true;
    position.x = bounds.x +
    bounds.width -
    spaceOccupied.width;
    //reverse direction in x
    tempMotionVector.x =
    -tempMotionVector.x;
    }//end else if
    //Handle walls in y-dimension
    if (position.y < bounds.y)
    bounceRequired = true;
    position.y = bounds.y;
    tempMotionVector.y = -tempMotionVector.y;
    else if ((position.y + spaceOccupied.height)
    > (bounds.y + bounds.height))
    bounceRequired = true;
    position.y = bounds.y +
    bounds.height -
    spaceOccupied.height;
    tempMotionVector.y =
    -tempMotionVector.y;
    }//end else if
    if(bounceRequired)
    //save new motionVector
    setMotionVector(
    tempMotionVector);
    //update spaceOccupied
    setSpaceOccupied(position);
    }//end updatePosition()
    public void drawSpriteImage(Graphics g)
    if (!eaten)
    g.drawImage(image,
    spaceOccupied.x,
    spaceOccupied.y,
    component);
    }//end drawSpriteImage()
    public boolean testCollision(Sprite testSprite)
    //Check for collision with
    // another sprite
    if (testSprite != this)
    return spaceOccupied.intersects(
    testSprite.getSpaceOccupied());
    }//end if
    return false;
    }//end testCollision
    }//end Sprite class
    //===================================//
    Thanks for your help...

    Sorry,
    Can you tell me how do you solve it because I have got the same problem.
    Can you indicate me the topic where did you find solution.
    Thank in advance.

  • How do you get the best quality on Apple Tv using Imovie08?

    I have done some searching and still have some questions. I have been creating movies from my home movie DV (digital8) tapes. when I am done I export using the highest setting. I am thinking that most D8 cameras are 480i or P. When exported higher does the computer upscale this? Should I export in 640x480 and let the tv do the upscaling or does the DV have enough lines to do the higher setting. There is a lot of discussion about 06 but since I started with 08 I find it difficult to navigate and after several posts it seems that the quality is no different. I do have quicktime pro so if it is better to export from Imovie to quicktime then to apple tv into Itunes please advise.
    Thanks
    GE

    My Question is on QTP what should the data rate be for DV.
    It depends on which variant you are using. The DV Stream options for DV and DVCPRO (also known as DV25 and DVCPRO25) are typically between 28.5 and 29.0 Mbps for the video track and the same for the audio track while DVCPRO50 has twice that data rate for both audio and video tracks. The QT DV and DVCPRO video codecs used by the "Movie to QT Movie" option are typically about 23 Mbps with DVCPRO50 coming in at about 46.0 Mbps. As to the audio data rate component, it all depends on which audio codec you use. Most people probably opt for the Linear PCM 16-bit 48 KHz combination which is usually on the order of about 800 Kbps.
    Original Data rates for some full QT conversions are over 20k This is as you know not supported by ATV.
    Correct. And, since iMovie '08 converts from whatever compression format that was originally imported to the application, doesn't it make more sense to export DIRECTLY to the final compression format you plan to use with your TV device? You can export directly/indirectly to iTunes (i.e., via the "Movies > Sharing" folder) using the sharing option or you can export via the "Using QT" option to either the contextual (CAVLC) Progressive Main Profile preset or using your own custom settings.
    If one of you would be so kind as to list the largest file that can be played in ATV using quicktime in the form of input that would be great.
    The maximum H.264 display dimensions at 24/25 fps is 720p (1280x720) and at 30 fps 540p (960x540) and a max video data rate of 5 Mbps with AAC-LC audio limited to 160 Kbps and a 48.0 KHz sampling rate in M4v, MP4, or MOV file containers. The maximum MPEG-4 Simple Profile dimensions of 720x432 at 30 fps at a max data rate of 3 Mbps with AAC-LC audio limited to 160 Kbps and a 48.0 KHz sampling rate.
    Since I am still uneducated about the relations to all these numbers and see different sizes that play ok in ATV I need some advice. I have even exported from quicktime and let Itunes compress to ATV. The file was bigger than what was sent from Imovie, the data rate was more, but per second was the same.
    Pre-sets and user settings "target" a data rate but content variables such as lighting, contrast, color saturated, amount of action and its motion vectors, frequency of scene changes/key framing, etc. all affect an end product. Further, when dealing with multi-pass encoding, the data rate excursion (i.e., variation above and below the targeted video data rate) may also come into play. For instance, an iPod file target with a video data rate of 1500 Kbps in extreme cases may have an instantaneous data rate between 600 Kbps and 3750 Kbps using the "Download" setting and can prevent iTunes synchronization. Haven't looked that deeply into TV since I use a custom iPod setting for day-to-day use of a a single file for iPhone, iPod, TV, as well as, web site, server, peer-to-peer, QTL, and reference file sharing of media. (I.e., I use my original DVDs when I want "full" audio and video quality.)

  • Playing .MOV files are choppy on DVDs

    I record audition videos using the front face camera on my iPad 3 so it would be in the required 4:3 format and in pure .mov format (no conversion needed).  It plays fine even when I play it on my Windows desktop.  My problem is when I play them from the Standard DVD I burned them to it is choppy.  Sometimes the video freezes and the audio plays normally or the other way around.  If I replay the same video again it still happens but at different times.  I bought the iPad because I thought the issue was with the conversion from the camcorder mpeg format to mov format; but the video is now in pure mov format straight from the iPad.  If I copy the video from the DVD to the computer it plays fine so I know the file is good.  I have tried different brands of DVD disks and also different DVD burning drives, same result.  I have use the Windows burning app and InfraRecorder app, same result.  I am considering something like NERO 11 but do not want to get stuck with something else I do not need if it does not fix the problem.
    Is there some magical procedure I need to do to get the videos to play smoothly?
    Equipment at home: Win XP PC, Win 7 64-bit laptop, iPad 3
    Any help would be greatly appreciated,
    ijmolder

    Now a technical question:  How does changing the Data rate affect the quality of the video?  I started with an 8x CD speed (2400 kbits/sec) but wonder if I should up it to a 12x or 16x.  Since I am not sure what speed DVD-ROM the viewer will have I do not want to go too high and end up with choppy video again. But then again, any computer (Apple or PC) now-a-days should have a ROM drive 16x or higher, don’t you think?
    Not sure if you are referring to the burn speed here or the encoded data rate of the file. Slower burns usually better in terms of the "burn" quality which may make a differece to some CD players. Encode data rates improve video quality up to a point but, of course, increase the size of the file you burn to optical disc. I normally use an 8X burn rate for maximum device compatibility and limit encode data rates to the 4.0 to 5.0 Mbps range. This is about the same data rate range used on single layer MPEG-2 DVD players and usually provides a "quality ceiling" greater than MPEG-2 DVDs since the H.264 codec is more efficient.
    Also, is the Video Data rate and Optimized for CD/DVD-ROM the only things I need to change?  I did not touch the Motion or Audio side leaving them at the default settings.
    These two settings are the most critical since they determine how much data is packaged and how it is packaged. Frame rates, key frame rates, and other settings determing how data is distributed per unit of time but are more frequently used to improve the rendering of objects in motion or having complex motion vectors, better rendering of fades, change the "per pixel" data rates, etc. How you manipulate these settings is often a matter of personal preference depending on the actual content of the mendia and is frequently the reason why proper encoding is considered an "art" by some.

  • Moving from Linux to Final Cut Pro, Need Help Creating Same Mpeg-4 videos

    I am seeking to move into Final Cut Pro to develop these types of videos that I have previously been creating in Linux.
    How can Final Cut Pro make these videos in the format specified below (OR VERY CLOSE TO IT)?
    Please let me know what settings with screenshots, etc. will make final cut pro output in this way.
    MINIMUM output requirements Video codec: Mpeg-4 (divx) with 2400 vbitrate, Audio Codec: MP3 and File container .avi
    I look forward to your help, below are the details I've used in Linux, so please help me create these videos using Final Cut Pro.
    I need this information by the end of the week.
    Thanks!
    To Convert from a captured uncompressed video to MPEG-4 (Divx) with MP3
    audio at 2400 bits using mencoder
    http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html
    mencoder -ffourcc divx capture002.avi -oac mp3lame -ovc lavc -lavcopts
    vcodec=mpeg4:vbitrate=2400:v4mv:mbd=2:trell:cmp=3:subcmp=3:mbcmp=3:autoaspect:vp ass=1
    -vf harddup -noskip -mc 0 -o test.avi
    -------------VIDEO ------------
    Video Encoded to Codec (MPEG-4) with ffourcc divx (divx4)
    Video Bitrate = 2400 (vbitrate=2400),
    Allow 4 motion vectors per macroblock (slightly better quality) (v4mv)
    Motion estimation=2 (mbd=2)
    Trellis searched quantization. This will find the optimal encoding for
    each 8x8 block. Trellis searched quantization is quite simply an optimal
    quantization in the PSNR versus bitrate sense (Assuming that there would
    be no rounding errors introduced by the IDCT, which is obviously not the
    case.). It simply finds a block for the minimum of error and lambda*bits.
    (trell)
    Sets the comparison function for full pel motion estimation (cmp=3)
    Sets the comparison function for sub pel motion estimation (subcmp=3)
    Motion Search Algorithm (mbcmp=3)
    Same as the aspect option, but automatically computes aspect, taking into
    account all the adjustments (crop/expand/scale/ etc.) made in the filter
    chain. Does not incur a performance penalty, so you can safely leave it
    always on. (autoaspect)
    Activates internal two (or more) pass mode, only specify if you wish to
    use two (or more) pass encoding. (vpass=1)
    duplicate frames (harddup)
    no skipping (-noskip)
    ------------- AUDIO ------------
    Audio Encoded to Codec (MPEG-3)
    ------------- FILE CONTAINER ------------
    File Container (.avi)
    DOCUMENTATION FOR MENCODER
    http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html#GENERAL%20ENCODING%20OPTIONS% 20(MENCODER%20ONLY)

    I need this information by the end of the week.< </div>
    Not likely.
    Easiest solution is to produce your edited material in FCP and then move the fully rendered, self-contained movie, in whatever format you are producing, to your Linux machine and use its encoder/transcoder.
    Compressor will do the job for MP3 and MP4 but you will need to purchase the DIVX codec or transport it to your Mac. You need to talk to DiVX and you need to open the manual for Compressor. Compressor is not easy to learn how to use i na day but whatever you were using on your Linux box was much more difficult to learn.
    bogiesan

Maybe you are looking for

  • How to do reassingment of the task from the workflow.

    Hi, I have two work flow one is approval workflow & another is reassignment workflow in which manager approval is need for reassignment, once manager will approve, task should be reassing to requested user in approval workflow. How can i reassign the

  • Correct File Size-Web Photo Gallery?

    I've optimized my photos in photoshop and now its time to display the photos at their best quality on the web. I'm curious how working photographers proceed at this point. What methods are used to get your final image optimized for best quality viewi

  • IPhone 3G and Exchange - Make sure Exchange has SP2 and install cert

    I had been working with a client to get his iPhone 3G connected to Exchange. Worked through all issues, got account setup, everything looked fine but no mail. No errors but no mail. I have read a lot of other posts regarding the same issue. Here are

  • Mosaic doesn't work for printing cd covers

    Tried to use Mosaic to make a CD insert that would show all the album covers in a playlist I was burning to CD. All tunes purchased from the iTMS and all came with artwork (it showed as I played the tracks). But when I chose Print from the file menu,

  • Oracle 10gR2 upgarde from 32-bit to 64-Windows

    Dear Guru's We have 10.2.0.4 Primary database which runs on Windows 2003 server(32-bits) .Primary has 2 Standby database. Now we are planning to upgarde the OS of this primary to Windows 2008 64-bit. For this i will have to download and install new o