Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVPlayer Slider seeking Backwards issue

I am using AVplayer to play videos in my app. I am using seekToTime:toleranceBefore:toleranceAfter:

to seek through the video using a slider so the problem is when you slide in forward direction, video seeks perfectly (looks like video is moving faster) but in backward sliding video looks jerky while sliding back (basically not as smooth as sliding florward shows). Does anyone know what the problem is or am I doing something wrong.

Please Help.

like image 373
iparag Avatar asked Jul 23 '12 05:07

iparag


1 Answers

I was having the same issue on iPhone. Here is the checklist:

  1. Make sure providesPreciseDurationAndTiming is returning YES
  2. Make sure canPlayReverse is YES (Some codecs don't support it I guess.)
  3. Don't use the highest quality.

AVCaptureSession defaults to high quality capture. You need to use a lower quality setting if you want silky smooth reversing, even on iPhone 5. Going backwards takes more compute as most codecs are optimized for decompressing in the forward direction.

As a workaround, if you require high quality capture, you can capture to a high res format, export to a low res format and use that to do your editing with, then use the times to trim the original high res image. I am contemplating doing this in my own app.

like image 144
Ray Fix Avatar answered Sep 17 '22 21:09

Ray Fix