AVPlayer Slider seeking Backwards issue
Asked Answered
V

2

9

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.

Vaishnava answered 23/7, 2012 at 5:51 Comment(1)
Can you pause before you seek? I am not 100% sure on this as I have not tried it out.Olomouc
S
3

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.

Sills answered 21/6, 2013 at 23:47 Comment(0)
T
0

i think its because the buffer gets empty when you stream backwards.Please do a KVO on the bufferIsEmpty value.It may be because in your application might be using lot of memory in terms of other resources.The best way to test this is to create another project and try the same.Just try using AVPlayerQueue instead of AVPlayer and see the result.

Turtleback answered 30/1, 2013 at 16:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.