Hello,
I have a C++ DLL which uses ffmepg to read a video. When it gets a picture, I transmit AVFrame (and put it to RGB24 format with sws_scale) to C# code thanks to a callback.
I try to display this picture with DirectX (Texture texture = Texture.FromMemory(..) ). When I convert the AVFrame to bmp, it's working but the image loses alpha canal. I would like use directly AVFrame->data[0] but DirectX do not know how manage it !
Is someone knowning how to display an AVFrame in DirectX ?
I would like to display keyframe and the others frame.
DirectX (in C# with SlimDX) and ffmepg
It's hard to tell you what you're doing wrong without seeing any code. What's the code you're using for converting it to a bmp, and what code are you using to try and create a texture? Are you getting error codes back or just funny looking textures?
Converting to PNG would do the job, but you will end up having performance issues. Instead of using Texture.FromMemory() which requires the texture already being in a right format, you should try to lock the texture and fill it with the raw data. You could take a look at my Direct3D rendering implementation which is at Github.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement