Hi i am creating a project in windows phone 7 that will capture videos and transport it to some other device. Here is my code so far.
// Initialize the camera if it exists on the device.
if (videoCaptureDevice != null)
{
captureSource = new CaptureSource();
fileSink = new FileSink();
// Create the VideoBrush for the viewfinder.
videoRecorderBrush = new VideoBrush();
CompositeTransform transform = new CompositeTransform();
transform.CenterX = 0.5;
transform.CenterY = 0.5;
transform.Rotation = 90;
videoRecorderBrush.RelativeTransform = transform;
videoRecorderBrush.SetSource(captureSource);
// Display the viewfinder image on the rectangle.
viewfinderRectangle.Fill = videoRecorderBrush;
// Start video capture and display it on the viewfinder.
captureSource.Start();
// Set the button state and the message.
}
What i want is to save the the video that was captured to some kind of buffer,so that i can send it and the other device can see that video (Video Call). Any ideas?
bsically you can go for this sample fro msdn
the voip sample
for a normal description of how to make application here's a link in silverlight
you can mapp at least some code and understanding from here ..
video call silverlight
Related
I have an c# desktop Application that want to display the videos with sounds that was streaming via axwindowsmediaplayer and after then the timer start and display message if necessary on tv, what I did I made "axwindowsmediaplayer and labels that calculate the timer and message on (panel2) and all works fine " but I want to display panel 2 on tv screen with audio if another technology please advise me .enter image description here
Screen pscr = Screen.FromControl(panel2);
Screen scr = Screen.AllScreens.FirstOrDefault(s => !s.Primary) ??pscr ;
panel2.Left = scr.Bounds.Width;
panel2.Top = scr.Bounds.Height;
panel2.Location = scr.Bounds.Location;
Point p = new Point(scr.Bounds.Location.X, scr.Bounds.Location.Y);
panel2.Location = p;
panel2.Show();
I'm coding a screen capture program in C# using windows media encoder. While the screen is being recorded i want to save the last 30sec of the current video being recorded in a separate video when a btn gets clicked. Is there a function in encoder that would allow me to do that?
I've attached the code that I'm currently using. Couldn't find any documentation on media encoder...
void startRecording() {
System.Drawing.Size workingArea = SystemInformation.WorkingArea.Size;
Rectangle captureRec = new Rectangle(0, 0, workingArea.Width -(workingArea.Width % 4), workingArea.Height - (workingArea.Height % 4));
job.CaptureRectangle = captureRec;
job.ShowFlashingBoundary = true;
job.ShowCountdown = true;
job.CaptureMouseCursor = true;
job.AddAudioDeviceSource(AudioDevices());
job.OutputPath = #"C:\Users\Moe36\Desktop\Screen Recorder";
job.Start();
}
void saveLast30Sec() {
//Save last 30sec of the currently recorded video as a separate video file.
}
I am developing a magnifying app on windows phone 8.1 WinRT for visual impaired users and in the magnification page (camera based),i want to apply color effects and contrast for more accessibility (black in white , yellow in blue , yellow in black , black in white ,... )
http://www.1800pocketpc.com/wp-content/uploads/2014/10/Microsoft-Pocket-Magnifier-700x437.jpg
Do anyone know how to deal with that ?
I believe the easiest way for you to do it is using the Lumia Imaging SDK (https://msdn.microsoft.com/en-us/library/dn859593.aspx) which works for WinRT platform. There is for example ContrastFilter class which would probably suit you very well. Here's how to use it:
using (var filterEffect = new FilterEffect(source))
{
// Initialize the filter and add the filter to the FilterEffect collection
var filter = new ContrastFilter(0.5);
filterEffect.Filters = new IFilter[] { filter };
// Create a target where the filtered image will be rendered to
var target = new WriteableBitmap(width, height);
// Create a new renderer which outputs WriteableBitmaps
using (var renderer = new WriteableBitmapRenderer(filterEffect, target))
{
// Render the image with the filter(s)
await renderer.RenderAsync();
// Set the output image to Image control as a source
ImageControl.Source = target;
}
await SaveEffectAsync(filterEffect, "ContrastFilter.jpg", outputImageSize);
}
And before anyone says that it's a copy/paste from the sdk docs - it's ok as I've written that sample to the original docs :)
I am playing audio with media element by converting text to speech in my app.
here is my code
var synth = new SpeechSynthesizer();
var voice=SpeechSynthesizer.AllVoices;
synth.Voice = voice[2];
var text = "My name is John";
var stream = await synth.SynthesizeTextToStreamAsync(text);
var me = new MediaElement();
me.SetSource(stream, stream.ContentType);
me.Play();
Audio here being played is fast .I want that audio should play slowly. I tried Playback property of media element but its does not work.How to control speed of play back in media element?
Use DefaultPlaybackRate property:
var me = new MediaElement();
me.DefaultPlaybackRate = 0.5;
me.SetSource(stream, stream.ContentType);
me.Play();
You can also use PlaybackRate property if you don't want it to persist throughout the lifetime of the MediaElement. This happens because PlaybackRate will have DefaultPlaybackRate value when Play method is called till playback ends.
Reference
I am having a windows forms app.
I want to use a mediaelement in it, so I use the elementhost. I create a wpf usercontrol in which I put a mediaelement. In my app I write the following having the goal in mind to rotate the element.
System.Windows.Controls.MediaElement wm = new
System.Windows.Controls.MediaElement();
wm.LayoutTransform.Value.Rotate(22.0);
elementHost1.Child = wm;
wm.Source = new Uri(dateiname);
wm.Play();
dateiname is the filename.
It plays but it is not rotated. How to rotate wm's video?
Maybe a little later. Try this:
RotateTransform rt = new RotateTransform {Angle = 20.0};
wm.LayoutTransform = rt;