I am developing C# desktop application and referring this link to Play video file http://www.codeproject.com/Articles/2632/DirectShow-MediaPlayer-in-C , now from this playing video file ,when I click on this panel (shown in above link ) how to capture Images from playing video file,I searched but I found all examples showing capturing Images from some device(for eg.webcam,etc..) ,In my case Its not device it's file which I am browsing from Directory and Playing ,as I am new to this Video capturing Please direct me how I can do this
"Capture" normally refers to image acquisition when you obtain the image from external source. You want to take a copy of currently displayed video frame instead. There are several ways to do it and when it comes to playback when video is being visualized, the video renderers typically offer GetCurrentImage method which returns a copy of currently displayed video frame, possibly even converted to RGB.
Method syntax slightly differs between video renderer versions.
See previous topics on achieving this:
take picture from webcam c# (references sample application from DirectShow.NET)
IBasicVideo CetCurrentImage catastrophic failure(DirectShow.NET)
Also:
Best DirectShow way to capture image from web cam preview ? SampleGrabber is deprecated
Grabbing images from a DVD using direct show
You need a filter which captures screen and sends the video down the stream.
In the DirectShow Library there is a sample filter called PushSource and inside there is PushSourceDesktop.
At Codeplex there are Examples like this (Click me) or Information (Click me) about Filters.
You can also use a "SampleGrabber" DirectShow filter: just place it in the filter chain between your source filter and render filter.
More info about SampleGrabber:
see MSDN
Related
I'm using DirectShow .NET to capture WebM Videos.
The Graph looks like this:
My question is, how can i use the "preview" pin from VP8 encoder to stream a preview video?
Is there any (free) DirectShow filter available for this job?
Or is the preview pin the wrong way?
Edit:
The "Enhanced Video Renderer" is the renderer to show the video in a window. It works properly but is just an example. I have a Webservice (WCF) and want to stream the live capture through the network simultaneously to the filewriter. (Filewriter in the graph "test.webm") I think i doesn't need a custom solution here. There are filters for showing the video in a Window. i simply need a filter with a streaming output. The rendering process is part of the browser side. How can i achieve this?
In other words: Im searching a stream writer filter or something else.
It's my first time trying to publish my app on Google Play. I am using Xamarin 4.2 and C#.
My questions:
Can I use Microsoft Paint to create launcher icons?
My plan is to create 36x36px (ldpi), 48x48 (mdpi), 72x72 (hdpi) and 96x96 (xhdpi) launcher icons: Is this Ok so far?
The documentation says .PNG; I guess ldpi and mdpi are just naming conventions?
However my search found different numbers of icons and different sizes.
My plan is to place each of these icons under a separate folder as follows:
Resources\drawable\drawable_ldpi\ic_launcher
Resources\drawable\drawable_mdpi\ic_launcher
etc. Is this arrangement correct?
What about the high resolution application icon: Is it placed in the resources folder? or uploaded separately into Google play console?
First take a look at googles iconography guide: http://developer.android.com/design/style/iconography.html
As you can see each density has a name, you should create a drawable_(density) folder inside the resources directory for each one you plan to support and use the correct icon size.
As an example you should have Resources/drawable_mdpi (density ñame is always in lower case)
And for the hi res icon i supose you refer to the image for google play, it is uploaded when you fill your apps description.
About using Paint to create those icons, well, using paint for anything more complex than drawing a line is a bad idea...
If you don't have any program like Photoshop you always can use Gimp, its free and very powerful:http://www.gimp.org
I want to build application which needs to be able to capture video from a web camera using C#. The captured video should be compressed using some codec (nothing special, anything available that saves space) and written to a file while capturing. A live preview of capture is not necessary.
The first question is: Which API is suitable for this and what would you recommend (I have seen DirectShow, Windows Media Foundation wrapper, etc. I am not sure which is would be best for managed environment and C#)?
I also need a video player in WPF which will play captured video. This player must be able to play captured video from an arbitrary position, pause and start/stop video.
Putting it all together, video is captured from a webcam in the background and at the same time the player plays that video being captured, but it can be paused, re-winded, stopped - something like a modern DVR.
The second question: Is it possible to create such a player using WPF MediaElement? (Confusion is about the file which is at the same time filled from the capture and played in the player)
A nice example of how to make all what you want: WebCam
I have used the AForge set of libraries to accept the videos frame by frame. I used the private void videoSourcePlayer1_NewFrame(object sender, ref Bitmap image) function to do this.
I've used VlcDotNet. It is very flexible and simple to use. It has a pretty active user base as well.
I've used it for displaying live video streams as well as recording to files.
You can try the DirectShow.net library.
I can recommend WPF's ffmediaelement. It's built on FFmpeg. So what can FFmpeg, can also ffmediaelement. It can capture video from both the webcam and the capture card. Unlike DirectShow, it's very simple.
Here's how to set up a video source:
Media.Source = new Uri("device://dshow/?video=Osprey-460e Video Device 1C");
... and parameters for it in MediaOpening event:
Media.OnMediaOpening(s, e) =>
{
e.Options.Input["framerate"] = "25";
e.Options.Input["video_size"] = "768x576";
e.Options.Input["pixel_format"] = "yuyv422";
};
I am currently developing a Windows Phone 7 application. What I want to do, is to render a video file (avi, wmv, whatever...) from a sequence of images. So, I just need something like a frame writer for video files (e.g. create an in-game video: write every X frame to video stream).
I searched the whole internet and also stackoverflow but I didn't find anything. As far as I know, there are a lot of APIs and interfaces in the Windows Phone 7 stack to handle audio and video, so I think there must be a solution for this somehow.
BTW: I alread had a look at C# Slicer and ffmpeg. Slicer isn't available for Windows Phone 7 and I wasn't able to port it and ffmpeg isn't allowed by Microsoft, because this solution would need to integrate an unmanaged library which isn't allowed.
I hope you can help me.
Would you consider doing this operation on a server? You could upload the images to your host, invoke ffmpeg to create the movie, then push the movie back to the phone. It might even be faster than having the phone do the encoding (assuming you don't have thousands of users hitting the host at the same time, of course!)
I am using ASP.NET's "handler" to show images in an application. I need to play files of audio and video like I do with the image: I recover it from database and show it on an aspx page. Can I create a "handler" for the video and the audio? I don't want that a dialog box is opened asking to the user if he wants to play or save the video file.
I want to play it like YouTube does.
Maybe I can use silverlight for that.
Thank you!
It consists of two parts.
A handler or something that streams the video under the hood.
A client (can be implemented in Silverlight or Flash) that's on an standard HTML page that fetches the video from the handler and displays it.
It's certainly possible to write a handler that pulls video/audio content out of a database and streams it to the client. That would work much the same was as your existing image one.
The way to stop the dialog is to present your video within a video viewing control on the web page. For example, a silverlight control with a MediaElement in it.
Check out this guide to writing a silverlight media player: http://www.learn-silverlight-tutorial.com/StreamingMediaUsingSilverlight.cfm
This won't necessarily be the most performant way of serving video content, if you want lots of performance, look into buying commercial media streaming solution that can be integrated with your site.