Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello all,

Whilst working on a project, a strange little idea popped into my mind.
I want to play a media file (any format but without a gui), allow the user to pause/resume the video and add the option to extract that frame as a bitmap (instead of making a screenshot).

I've found the DirectShow MediaPlayer in C#[^] but the Video[^] class doesn't contain a 'current frame' property.
If I knew the current frame, CP would probably have an article on extracting it.

I'm also open for other method's of playing the video as long as I can hide the gui.
Posted
Updated 20-Apr-11 23:42pm
v2
Comments
willempipi 21-Apr-11 6:20am    
Sorry, no solution by me, but I'm looking for the same thing for a long time now. Really interested in a solution for this one...

That documentation is horribly short on examples, but two ideas come to mind.
- The class renders to a control, specified by its Owner property. Can you use Control.DrawToBitmap, or something similar, to access the previous frame rendered to that control?
- If you set RenderToTexture, and handle TextureReadyToRender, you may get a texture each frame. I am not familiar with this class so I don't know if that's the case, but it's hard to see how else it would work. I can't currently see how to get the bitmap data out of a texture but that must be possible ...
 
Share this answer
 
Hi,

maybe it's working for you with MediaDetector Method from
http://wpfmediakit.codeplex.com/[^]
solves your problem.


Here's a quick solution how to make Video-Thumbnails with this great Library.
Creating Video Thumbnails[^]


Best Regards
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900