Silverlight Multimedia

3,257 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,257
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
33
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • AsyncCaptureImageProvides a WriteableBitmap image file to the provided Action<(Of <(T>)>) callback as a parameter. The image represents a single "frame grab" from an associated video capture device.VideoBrush.SetSourceSets the source of the VideoBrush using a video capture source To obtain a CaptureSource for video, you must derive from VideoSink. Using your derived VideoSink, you can initiate a capture and set it into the VideoSink..::.CaptureSource by calling CaptureSource..::.Start. You typically also need to specifically request client permission for capture device access. For more information on obtaining capture device access, see CaptureDeviceConfiguration.The scenario for SetSource is to provide a simple playback capability for captured video such that it can easily be displayed in client UI without having to process individual frames of video or video formats. Other more advanced scenarios for using a video CaptureSource exist whereby you can access the raw video; for information on these scenarios, see VideoSink.
  • AsyncCaptureImageProvides a WriteableBitmap image file to the provided Action<(Of <(T>)>) callback as a parameter. The image represents a single "frame grab" from an associated video capture device.VideoBrush.SetSourceSets the source of the VideoBrush using a video capture source To obtain a CaptureSource for video, you must derive from VideoSink. Using your derived VideoSink, you can initiate a capture and set it into the VideoSink..::.CaptureSource by calling CaptureSource..::.Start. You typically also need to specifically request client permission for capture device access. For more information on obtaining capture device access, see CaptureDeviceConfiguration.The scenario for SetSource is to provide a simple playback capability for captured video such that it can easily be displayed in client UI without having to process individual frames of video or video formats. Other more advanced scenarios for using a video CaptureSource exist whereby you can access the raw video; for information on these scenarios, see VideoSink.
  • Silverlight Multimedia

    1. 1. MultimediainSilverlight<br />Carl Franklin <br />Franklins.Net<br />carl@franklins.net<br />
    2. 2. Media Features in Silverlight 3.0 / 4.0<br />Encoding<br />MediaElement Overview<br />Third-Party Projects<br />Cool Demos!<br />Let us repair to the pub<br />Multimedia Overview<br />
    3. 3. Supported Resolutions:<br />All – up to 720/1080p<br />Codecs:<br />H.264 Native<br />MP4/F4V<br />WMV – SMPTE VC-1 Standard<br />Third-party codecs<br />GPU Acceleration<br />Olympics, Sunday Night Football, DNC, Presidential Inauguration.<br />True HD Video<br />
    4. 4. Adapts bitrate/quality as bandwidth/cpu changes<br />HTTP-based<br />Quick start-up time<br />Minimal buffering<br />Uninterrupted viewing<br />Requires IIS 7.0 Media Services<br />Live Smooth Streaming (in Silverlight 4)<br />PVR-style access<br />Navigation, scrubbing<br />IIS Media Services : http://www.iis.net/media<br />Smooth Streaming Demo – Watch it in action<br />http://shrinkster.com/1d0g<br />Smooth Streaming<br />
    5. 5. One-to-many video broadcasting<br />Silverlight 3.0<br />QUMU Plugin (http://www.qumu.com)<br />Free on Codeplex<br />Polycom Video Media Center 1000 uses it<br />Silverlight 4.0<br />Built-in. No plugin necessary.<br />Multicast Support<br />
    6. 6. Write once. Run on Windows, Mac, and Linux<br />Store and play offline video out-of-browser<br />DRM for stream and content protection<br />Silverlight DRM<br />Windows Media DRM<br />PlayReady<br />Advertising Support<br />Linear pre-rolls<br />Post-rolls<br />Interstitials<br />Non-linear tickers<br />Bugs<br />Transparent overlays<br />General Silverlight Features<br />
    7. 7. Expression Encoder<br />Convert Videos to Silverlight-compatible WMV<br />Create HTML/Javascript Template<br />Copy to web server<br />Rock and roll<br />Encoding Videos for Silverlight<br />
    8. 8. Expression Encoder Live Encoding Feature<br />Select Video Source<br />Select Push or Pull Modes<br />Publish<br />Rock and Roll<br />Small potatoes – doesn’t scale.<br />Live Encoding<br />
    9. 9. Real geeks use hardware<br />InLet Technologies Spinnaker<br />http://shrinkster.com/1d0r<br />Olympics : <br />20 of these @ 20K each<br />IIS Server Farm<br />Camera -> Inlet -> IIS7 -> CDN<br />CDN = Content Delivery Network<br />Akamai, Limewire<br />Big $$<br />Hardware Encoding<br />
    10. 10. MediaElement<br /><ul><li>Plays video or audio</li></ul>Streamed or downloaded media<br />Video: WMV, H.264<br />Audio: AAC, MP3 and WMA<br />Add Media File to your project<br />Set Build Action property (of media file) to Resource<br /><MediaElement Source="bear.wmv" /><br />
    11. 11. Scrubbing Media<br />Works on Downloaded or Buffering Media<br />Position method is writable<br />Position not valid until MediaOpened Fires<br />Downloaded media it simply changes the location<br />Buffering media it may cause re-buffering<br />NaturalDuration gives you the length of the media<br />Though may be invalid in some streams (e.g. Live)<br />Using MediaElement<br />thePlayer.Position = thePlayer.Position.Add(TimeSpan.FromSeconds(5));<br />
    12. 12. Markers<br />Media must contain markers to work<br />MarkerReached Event Fired when a marker is reached<br />Sends a TimeMarker object as the event argument<br />Using MediaElement<br />void thePlayer_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) {<br />TimelineMarker m = e.Marker;<br />theStatus.Text = string.Format("{0}:{1}:{2}", <br />m.Type, m.Text, m.Time);<br />}<br />
    13. 13. Silver Bay Labs Development Guide Videos<br />Table of Contents on Left<br />Video on Right<br />Important Code in Textbox below video<br />http://shrinkster.com/1d0j<br />Good Use of Markers<br />
    14. 14. Play Position<br />No event for Position Change<br />Use Binding to Position Property Instead<br />Using MediaElement<br /><TextBlock Text=“{Binding ElementName=MediaElement1, Path=Position}” /><br />
    15. 15. Video Capture<br />Media Security<br />What’s New in Silverlight 4.0?<br />
    16. 16. Webcam and Microphone Support<br />AsyncCaptureImage<br />Captures a single frame, sends bitmap to callback<br />VideoBrush.SetSource<br />Sets the source of the VideoBrush using a video capture source<br />Webcam Sample Apps online:<br />http://shrinkster.com/1d0o<br />Video Capture<br /> void AsyncCaptureImage(Action<WriteableBitmap> Callback)<br /> void SetSource(CaptureSource source)<br />
    17. 17. VideoSink<br />Base Class for creating video capture classes<br />Override OnSample, convert data to your format<br />CaptureSource property provides a capturesource associated with your VideoSink<br />CaptureSource<br />Use AsyncCaptureImage to capture a frame<br />VideoCaptureDevice<br />Provides metadata for a video capture device, such as a webcam.<br />Webcam Sample Apps online:<br />http://shrinkster.com/1d0o<br />Video Capture Classes<br />
    18. 18. Video Capture Sample<br />if (CaptureDeviceConfiguration.AllowedDeviceAccess<br /> || CaptureDeviceConfiguration.RequestDeviceAccess())<br />{<br />VideoCaptureDevicevcd = <br />CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice();<br />AudioCaptureDeviceacd = <br />CaptureDeviceConfiguration.GetDefaultAudioCaptureDevice();<br /> if (null != vcd && null != acd)<br /> {<br />cs = new CaptureSource();<br />cs.VideoCaptureDevice = vcd;<br />cs.AudioCaptureDevice = acd;<br />cs.Start();<br /> <br />VideoBrushvideoBrush = new VideoBrush();<br />videoBrush.Stretch = Stretch.Uniform;<br />videoBrush.SetSource(cs);<br />TO_FILL.Fill = videoBrush;<br /> }<br /> else<br />MessageBox.Show("Error initializing Webcam or Microphone.");<br />}<br />
    19. 19. Protection for Content Owners<br />Protected content is only viewed through a secure connection<br />Supported Scenarios:<br />Rental, Subscription, Purchase<br />Read Output Protection policies inside PlayReady Licenses<br />Offline Content Protection for H.264 media through Silverlight DRM<br />Two methods<br />Windows Media DRM (WMDRM10)<br />PlayReady (AES)<br />Content Security<br />
    20. 20. Silverlight Media Player<br />Silverlight Media Framework<br />Silverlight Hyper-Video<br />Augmented Reality<br />Third Party Goodies and the Future<br />
    21. 21. Lightweight, enough features for most video streams<br />Used by Channel 9 <br />Developed by Tim Heuer of Microsoft and MVP Joel Nuebeck<br /><ul><li>http://shrinkster.com/1d0p</li></ul>Silverlight Media Player<br />
    22. 22. Came out of Vertigo Software’s work with Olympics and Sunday Night Football<br />Does all the heavy lifting<br />Rich multimedia control<br />DVR, Rewind, Alternate Language Tracks, In-stream Data Feeds, Analytics Tracking, Player Branding, Markers.<br />http://smf.codeplex.com/<br />Silverlight Media Framework<br />
    23. 23. 11-18-09<br />SMF Released at PDC<br />1-15-10<br />SMF v1.1 released<br />Progressive Download Added<br />SMF v2.0 under development<br />SMF Timeline<br />
    24. 24. Timeline Markers<br />Progressive Download Support<br />Smooth Streaming Support<br />IIS In-Stream Data Access Framework<br />Out-of-Stream Data Access Framework<br />SMF Player 1.1 Features<br />
    25. 25. Playlists<br />Chapters<br />Manifest Marker Support<br />Javascript API<br />Closed Captioning<br />W3C Timed Text 1.0 DFXP Support<br />UI Automation<br />Media Plug-In Model<br />Logging Plug-IO<br />SMF 2.0 Additional Features<br />
    26. 26. Hypertext-like features for Video<br />Jesse Liberty <br />http://shrinkster.com/1d0q<br />Click or gesture while watching a video<br />Video pauses and you get some other information<br />Usually another video<br />Could be any kind of media<br />Uses the MEF framework<br />http://slhvp.com<br />Video Demo: http://shrinkster.com/1d0s<br />Silverlight Hyper Video Project<br />
    27. 27. Augmented Reality<br />Adding to (or augmenting) video with superimposed or embedded graphics.<br />SLAR Toolkit<br />http://slartoolkit.codeplex.com/<br />Silverlight 4.0 Only<br />Webcam support via CaptureSource<br />Multiple Marker Detection, Custom markers<br />Uses the Matrix3DEx library by Rene Schulte<br />Adds 3D features to Silverlight<br />http://matrix3dex.codeplex.com/<br />SLARToolkit – Silverlight AugmentedReality Toolkit<br />
    28. 28. Sharepoint Video Player<br />Embed video streams into your Sharepoint website.<br />http://svp.codeplex.com/<br />xLite Player<br />http://xliteplayer.codeplex.com/<br />Other Players<br />
    29. 29. Scott Guthrie’s Silverlight 4 Demos from PDC<br />http://shrinkster.com/1d0f<br />Silverlight 4 Demos<br />http://shrinkster.com/1d0o<br />Sunday Night Football<br />http://www.vertigo.com/snf<br />March Madness<br />http://mmod.ncaa.com/video?player=hq<br />Demos!<br />

    ×