silverlight multimedia

Download Silverlight Multimedia

Post on 17-May-2015

2.980 views

Category:

Technology

0 download

Embed Size (px)

TRANSCRIPT

  • 1. MultimediainSilverlight
    Carl Franklin
    Franklins.Net
    carl@franklins.net

2. Media Features in Silverlight 3.0 / 4.0
Encoding
MediaElement Overview
Third-Party Projects
Cool Demos!
Let us repair to the pub
Multimedia Overview
3. Supported Resolutions:
All up to 720/1080p
Codecs:
H.264 Native
MP4/F4V
WMV SMPTE VC-1 Standard
Third-party codecs
GPU Acceleration
Olympics, Sunday Night Football, DNC, Presidential Inauguration.
True HD Video
4. Adapts bitrate/quality as bandwidth/cpu changes
HTTP-based
Quick start-up time
Minimal buffering
Uninterrupted viewing
Requires IIS 7.0 Media Services
Live Smooth Streaming (in Silverlight 4)
PVR-style access
Navigation, scrubbing
IIS Media Services : http://www.iis.net/media
Smooth Streaming Demo Watch it in action
http://shrinkster.com/1d0g
Smooth Streaming
5. One-to-many video broadcasting
Silverlight 3.0
QUMU Plugin (http://www.qumu.com)
Free on Codeplex
Polycom Video Media Center 1000 uses it
Silverlight 4.0
Built-in. No plugin necessary.
Multicast Support
6. Write once. Run on Windows, Mac, and Linux
Store and play offline video out-of-browser
DRM for stream and content protection
Silverlight DRM
Windows Media DRM
PlayReady
Advertising Support
Linear pre-rolls
Post-rolls
Interstitials
Non-linear tickers
Bugs
Transparent overlays
General Silverlight Features
7. Expression Encoder
Convert Videos to Silverlight-compatible WMV
Create HTML/Javascript Template
Copy to web server
Rock and roll
Encoding Videos for Silverlight
8. Expression Encoder Live Encoding Feature
Select Video Source
Select Push or Pull Modes
Publish
Rock and Roll
Small potatoes doesnt scale.
Live Encoding
9. Real geeks use hardware
InLet Technologies Spinnaker
http://shrinkster.com/1d0r
Olympics :
20 of these @ 20K each
IIS Server Farm
Camera -> Inlet -> IIS7 -> CDN
CDN = Content Delivery Network
Akamai, Limewire
Big $$
Hardware Encoding
10. MediaElement

  • Plays video or audio

Streamed or downloaded media
Video: WMV, H.264
Audio: AAC, MP3 and WMA
Add Media File to your project
Set Build Action property (of media file) to Resource

11. Scrubbing Media
Works on Downloaded or Buffering Media
Position method is writable
Position not valid until MediaOpened Fires
Downloaded media it simply changes the location
Buffering media it may cause re-buffering
NaturalDuration gives you the length of the media
Though may be invalid in some streams (e.g. Live)
Using MediaElement
thePlayer.Position = thePlayer.Position.Add(TimeSpan.FromSeconds(5));
12. Markers
Media must contain markers to work
MarkerReached Event Fired when a marker is reached
Sends a TimeMarker object as the event argument
Using MediaElement
void thePlayer_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) {
TimelineMarker m = e.Marker;
theStatus.Text = string.Format("{0}:{1}:{2}",
m.Type, m.Text, m.Time);
}
13. Silver Bay Labs Development Guide Videos
Table of Contents on Left
Video on Right
Important Code in Textbox below video
http://shrinkster.com/1d0j
Good Use of Markers
14. Play Position
No event for Position Change
Use Binding to Position Property Instead
Using MediaElement

15. Video Capture
Media Security
Whats New in Silverlight 4.0?
16. Webcam and Microphone Support
AsyncCaptureImage
Captures a single frame, sends bitmap to callback
VideoBrush.SetSource
Sets the source of the VideoBrush using a video capture source
Webcam Sample Apps online:
http://shrinkster.com/1d0o
Video Capture
void AsyncCaptureImage(Action Callback)
void SetSource(CaptureSource source)
17. VideoSink
Base Class for creating video capture classes
Override OnSample, convert data to your format
CaptureSource property provides a capturesource associated with your VideoSink
CaptureSource
Use AsyncCaptureImage to capture a frame
VideoCaptureDevice
Provides metadata for a video capture device, such as a webcam.
Webcam Sample Apps online:
http://shrinkster.com/1d0o
Video Capture Classes
18. Video Capture Sample
if (CaptureDeviceConfiguration.AllowedDeviceAccess
|| CaptureDeviceConfiguration.RequestDeviceAccess())
{
VideoCaptureDevicevcd =
CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice();
AudioCaptureDeviceacd =
CaptureDeviceConfiguration.GetDefaultAudioCaptureDevice();
if (null != vcd && null != acd)
{
cs = new CaptureSource();
cs.VideoCaptureDevice = vcd;
cs.AudioCaptureDevice = acd;
cs.Start();

VideoBrushvideoBrush = new VideoBrush();
videoBrush.Stretch = Stretch.Uniform;
videoBrush.SetSource(cs);
TO_FILL.Fill = videoBrush;
}
else
MessageBox.Show("Error initializing Webcam or Microphone.");
}
19. Protection for Content Owners
Protected content is only viewed through a secure connection
Supported Scenarios:
Rental, Subscription, Purchase
Read Output Protection policies inside PlayReady Licenses
Offline Content Protection for H.264 media through Silverlight DRM
Two methods
Windows Media DRM (WMDRM10)
PlayReady (AES)
Content Security
20. Silverlight Media Player
Silverlight Media Framework
Silverlight Hyper-Video
Augmented Reality
Third Party Goodies and the Future
21. Lightweight, enough features for most video streams
Used by Channel 9
Developed by Tim Heuer of Microsoft and MVP Joel Nuebeck

  • http://shrinkster.com/1d0p

Silverlight Media Player
22. Came out of Vertigo Softwares work with Olympics and Sunday Night Football
Does all the heavy lifting
Rich multimedia control
DVR, Rewind, Alternate Language Tracks, In-stream Data Feeds, Analytics Tracking, Player Branding, Markers.
http://smf.codeplex.com/
Silverlight Media Framework
23. 11-18-09
SMF Released at PDC
1-15-10
SMF v1.1 released
Progressive Download Added
SMF v2.0 under development
SMF Timeline
24. Timeline Markers
Progressive Download Support
Smooth Streaming Support
IIS In-Stream Data Access Framework
Out-of-Stream Data Access Framework
SMF Player 1.1 Features
25. Playlists
Chapters
Manifest Marker Support
Javascript API
Closed Captioning
W3C Timed Text 1.0 DFXP Support
UI Automation
Media Plug-In Model
Logging Plug-IO
SMF 2.0 Additional Features
26. Hypertext-like features for Video
Jesse Liberty
http://shrinkster.com/1d0q
Click or gesture while watching a video
Video pauses and you get some other information
Usually another video
Could be any kind of media
Uses the MEF framework
http://slhvp.com
Video Demo: http://shrinkster.com/1d0s
Silverlight Hyper Video Project
27. Augmented Reality
Adding to (or augmenting) video with superimposed or embedded graphics.
SLAR Toolkit
http://slartoolkit.codeplex.com/
Silverlight 4.0 Only
Webcam support via CaptureSource
Multiple Marker Detection, Custom markers
Uses the Matrix3DEx library by Rene Schulte
Adds 3D features to Silverlight
http://matrix3dex.codeplex.com/
SLARToolkit Silverlight AugmentedReality Toolkit
28. Sharepoint Video Player
Embed video streams into your Sharepoint website.
http://svp.codeplex.com/
xLite Player
http://xliteplayer.codeplex.com/
Other Players
29. Scott Guthries Silverlight 4 Demos from PDC
http://shrinkster.com/1d0f
Silverlight 4 Demos
http://shrinkster.com/1d0o
Sunday Night Football
http://www.vertigo.com/snf
March Madness
http://mmod.ncaa.com/video?player=hq
Demos!