- Home /
Setting frame index in VideoPlayer : key-frame issue ?
Hi everybody,
We currently are working with Unity 5.6.1f3 on a project using videos chosen by the user and viewed in a VideoPlayer component (we use the built-in VideoPlayer feature from Unity, for now).
We have an issue on our two platforms (PC under Windows, Mac under MacOS) with several video files : we want to be able to seek a specific frame by its index, for instance the 42th frame in a video, and we noticed that very often the frame visualized in the VideoPlayer render texture is quite incoherent. It seems it is instead a frame that is found sooner in the video, just like the decoder was instead giving us the last key-frame that was found before our requested frame.
Unity's documentation on this behaviour (setting frame property, seeking accuracy, platforms and codecs requirements) is very poor. I'd like to provide a demonstration of this problem, or at least one of the videos we are using, but I can't as this stuff is a confidential property of my company. However here are some of the container/video codec combinations we have :
MP4 / H264, approx. 60 or 30 fps
MOV / H264, approx. 28 fps
Any help or feedback on this issue would be great ! Thanks by advance
I'm currently having an issue almost similar where when I ask the videoplayer component to spawn at a specific frame : it spawn at the right frame and plays the video but then, a few frames later, it goes back to that asked frame (on IOS only) for no reasons and then continue playing.