Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7938289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:46:03+00:00 2026-06-03T22:46:03+00:00

I’m very new to iPhone development and I’m making an application where I have

  • 0

I’m very new to iPhone development and I’m making an application where I have to play video, what I would like to do is to play a certain number of frames once an event is risen. Most of that is already done, but I couldn’t achieve yet, is how to play only 50 frames exactly, when I try to calculate how long 50 frames is by seconds, I’m able to make play/pause but after sometime, things starts to be wrong as the calculating is not 100% correct

Please if someone can help, I will be very glade to receive any advice/remark/critics, thank you in advance 🙂

P.S: I’m using MPMoviePlayerController to play my video

Regards

EDIT: If you know any other methods that can do what I need other than MPMoviePlayerController I can use it with no problem

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:46:04+00:00Added an answer on June 3, 2026 at 10:46 pm

    after a long research I couldn’t find what I’m searching about (don’t know even if it exists), so the I was thinking of a solution for this and following are the solutions I found:

    1. Split the video file to sequences that I play only the the sequence I need.
    2. See the difference in time between what I wanted to play and what it was really played than correct it in the next turn.

    For me when I tried to split the video, I lost quality, so I used the second method which I’m describing bellow:

    I needed to play 20 frames out of 720, my frame rate is 25 frames/second, after a basic calculating I could find that 20 frames is played in 0.8 second. lets say the “wait” variable is the duration (which is 0.8 for my case, but needs some correction) I would like to play (I will put how to calculated it later)

    First, I had defined a static “timer” in the class as:

        static NSTimer *timer;
    

    Because I’m playing in loop, I need to reste my timer every time I need to play a sequence (just to be sure), than I recreate it as new and set the function which will be called to pause the video (pauseVideoAtAnimation):

        [timer invalidate];
        timer = [NSTimer scheduledTimerWithTimeInterval:wait target:self selector:@selector(pauseVideoAtAnimation:) userInfo:nil repeats:NO];
    

    Than I play the video:

        [player.moviePlayer play]
    

    after that all we need to add is the instruction in the pauseVideoAtAnimation to pause the video

        [self.player.moviePlayer pause];
    

    All of that I have done it before even asking for help, so what changes in the correction of the wait variable, following is the instruction for that (here we need a counter which starts from 0, and counts how many time we played a sequence)

         double wait = 0.8;
         wait += (counter * wait - self.player.moviePlayer.currentPlaybackTime);
         counter ++;
    

    and thats it, if any one have the same problem or just curious about the solution, don’t hesitate to contact me 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I would like to count the length of a string with PHP. The string
I want use html5's new tag to play a wav file (currently only supported
I have some data like this: 1 2 3 4 5 9 2 6
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.