ofxWMFVideoPlayer large texture issue


I seem to be getting an issue when trying to playback a video of size 5760x1080 (1920x1080 videos work fine) using ofxWMFVideoPlayer. I get the following error:

ofTexture: allocate(): ofTextureData has a 0 width and/or height: 0x0
ofxWMFVideoPlayer: An error occurred.

It seems to happen inside the SetMediaInfo() method at this line:

if(MFMediaType_Video == guidMajorType) - the result is false for some reason

The video plays back fine in windows media player so I guess I have the codecs installed.

Has anyone else come across this issue?

What type of video is it ? (ie which codec) Media player can play video using either media foundation or direct show depending on what will work the best, so a potential reason would be media player reads the file using direct show. There’s also limitation on how big an MP4 can be (if that’s what you’re using), the limit being 4K (4096 × 2304 on windows 8, less than that on windows 7)
You can try to use WMV rather than MP4 as they are nicer on aspect ratio and such.

Last ressort would be split the video in two and run two players side by side, but video could get out of sync (there’s other way to be a little better than that, but you will never have a 100% perfect result, the best I ever got was mostly fine always but some times I’d notice a frame or two off for 0.5-1s)

Thanks for the reply.

The video was mp4. I’ve now tried wmv and still get an error but it is different. With wmv, the error is called from the OnPlayerEvent method (I get back a failed result of 0xc00d36b4).

Worth mentioning that I am on Windows 7.

I’ve just tried playing back with ofDirectShowVideoPlayer and this seems to work when I have k-lite codec pack installed.

Does that give any hints into what the issue could be? Is ofxWMFVideoPlayer not making use of the codecs installed?

I’d like to use WMF as I need to change the playback speed smoothly and DirectShow does not do this.


I haven’t tried setting the playback speed with this, but I had great results with https://github.com/bangnoise/ofxHapPlayer when I needed to set the frame of a video accurately, i.e I have a movie of an object rotating and I needed to be able to spin it around with the mouse. None of the Quicktime codecs I tried worked well and it would just lock up from time to time.

speed control works very well with HAP codecs.
For that resolution an SSD for reading the file is recommended (the video’s tend to get quite huge).

My gut feeling is that the codec that Media Foundation uses aren’t able to decode a frame that big. By installing k-lite codec pack, you get codec for direct show that are not relying on the same things and that can handle a bigger video. You could try with different hardware and/or with windows 8 but that’s probably the best it will get :confused: (DirectX accelerated texture are hardware dependent beyond a HD size, and windows 8 has a better video pipeline, so that wouldn’t be a shot in the dark to try those options)
If the video works with VLC you could also try ofxVLC as well (it may have a better playback speed adjustment than directShow)

Edit: I’m curious, what tool did you use to make a WMV that big ? Last time I try after effect and the likes were limited to a 2K video size. Does the WMV plays in windows player with no extra codec installed ?

Thanks for the advice. Better hardware/windows 8 will be a plan B I think but won’t rule it out.

Am testing the Hap codec at the moment (the file is gigantic though) and image sequence (I don’t need audio). Will look into ofxVLC.

I used ffmpeg to create the WMV. I’ve deleted it now and cannot actually remember whether it worked in any player I tried so might be a red herring. AFAIK WMV will play straight out of the box on windows without extra codecs, but the size may be limited.

Quick update.

The hap codec works really well. I am able to play 3 full HD videos side by side, and adjust the playback speed nicely. They seem to playback in sync without me doing anything in code.

I almost got there with an image sequence too, it was just a little too slow to load the images and play them back in real time (I couldn’t load all into RAM as there are around 20,000).

I also went back to ofxWMVVideoPlayer and it can handle playing back 3 full HD videos but I also noticed there was no interface for changing the speed of playback (no idea how easy this would be to add though).

For adjusting speed of the video playback check out my fork of ofxWMFVideoPlayer https://github.com/DomAmato/ofxWMFVideoPlayer
It was not actually all that hard as MSDN had a tutorial on it =)