is there a reliable way to get a thumb image for a file not currently being viewed?
this is the approach i use at the moment but it only works some of the time (most of time i just get black images). It needs to be able to get the thumb image without any video images playing on the screen.
I found the same thing (black images) and this is what I've done to get around that:
- For xVideo_ChannelSetPosition, specify the position in Reference Time (xVideo_POS_REFTIME).
- After xVideo_ChannelPlay, insert a loop checking xVideo_ChannelGetPosition (with xVideo_POS_REFTIME) until the position is greater than your start position.
- Now call xVideo_ChannelGetBitmap.
- Call xVideo_StreamFree.
In the loop I include a delay of 50ms, and I also have an overall timeout of 1500ms in case something goes wrong!
I haven't used xVideo_STREAM_DECODE - mainly because I haven't got around to working out how to use it. So my code is a little more complicated in that I play the video to a hidden control which I first of all resize to the dimensions of the video. This involves using 0 as the window handle in xVideo_StreamCreateFile, getting the dimensions via xVideo_ChannelGetInfo, resizing the hidden control, then calling xVideo_ChannelSetWindow before xVideo_ChannelSetPosition. I also mute the audio before calling xVideo_ChannelPlay. Seems complicated, but it works!