we are in need of a way to record videos with sound and taking pictures inside a WPF-application. It should be able to save locally to disk. Preferably it should be able to show the content once it is saved as well, but if no such component exists, we will use another component for the playback.
I've looked around and found no real good options to do this. Some options lack the sound recording in videos, and some are just too old to get working properly (WPF has had a long run so far...)
Does anyone here has any experience in this specific area?
Got Taking Pictures and Videos working with this little documentation https://www.codeproject.com/Articles/330177/Yet-another-Web-Camera-control
If you dont tell us what problems exactly you got, or which code you already got, we can't really help.
Related
My goal here is to be able to play an MP3 in an OpenTK/OpenGL application (.NET but NOT windows forms), being able to stop/play/pause it, access/set the position of the audio file, and have it play to within a few milliseconds of when I tell it to.
I've tried using WindowsMediaPlayer (WMPLib) but for whatever reason the audio doesn't start playing until I resize or move the window. Not sure why but it probably has something to do with the fact that it's meant to be a control on Windows Forms, and this is a GL application.
I've tried using .NET's soundplayer but that incurs a huge delay of up to a second, and I can't set/access the position of the file.
I've looked into OpenTK and OpenAL but that seems way too complex to figure out.
Does anyone have any ideas?
THANKS!
Oh and worst case scenario I could also deal with playing WAV or OGG files instead, and if the play timing is accurate enough I wouldn't need access to the position of the audio.
OpenAL may seem complicated, but it sounds like the best solution to your problem. There's plenty out there on it, though most examples might be in other languages, but the API is the same. Perhaps this thread has some solutions as well.
Lately, I've been trying to setup a media center PC. I've played around with all the common media center applications like XBMC, Plex, Boxee, and WMC. But all of them have one issue or another. So I was thinking about writing my own application from scratch.
My problem is I have no experience with developing software that plays media such as videos or music. I'm also not interested in spending a huge amount of time trying to figure this out, considering all the different file formats and codecs out there. I'm really more interested in developing the database and library interface for my application and reusing someone else's control or code for actually playing the media.
One option I was thinking was to just control an existing media player externally. So for example you may browse for a video to play in my application, and then when you hit play it would fire up VideoLAN or some other popular video player.
However, I was wondering if there was an easy way to play video inside a .NET application. I'm looking for something that is capable of playing a wide variety of formats such as MKV files, and DVD ISOs. I'm more experience with WinForms, but was also thinking about using this project as an opportunity to learn WPF.
i've spent many years looking at playing video under wpf.
The short answer
There is no easy way to guarantee to be able to play a variety of formats under wpf ( mkv,dvd etc etc ) or under windows for that matter.
the long answer
If you are looking just to run this at home and not release it, install all the codecs you need and most of the formats will run via mediaelement in wpf.
Getting all the codecs to cooperate can sometimes be frustrating.
Now moving into slightly harder territory.
if you want to play DVD then you need to replace mediaelement with wpfmediakit
http://wpfmediakit.codeplex.com/
wpfmediakit gives a base library to get access to the low level directshow functionality.
There is already a code base for playing DVDs based on wpfmediakit.
Now moving onto the very hard territory.
if you want to distribute your application and have users be able to "just watch" most/all media formats means you need to be able to completely control their codecs, which generally means distributing the codecs with your package and building the directshow filter graph in code rather than let windows build it.
The easiest way is to use the existing .Net hooks to Microsoft's standard MediaPlayer:
http://msdn.microsoft.com/en-us/library/system.windows.media.mediaplayer.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/dd562851%28v=vs.85%29.aspx
was trying myself a while ago for something to play media in winforms, and found out there is vlc wrappers for .Net, dunno how good they are as i gave up, but you can try
here is one them:
http://vlcdotnet.codeplex.com/
Thanks for all the great answers. But just found out that VLC can actually be controlled through HTTP. So I think I'm just going to use that to point an instance of VLC running with the HTTP interface at whatever file I want to play.
I've spent days googling and coding tryin to acheive the basic level of effect all media players have when showing fancy subtitles - that being text (optionally with outline/dropshadow/glow) written above a video (video being a videofile but would nice to also have option of being a videofeed eg webcam).
So far the only way I've managed to get anything over a video is either to write to a transparent picturebox above a video component which is aliased so has dodgy outline, or using the directshow.net library and the capture method from the dxtext example I have managed to actually write over a picturebox that is being spat frames of the video. The problem here is that as soona s I add the writing commands in (video plays to picturebox fine without it) then I get slight fps hit coming accross as marginal stuttering on the video.
Does noone have a way to just write/draw over a video without taking this kind of performance hit? Or am I going to have to resort to directx or something or just give up on this luxury? :/ I can paste any code needed for help but I think anyone with assistance will probably be the one wanting to post code!
TIA for any input, it's doing my head in D:
I am new to DirectShow.
My intention was to develope a small application (C#) that handles video processing.
The main tasks i need are :
1 - Display video content from a DVD.
2 - Navigate to specific points of time in the video.
3 - Capture specific frames into still images and save them to files.
Sounded easy at first, but after reading thousands of blogs, forums and code samples i can't figure out how this can be done .
I am pretty sure these tasks have been implemented plenty of times, so if anyone has anything that can help i would be very happy to hear it.
As i am getting desperate on this issue, buying external DLLs or paying for some advice is an option.
Thanks.
Not sure if this will help, but I have a DvdPlayerElement control in my WPF MediaKit.
You must install an audio codec if you want audio as the built in one with Windows is locked down due to licensing.
perhaps you can wrap the MSVidWebDVD object, combined with some screen capture techniques [?] see also Extract frame from VOB(DVD) file
Thanks Jeremiah, I do know WPF MediaKit and tried working with it.
It is pretty cool, but does not allow all of the functionality available in DirectShow.
There are some events missing and the seeking operation does not seem to work for me.
I guess i can dig in the code and figure it out, but the time pressure won't allow it.
If you have an example of an application that accomplishes what i am looking for (display, seek, capture) i would be very happy to take a look.
Thanks again.
My webcam has a button, with which you take a photo of current frame
when using it's original software what came with it when I bought it.
Is there any way to use that button to take photos in my program.
I would be using C#.
I was thinking of using Windows Image Acquisition (WIA) or avicap32
for using webcam in my software.
Any help would be appreciated. Where do I start?
EDIT:
I see that you didn't understand me. I need to know if my phisycal camera button is pressed.
I am using DigiMicro 1.3 camera (Manufacturer is DNT), which isn't really a webcam but a USB microscope, but
it behaves like a webcam.
Does the camera actually require that the software be running when you press the button? I know some webcams implement this feature at the driver level. If that's the case, I don't think there's much you can do without interacting directly with the USB port, which would be incredibly difficult and likely not worth the trouble. I can't find any technical documentation on the vendor's website with that kind of information.
The "MicroCapture" software doesn't come with any DLLs that have exported functions, so P/Invoking doesn't appear to be an option. Unfortunately, I can't get the driver installed, so I can't check if it comes with any P/Invoke-able DLLs.
Sorry, but since there's no standard interface for that kind of functionality and the vendor doesn't provide any specific information on it, I don't think this is possible. I would suggest contacting DNT directly about it. They may have some component that will do what you need.
This Coding4Fun post guides you through pretty much everything you need to do to get started using WIA, including adding the reference to a project, displaying the select a device dialog, and of course actually taking the picture :P.
Coding4Fun - Look at me! Windows Image Acquisition
I suggest that you take a look at the DirectShow.NET library. It has great functionality for capturing images/videos off connected devices. It also comes with several samples to get you started quickly.