I'm using ffms2 (aka FFmpegSource) for decoding video frames and display on UI based on wxWidgets. My player works fine for low resolution video (320*240, 640*480) but for higher resolution (1080) it is very slow. I'm not able to meed the desired frame for high resolution video. After time analysis I found that FFMS_GetFrame() frame function takes much longer time for high resolution frame. Here are the results. 1. 320*240 FFMS_GetFrame takes 4-6ms 2. 640*480 FFMS_GetFrame takes >20ms 3. 1080*720 FFMS_GetFrame takes >40
Which means that I'll never meets 30 fps requirement for 1080p frame with FFMS2. But I'm not sure if this is the case. Please suggest what could be going wrong.
asked Jun 21 '13 at 13:17
Slower video decoding with larger frames is totally normal. 1080x720 has about ten times as many pixels as 320x240, so having GetFrame take about ten times as long is not surprising (it's not a strictly linear relationship as there's a lot of other factors that play into decoding speed, but pixel count and time to decode are fairly correlated).
Setting the output format for every frame is unnecessary and is going to be making things a lot slower. Unless you specifically want the output format to change you should call it just once after opening the video, and it'll apply to all frames requested after that.
answered Jun 21 '13 at 20:21