• Advertisement
Sign in to follow this  

DirectX (in C# with SlimDX) and ffmepg

This topic is 2137 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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?

Share this post


Link to post
Share on other sites
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 [url="https://github.com/xDarkice/Vocaluxe/blob/master/Vocaluxe/Lib/Draw/CDirect3D.cs"]Github[/url].

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement