Results 1 to 4 of 4

Thread: Frames per Second FPS

  1. #1
    Join Date
    May 2008
    Posts
    95

    Frames per Second FPS

    hello there

    I am trying to implement a simulation software, its about displaying some moving objects on the screen, and since i am very new to this thing, I made a little research & i am using SDL in the simulation (is it a good choice?),
    my question is mainly about the frames per second, i must run at 60 or 100 fps

    Please help me regarding this

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Frames per Second FPS

    irst, a few things.

    1. you can't use 'delay' code to guarantee framerate will ACHIEVE 60 or 100fps. if you run slower, you run slower... not much you can do there. Now, that's also different from wanting to FLIP on a 60Hz or 100Hz 'boundary' of time, which using VSYNC would help with.

    2. your delay code should keep a static that is 'start of world time', and base everything from there.

    3. you timeLeft isn't quite right. If you really want to delay AND sync moving forward, try:
    while (currentTime >= timeToNextUpdate) // using while guarantees we'll 'catch up' if a frame runs really late...
    timeToNextUpdate += m_iUpdateInterval; // increment to next interval based off whatever world start time was

    4. speed of objects should all be in UNITS PER SECOND. Meters. Feet. Whatever. Then, you would either use a per-frame constant for time (that is 1/Hz, which is 1/60th or 1/100th of a second) and multiply times u/s, OR when your 'physics' update runs, you calculate the delta time since the LAST physics update, and use that as your multiplier. But everything is done based on some delta between frames, and some speed per second value.

    Also note that if your delay 'runs late', and you 'catch up', you MUST use delta time between frames and not a per-frame constant. i.e., if you miss a frame, your delta isn't still 1/60th, it's 2/60ths (or more..) for that frame's physics run.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Frames per Second FPS

    Technological means can be used to suggest the appearance of movement. To create the perception of motion, the brain automatically adds or fills in missing information. It does this first through a concept known as persistence of vision, where a visual stimulus continues to be registered by the brain for a very short time after the stimulus ends. Secondly, it takes advantage of what is known as the phi function. For example, if two adjacent lights alternately flash on and off, we see a single light shifting back and forth. This is because we tend to fill in gaps between closely spaced objects of vision. These are exploited by motion pictures, which consist of rapid successions of still frames in which the "moving" objects are displaced a very short distance from one another.

    Because of these phenomena, the higher the FPS, the smoother the motion appears. In general, the minimum FPS needed to avoid jerky motion is about 30 FPS. For high-motion content, an encoding session around 60 FPS may be more beneficial.

    When dealing with FPS, it is important to also understand other terms that are used throughout the Windows Media Encoder:

    NTSC: National Television Standards Committee. The NTSC is responsible for setting television and video standards in the United States. The NTSC standard for television defines a composite video signal with a refresh rate of 29.97 FPS. The NTSC standard also requires that these frames be interlaced.
    PAL: Phase Alternating Line. The dominant television standard in Europe. The PAL standard delivers 25 FPS.
    Interlaced: Each NTSC or PAL video frame consists of two "fields." When displaying video, an NTSC television draws one field every 1/60th of a second, and PAL televisions display one field every 1/50th of a second. Interlacing involves merging the alternating fields of an image into a single frame. The process of separating the single field back into the original two fields is called DeInterlacing.
    Telecine: Most film content is created at 24 FPS. To meet the NTSC standard, extra frames are added to reach the 30 FPS requirement. This is done through an algorithm that creates an intermediate frame between two other frames. The process that removes the frames that were added when 24 FPS film was converted to 30 FPS video is known as Inverse Telecine.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Frames per Second FPS

    When content is streamed, it is very costly (in terms of CPU and network bandwidth) to send all of the video data from each single frame. To solve this problem, the Encoder has a key frame frequency setting. The key frame (also known as the I-frame) is a data frame that contains all of the video data. The intermittent frames only send changes, or deltas, from the key frame.

    Take for example a speaker at a podium. It makes more sense to only send the area of the screen that is changing (the speakers mouth, and maybe hands), then it does to send the background information as well. In this example, a higher key frame interval can be selected without harming video quality.

    If the content is of higher motion, then it is more beneficial to set the key frame rate lower. Examples of high-motion video are action movies or sporting events. In these instances, the entire frame is changing very quickly so a lot of data is going to be sent, and a higher-end computer is required to achieve desired results.

    Even though the key frame rate is set, it is possible for a key frame to be sent before the time interval elapses. If the delta is high enough, the Encoder automatically creates a new key frame.

Similar Threads

  1. HTML Frames
    By Adrina_g in forum Software Development
    Replies: 5
    Last Post: 19-01-2010, 10:06 AM
  2. 24 frames per second
    By Ximen in forum Monitor & Video Cards
    Replies: 5
    Last Post: 24-02-2009, 02:41 PM
  3. Problem with frames
    By Reegan in forum Software Development
    Replies: 3
    Last Post: 08-01-2009, 10:24 PM
  4. FPS (frames per second)
    By Theophilus in forum Overclocking & Computer Modification
    Replies: 1
    Last Post: 27-10-2008, 03:37 PM
  5. After the frames?
    By Rixwel in forum Software Development
    Replies: 5
    Last Post: 15-09-2008, 07:23 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,554,837.88504 seconds with 17 queries