- Home /
Jerky fullscreen video playback
Hi everyone,
I need to play fullscreen videos in my game. For it I create a video in ogg Theora 720p format and I apply it via a MovieTexture on my GUITexture. However the video rendering under Unity (in any way I choose import parameters) isn't smooth (video appears a bit jerky on camera tracking moves for example) while that is not the case when I watch it with VLC or Media Player Classic. It's just like some frames being skipped during video playback.
Do you know some tips to avoid this problem (compression settings, tool...)? Must I wait for a hypothetical update of the Unity video playing engine?
Thanks for your help.
Where you able to solve this? I'm on the same situation and I can't fin any solution.
Answer by cregox · Jul 10, 2012 at 02:42 PM
Do you think this may have something to do with it?
Unity 3.5.2 - Changelog
Movies: · Time.captureFramerate is respected by movie playback when movie does not have audio.
Old question, but for reference I'll comment: Yes, using Time.captureFramerate is the way to go, we fixed our jerky Theora movies the same way. However, when just setting Time.captureFramerate, Unity still renders as fast as it can. So if you get 60fps and set it to 30, everything will run twice as fast.
To get a stable framerate, we combined it with setting VSync to "every other blank", resulting in 30Hz if your display refresh rate is 60Hz. So we created our videos at 30fps, and set Time.captureFramerate=30, and everything was smooth. The only unavoidable drawback is that the movie and the game time can sometimes run more slowly, if your framerate drops below 30fps.
Ins$$anonymous$$d of the VSync method it should also be possible to use Application.targetFrameRate ins$$anonymous$$d, but I haven't tested that. So for example if you rely on your input video which happens to be 25fps, you would set both Time.captureFramerate and Application.targetFrameRate to 25.
Your answer
Follow this Question
Related Questions
Playing from a specific point using Handheld.PlayFullScreenMovie 0 Answers
Video Texture Loop 2 Answers
How to check if Handheld.PlayFullScreenMovie has stopped playing 2 Answers
Some questions about Handheld.PlayFullScreenMovie 0 Answers
How to import a movie texture and apply it without stretching? 1 Answer