Im working on a project that is going to use many components, one of which will be video. I have experimented on a few of the video libraries out there and it seems like GSVideo is the most effective (not resource intensive).
I would like to be able to play an HD video file (1080 would be great, but would settle for 720) but I can't seem to get better than 15 fps playback. I currently am using an h264 compressed mov file, but have experimented with mp4, avi, m4v and ogg formats with various bitrates with similar results.
Does anyone have recommendations on compression settings to use or a library that will work more consistently?
ok, so i have got this playing fairly well with a 720 hd quicktime compressed as JPEG. Im still using the GSVideo lib, but also using the GLGraphics lib with the GLConstants.GLGRAPHICS as the renderer. Using a technique of copying the frames to a texture mentioned here:
You can still get some more performance by avoiding unnecessary texture copies. Basically, you should call putPixelsIntoTexture() only when you are sure a new video frame has been read. Take a look at the following code:
I also put manual framerate calculations, since the internal frameRate variable might not be accurate all the time. Also, there are actually two different framerates you need to consider: the rate at which the read() function is called (which should be same as the original video framerate if no frames are being dropped) and the rate at which the draw() function is called (which can be higher than the read rate).
On OSX, using the new frame trick with full HD video (1080p), I gain several frames, but the read framerate is still lower than the original video's framerate at some points. This is also dependent on the platform: on Linux I'm able to play 1080p with no frames dropped, performance on OSX is a little worse, followed by Windows. Hardware will also have an effect.
Leave a comment on andres's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic