Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Relationship between Latency and Frame Rate

Relationship between Latency and Frame Rate

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
5 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Django_Untaken
    wrote on last edited by
    #1

    Hello. I am a beginner in audio/video. + Why do we use Sleep() function (or timer) when we are processing audio/video samples. + If we are rendering a video where our frame rate is 29 fps, then what value should be passed to the Sleep() function? + Is this what is known as Latency?

    CPalliniC 1 Reply Last reply
    0
    • D Django_Untaken

      Hello. I am a beginner in audio/video. + Why do we use Sleep() function (or timer) when we are processing audio/video samples. + If we are rendering a video where our frame rate is 29 fps, then what value should be passed to the Sleep() function? + Is this what is known as Latency?

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2
      • Sleep is used to pause programm execution. I don't know why are you using it while processing audio/video.
      • Again, it depends on your actual implementation.
      • No, that's not latency, see Wikipedia[^].

      Veni, vidi, vici.

      In testa che avete, signor di Ceprano?

      D 1 Reply Last reply
      0
      • CPalliniC CPallini
        • Sleep is used to pause programm execution. I don't know why are you using it while processing audio/video.
        • Again, it depends on your actual implementation.
        • No, that's not latency, see Wikipedia[^].

        Veni, vidi, vici.

        D Offline
        D Offline
        Django_Untaken
        wrote on last edited by
        #3

        I may have wrongly used the term processing. I am actually displaying the video frames (frame rate = 29.97 fps) onto a dialog. Now when I didn't use Sleep(), the 18 second video completed in just 4-5 seconds. But after putting Sleep(25), it almost runs normally. What does this mean to you?

        R J 2 Replies Last reply
        0
        • D Django_Untaken

          I may have wrongly used the term processing. I am actually displaying the video frames (frame rate = 29.97 fps) onto a dialog. Now when I didn't use Sleep(), the 18 second video completed in just 4-5 seconds. But after putting Sleep(25), it almost runs normally. What does this mean to you?

          R Offline
          R Offline
          Rage
          wrote on last edited by
          #4

          Can you post your code ? You have to time your rendering, which is what you are doing in an awkward way with the Sleep instruction. If your target rate is 30 fps, you have to exactly wait 33ms between displaying each frame (which is obtained more or less with your Sleep(25)), but you don't use the Sleep instruction for that !

          ~RaGE();

          I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus Entropy isn't what is used to.

          1 Reply Last reply
          0
          • D Django_Untaken

            I may have wrongly used the term processing. I am actually displaying the video frames (frame rate = 29.97 fps) onto a dialog. Now when I didn't use Sleep(), the 18 second video completed in just 4-5 seconds. But after putting Sleep(25), it almost runs normally. What does this mean to you?

            J Offline
            J Offline
            jeron1
            wrote on last edited by
            #5

            This[^] might be an interesting read regarding Sleep(). I agree with Rage that Sleep() is not the best choice here, possibly waitable timers or SetTimer()?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups