Jump to content

  • Log In with Google      Sign In   
  • Create Account


DirectX (in C# with SlimDX) and ffmepg


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 arthur__   Members   -  Reputation: 102

Like
0Likes
Like

Posted 12 March 2012 - 08:43 AM

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.

Sponsor:

#2 Cornstalks   Crossbones+   -  Reputation: 6966

Like
0Likes
Like

Posted 13 March 2012 - 12:27 PM

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?
[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

#3 xDarkice   Members   -  Reputation: 112

Like
0Likes
Like

Posted 13 March 2012 - 03:37 PM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS