I have no idea if this should be in the advanced section or not but ill try it here.
The app I’m coding is compiled with VS2010 on a PC btw.
First off openframeworks sucks (due to quicktime codecs for windows?) when it comes to playing multiple video files. I have literally tested dozens of encoding formats to no avail. Even for smaller files (320x240) playing just two files bogs down the computer from 60fps to 12fps. One solution was using ofxThreadedVideo but this is not enough. There is a very noticeable frame-drop in the videos while they are playing.
I can open the same video files with VLC in at least 5+ instances and none of them suffers from frame drops.
So what is going on?
Currently I have a single 430MB video file @ 1280x800 (.mov file, mpeg4 encoded) running in an pretty much empty app and it halves my fps from 60 to 30. Something must be terribly wrong here. Like i said. I have tried several encodings on the video file but none of them are much better than the other or simply just much worse.
It did help a bit to do a “MoviesTask(NULL,0);” instead of update. I found that trick somewhere in the forums but its still a marginal gain. I get very sporadic gains of 5-10 fps more.
Thanks for reporting this. You’re right, that video performance does sound a bit bad. What is your graphics card? Have you tried using a different one?
Can you file a bug report on the openFrameworks github repository at http://github.com/openframeworks/openFrameworks (the ‘Issues’ link), if your problem is related to the video card then we should have that documented somewhere, if not it needs looking into. windows is actually one of our weaker points as most of us are on different platforms, if you’d like to get involved in helping us make windows better it would be very welcome!
I have tried this on several computers and graphics cards and I get the same type of framedrops and CPU hoggning.
Even on a Intel i7 3.4ghz, 8gb ram, GeForce GTX 560 Ti the video-clip lags and has framedrops. Its still kind of mind-boggling that there are so many OF users out there but very few have complained and none have issued a bug report (that I can find at least) on such a fundamental part as ofVideoPlayer.
Unfortunately I don’t think I would be of much help resolving this issue myself but I hope that someone will be able to fix this. Its very unfortunate that such a vital part of OF is lacking in performance whilst most other parts are doing so well.
Have you tried using ofxThreadedVideo ? I have performance issues a lot on Windows with video. but ofxThreadedVideo works like magic. Getting gstreamer to work on windows with codeblock also provided a good performance boost for me. There’s a few forums posts about codecs and cidoeo formats that may ne of use to you.
benMcChesney: as I wrote in the original post; I have tried ofxThreadedVideo. The playback still has framedrops even if the main thread is not bogged down. so it does not really address the issue.
you’re right, it shouldn’t be slow, and if it’s happening across different formats and across different video cards then we have a major problem. please file a bug report.
(edit, I reread your post, and it sounds like you already have this turned off as you’re seeing granular FPS changes – I just clued into the 60 / 30 thing. leaving it up here in case it’s helpful for other folks)
another thing to test, considering we’re talking about frame rates here, is that if your VSYNC is enabled (by default on most graphics cards) you fps may drop from 60 to 30 fairly easily – it just takes anything that makes you render at less then 60 fps (59fps, for example) and vsyc will bring you down. Sometimes it will oscillate and you’ll see fps or 45, but generally, it will jump to the next divisor and stay there – suggesting your frame rate is cut in half when it’s more like you’ve jumped to the next multiple on vsyncs. it would be useful, to try to disable vsync
you’ll need to do this in code (setup)
ofSetVerticalSync(false);
but also on the control panel of your graphics card (it’s usually called vertical sync, flipping, etc).
you might see the same thing, or more accurate measures of time.
I had similar issues using Microsoft Visual Studio, however once I compiled for production, the video stopped being laggy. I think that it has to do with debugging builds.
I think, it’s about 0.9.8_vs_release. I used 0.9.3_vs_release some times ago and it’s not have video playing problem. But now, I’m using 0.9.8_vs_release and it’s have lagging problem.
My system is:
Windows 10 64 Bit
GTX 675MX 4 GB 16 GB Ram
I tried just 9 MB video but it have more lagging problem.
I just had this lagging video playback problem in Visual Studio 2015 as well, but only in debug mode. When compiled for release, the playback is normal.