frame by frame video

Discussion in 'iOS Development' started by acca2o, Jan 23, 2010.

  1. acca2o

    acca2o New Member

    Joined:
    Sep 26, 2009
    Messages:
    51
    Likes Received:
    0
    Device:
    2G iPod touch
    Hi,
    I need to play a video by showing a sequence of images.
    I try by UIImageView and NSTimer classes but the NSTimer can't reach fast framerates (25fps).
    So I'm looking for a different way.

    My problem is that a get the images from a webcam, I send them to the ipod by wifi and need to show the video with very low latency. So I need to send images without codec delay.

    Some idea?
    Thanks
  2. lauNchD

    lauNchD Well-Known Member

    Joined:
    Jan 27, 2008
    Messages:
    1,844
    Likes Received:
    261
    Device:
    iPhone 5 (Black)
    NSTimer can be accurate to about 1/100th of a second or more if the method called isn't too expensive (it usually calls back to the main thread, so the called method blocks everything else).
    You could spawn a separate thread which synchronously downloads the images and calls back to the main thread once an image has loaded.
    Nevertheless, your iPod/webcam may not be able to transfer images at 25 fps, unless it's an actual video stream, which would require something like MPMoviePlayer or a s***load of work to implement your own.
  3. acca2o

    acca2o New Member

    Joined:
    Sep 26, 2009
    Messages:
    51
    Likes Received:
    0
    Device:
    2G iPod touch
    Thanks a lot!!!
    I'll try with a separate thread and check about the right frame rate.
    Now i'm going to google for "separate thread".
    Bye
  4. lauNchD

    lauNchD Well-Known Member

    Joined:
    Jan 27, 2008
    Messages:
    1,844
    Likes Received:
    261
    Device:
    iPhone 5 (Black)
    Don't google "seperate thread," it's way too general!
    You can use the NSThread detach method (very easy to use, check out the documentation) along with NSObject's performSelectorOnMainThread[...] .

Share This Page