I am trying to playback 720p videos frame by frame onto an Open GL texture using the callback methods in libVlc 2.2.1. This Open GL texture forms the background of a game that is Cocos2d-x based; I am basically using Cocos2d-x for an animated overlay on top of local video. The videos are chained together by the main application depending on in game events and it all works nicely 95% of the time. However, the occasional video(There are about 90 in total) stutters when playing back. I don't think it is the individual videos themselves, sometimes they work flawlessly, other times they stutter, and the stuttering lasts for the duration of the video, in most circumstances, the next video plays without the stutter.
The Win 7 machine used for testing the game on has a fairly recent i5 processor and a nVidia 750TI graphics card and a fully de-fragmented 7,200 rpm HDD, so it should be up to the task.
I have used the following:
Code: Select all
libvlc_video_set_callbacks(vlc_player_, lock, unlock, display, this); // 'this' is my MoviePlayer control and is used in the callbacks.
libvlc_video_set_format(vlc_player_, "RGBA", 1280, 720, 1280 * 4);
Code: Select all
CCEGLView* eglView = CCEGLView::sharedOpenGLView(); // Gets me the HWND of the root Cocos2d-x view.
libvlc_media_player_set_hwnd(vlc_player_, eglView->getHWnd());
The version of Cocos2d-x we are using is stable and has been used for other products by myself (without video) and is very low on CPU usage (0-7%)
Has anybody experienced anything similar when using libvlc_media_player_set_hwnd or libvlc_video_set_callbacks?
The frame rate of the videos is fixed at 30fps.
Kind regards,
Alan.