Skip to content

[iOS] Seek issue #2387

@CyberChroma

Description

@CyberChroma

Unity version

2022.3.62f2

Unity editor platform

macOS

AVPro Video edition

Ultra

AVPro Video version

3.3.2 (v3.2.6f1-ultra)

Device hardware

iPad Pro 11inch, and in editor on Windows and Mac

Which iOS version are you using?

18.7.1

Texture format

BGRA

Audio output

Unity

Any other Media Player component configuration required to reproduce the issue.

Not sure if any other AVPro settings would be relevant, would be happy to share

The relevant code basically just comes down to
mediaPlayer.Control.Seek(someRandomTime) or mediaPlayer.Control.SeekFrame(someRandomFrame)

Then we use mediaPlayer.TextureProducer.GetTexture(), and custom blit that to a RenderTexture

Which output component(s) are you using?

Audio Output

Any other component configuration required to reproduce the issue.

No response

The issue

TLDR: Is there any known way to Seek to a frame on a video that isn't all keyframes, and have it get the right frame, even if it takes longer to grab?
If not, what's the quickest smallest conversion we'd need to do for Seeking to get the right frames, ideally not doing a full HAP conversion
Focusing on iOS, but would be nice if there's a solution for both iOS and Windows

Hi there,

We're having an issue with video Seeking on iOS. We have an app where, among other things, the user can import videos from their camera roll and play them, and it uses the AVProVideoPlayer. This works fine. But they can also scrub through to different parts of the video, or step through frame by frame, and this is having issues stuttering and not grabbing the right frames. Some videos do seek forward for a maybe a second then start getting choppy, and seeking backwards is pretty much bad immediately. We've tried the different Seek functions (Seek, SeekFast, SeekWithTolerance, SeekToFrame), none have seemed to work. To my understanding, this has to do with the codex of the video, and the number of keyframes, and whether the video is using i-frames. We're trying to see if there's a way we can get around this without having the change the input video and still have it grab the right frame.

We have tested using ffmpeg to convert the video to HAP or H.264, that while that does make the video scrub smoothly, it massively increases import time, and takes up a lot more space. So if there's no other way and the video must have some sort of re-encoding done, would you have any suggestions on some other simpler conversion we could do that would be faster?

Media information

Basically any video that's not all keyframes, here's an example of one:

Nascar.-.High.and.Wide.5.mp4

Log output

Metadata

Metadata

Assignees

Labels

iOSiOS platformtriageNeeds triage

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions