Overview Introduction to SMIL • Introduction to W3C and XML • Introduction to SMIL • Writing a SMIL file • Adding Media Objects Martin Halvey • Clipping media files January 2008 • Timing and Synchronising • Layout World Wide Web Consortium World Wide Web Consortium W3C W3C • Develop common protocols that • User Interface Domain promote WWW’s evolution and ensure – Hypertext Markup Language (HTML) its interoperability – Cascading Style Sheets (CSS) – repository of information about the WWW – Document Object Model (DOM) for developers and users • Technology and Society Domain – sample code implementation to embody – Resource Description Framework (RDF) and promote standards • Architecture Domain – various prototype and sample applications to demonstrate use of new technology – Hypertext Transfer Protocol (HTTP) – Extensible Markup Language (XML)
Extensible Markup Language XML Syntax XML • XML is a method for putting structured • A document is made up of elements data in a text file • Each element has either a start-tag and end-tag or an empty-element tag • XML is text, not binary, but is not meant to be read • Tags are identifiers enclosed within less-than (<) and greater-than (>) • XML is license-free, platform- characters independent and well-supported, W3C • Elements are ended with a forward- standard since February 1998 slash (/) character, either at the beginning of an end-tag or at the end of an empty-element tag XML Syntax XML vs HTML • Elements may have one or more • XML tags are case-sensitive. This attributes. Each attribute is a name/ means that the tags <smil> and <SMIL> value pair in the form name="value" are not the same • A set of start and end tags surround the • Empty-element tags require a forward- text (or other elements) which they're slash (/) at the end of the tag (before the marking up greater-than (>) character) • Elements may contain other elements • Elements with a start-tag must have a (this is called nesting) corresponding end-tag
What is SMIL Why use SMIL • Set of XML modules • It is free and open • They are used to describe • Easy to learn and use – Temporal behaviour • Provides capabilities beyond those of any multimedia format yet seen on the – Positional behaviour web – Interactive behaviour • Animation • No need for additional software • Events • W3C adopted and published the SMIL 2.0 recommendation August 2001 • Used in MMS and HD DVD Who uses SMIL How to create a SMIL file • RealNetworks • Netscape/AOL • Text Editor is sufficient • Intel • Nokia • Many companies are providing editors • Macromedia • Ericsson – Adobe • IBM • Canon – RealNetworks • Intel • Panasonic – DoCoMo • Macromedia • Phillips – SMIL Media • Microsoft • Many Others
SMIL Player Software Writing a SMIL File • Players available for a variety of devices Every SMIL should start with a line identifying it as an XML document • Players available from – Ambulant <?xml version=“1.0”?> – QuickTime Player – RealPlayer – Windows Media Player – KMPlayer – Helix Player Writing a SMIL File Writing a SMIL File The next line in your SMIL file should The next line in your SMIL file you identify it to be a SMIL document should place the SMIL element <!DOCTYPE smil PUBLIC”-//W3C//DTD SMIL <smil xmlns="http://www.w3.org/2001/SMIL20/Language"> 2.0//EN” </smil> http://www.w3.org/2001/SMIL20/SMIL20.dtd> It requires at least one attribute, the xmlns (XML This is called the XML prolog and/or NameSpace) Document Type Declaration
Writing a SMIL File Writing a SMIL File It is a good idea to provide some Contains <head> and <body> elements additional information in the root of your SMIL file <?xml version="1.0"?> <!DOCTYPE smil PUBLIC "-//W3C//DTD SMIL 2.0//EN" "http://www.w3.org/2001/SMIL20/SMIL20.dtd"> <smil xmlns="http://www.w3.org/2001/SMIL20/Language" <smil xml:lang="en" title="SMIL template"> xmlns="http://www.w3.org/2001/SMIL20/Language" <head> xml:lang="en" </head> <body> title="SMIL template"> </body> </smil> </smil> Adding Media Objects Adding Media Objects There are a number of types supported Additional types by SMIL – ref – img – brush – video – audio Two types of type – animation – Discrete – text – Continuous – textstream
Adding Media Objects Making Media Accessible Each media object has a src attribute Number of attributes exist to add where you give the location of a media additional information object – alt <img src="picture.jpg"/> – longdesc – readIndex <video src="movie.mpg"/> Making Media Accessible Clipping Files • Easy to play part of a file in SMIL • Clipping can only be applied to <img src="party.jpg" alt="a picture of me from my birthday party" longdesc="party.txt"/> continuous media such as audio, video, and text streams <video src="game.mpg" alt="a movie of one • Only need to specify when the clip of the games from my birthday party" should begin and end longdesc="game.txt"/> • Give time values in NPT or SMPTE
Clipping Files Clipping Files Easy to do in SMIL, use one of two For the hypothetical movie.mpg file, attributes which is 30 minutes in length – clipBegin – clipEnd Starting 20 seconds into the video: <video src="movie.mpg" clipBegin="20s"/> Give values in one of two formats – Normal Play Time (NPT) Cutting out the last 3-minute, 30-second – SMPTE, from Society of Motion Picture scene: and Television Engineers <video src="movie.mpg" clipEnd="26:30"/> Clipping Files Time Formats For the hypothetical movie.mpg file, • "16“ which is 30 minutes in length – 16 seconds (the same as "16s") • “02:45:14.273“ Showing an interesting frame from the – 2 hours, 45 minutes, 14 seconds, and 273 milliseconds middle: • "07:00“ <video src="movie.mpg" clipBegin="14:55.7" clipEnd="14:55.7"/> – 7 minutes • "30m" – 30 minutes
Time Formats Clipping Files • "1h“ • Clipping files is easy, use one of two attributes • 1 hour – clipBegin • "1.48“ – ClipEnd 1 second and 480 milliseconds • • They can also be used together • "1480ms“ • Time can be given in numerous formats • 1480 milliseconds (the same as above) once it is in NPT or SMPTE Timing and Synchronisation Timing and Synchronising • Timing and synchronisation is one of Possible to present a number of the strengths of SMIL elements in sequence, using <seq> • You can be as precise or vague as you like <seq> <video src="ad1.mpg" alt="ad for a new computer"/> • Relatively easy to present content in <video src="ad2.mpg" alt="ad for an ISP"/> parallel or in sequence <video src="ad3.mpg" alt="ad for an ad blocker"/> </seq>
Timing and Synchronising Timing and Synchronising Possible to present a number of It is possible to specify start times for elements in sequence, using <par> elements in a sequence <seq> <video src="ad1.mpg" alt="ad for a new computer"/> <par> <video src="ad2.mpg" alt="ad for an ISP" <video src="ad1.mpg" alt="ad for a new computer"/> begin="00:02"/> <video src="ad2.mpg" alt="ad for an ISP"/> <video src="ad3.mpg" alt="ad for an ad blocker" <video src="ad3.mpg" alt="ad for an ad blocker"/> begin="00:02"/> </par> </seq> Timing and Synchronising Timing and Synchronising It is possible to achieve the same A element can also be timed to start relative to another outcome with par <par> <par> <audio src="ad_music.mp3" alt="subliminal <audio src="ad_music.mp3" alt="subliminal advertising advertising enhancer"/> enhancer"/> <video src="ad1.mpg" alt="ad for a new computer"/> <video id="ad1" src="ad1.mpg" alt="ad for a new computer"/> <video src="ad2.mpg" alt="ad for an ISP" <video id="ad2" src="ad2.mpg" alt="ad for an ISP“ begin="00:17"/> begin="ad1.end+00:02"/> <video id="ad3" src="ad3.mpg" alt="ad for an ad blocker" <video src="ad3.mpg" alt="ad for an ad blocker" begin="ad2.end+00:02"/> begin="00:34"/> </par> </par>
Recommend
More recommend