0

in my app i want to add feature . swipe on video take the video to next 2 sec from current playback time. but my player not doing this accurate and exact according to time which i pass to function it jump the current play back time at any where else. i already search a lot and found may be this is due to key-frame of my video i think i need to increase key-frame of video if yes then (1) what is the best way to increase key-frame of video? if this issue can solve without increasing key-frame then (2) how can i do this ?

here is my code

-(void) handleOneFingerSwipeRight
{
    if(labelTimer.isValid)
        [labelTimer invalidate];
    [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(signleTap) object:nil];
    [videoPlayer pause];
    double d = 0;
    d = floor([videoPlayer currentPlaybackTime]);
    d = d+2.0;
    NSLog(@"current time %f",floor([videoPlayer currentPlaybackTime]));
    NSLog(@"new time %f",d);
    [videoPlayer setCurrentPlaybackTime:d];
    [videoPlayer play];
    [self setLable:[NSString stringWithFormat:@"Adaptive Forward %f",d]];
}
David Snabel-Caunt
  • 57,804
  • 13
  • 114
  • 132
Faheem Rajput
  • 591
  • 4
  • 8
  • 17
  • As you found out already, the encoding plays a key role. Question is, how do you currently encode your video? – Till Dec 02 '13 at 20:48
  • In case you used ffmpeg (which I strongly advise you to do), [this answer](http://stackoverflow.com/a/14121293/91282) should help. – Till Dec 02 '13 at 20:53
  • i am not encoding write now i just capture video from IOS device OR import from gallery so how to increase key-frame of video OR how to Encode video – Faheem Rajput Dec 03 '13 at 07:00

0 Answers0