locked
Streaming video from camera RRS feed

  • General discussion

  • Hello. I using MediaCapture for get video from camera. I want to output video in MediaElement from stream.

    IRandomAccessStream _videoStream = new InMemoryRandomAccessStream();
    
                mediaCapture = new MediaCapture();
    
                mediaCapture.InitializeAsync(new MediaCaptureInitializationSettings
                {
                    PhotoCaptureSource = PhotoCaptureSource.VideoPreview,
                    StreamingCaptureMode = StreamingCaptureMode.Video
                });
    
                await mediaCapture.StartRecordToStreamAsync(MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Vga), _videoStream);
                previewVideo.SetSource(_videoStream, "video/mp4");
                previewVideo.Position = new TimeSpan(0, 0, 0);
                previewVideo.Play();

    <UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d">
        
        <Grid>
            <MediaElement x:Name="previewVideo" RealTimePlayback="True" />
        </Grid>
    </UserControl>
    

    How can I do this?

    I can't using StartPreviewAsync() method, because i want transfer video on bluetooth.

    Wednesday, June 18, 2014 12:32 PM