Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >System Management


    

Blue Forest http://www.lslnet.com at 19:08 on May 28, 2006


"Laugh" proud of streaming media-based SMIL Guide

"Laugh" proud of streaming media-based SMIL Guide
May 14, 2002 13:38:37 5d multimedia litteruser
I. Introduction

With the mature and widely used technique, we have a deep understanding of its merits. However, their deficiencies are also gradually manifested. The problem occurs, we must think of ways to solve this problem. SMIL is the current technique of the issues raised. Now let us look at SMIL.

1, SMIL curriculum vitae

SMIL is the Synchronized Multimedia Integration Language (Synchronized Multimedia Integration Language), the acronym for reading so smile (Oh, that name pretty good, huh?). It is 3W (World Wide Web Consortium) Organization of multimedia manipulation language. SMIL is the latest version of the August 2001 introduction of SMIL 2.0 version (in the formulation of the criteria of qi, J are Compaq, Gateway, IBM, Microsoft, RealNetworks, Oratrix and so on. Too much, breath are interesting!). SMIL our website and the use of HTML (hypertext transfer language) format syntax is very similar. The latter document manipulation against ordinary Internet media (text, pictures, sound, animation and video-built machinery), and the former is manipulating multimedia fragments (organic extracts of multimedia, smart combination). J looks really good things!

2, SMIL advantages?

SMIL language is a very simple but already provides a good marker. It used to provide multimedia fragments (here multimedia coverage : audio files, video documentation, animation, pictures, text, etc.) at any time and in any place, and what kind of broadcast. Confused? Now we have a look at the J SMIL advantages (a unique place! ) :

For the sake of convenience, we want to complete our work as a demonstration (presentation).

(1) to avoid the use of a unified inclusive document format

The multimedia format of the document because we have a lot of time, for example : there *.mp3 like voice, *.wav, *.ra etc.; The video format is more surprising : *.mpg, *.avi, *.mov, *.rm etc.; Needless to say more on the format of the pictures. J if we want to broadcast in the local machine or using streaming broadcast on the network to broadcast a number of documents. We certainly hope that our own total is not to open the documents. Instead, after the completion of a document shown on a broadcast. Broadcast list is the solution. However, if a different format, and requires multiple fragments broadcast simultaneously (for example : Photo show at the same time, the voice explained. The two documents, photographs and voice), previously the only viable solution is to use the media-editing software such documents are integrated into a multimedia document. This requires the use of some kind of unified file format. If your source document (various multimedia fragment) has not kept a copy of the case, in which you use a certain source document the next time you regret J! If we use these organizations to SMIL multimedia documents, then could not document the source of any change in the circumstances, the results that we want (from here, SMIL is like wearing a pearl necklace with gold silk thread, but they wear form a whole, and they will not break. ). SMIL so of course it's not a functional point. Next :
(2) broadcast simultaneously in different places (server) multimedia fragment

And if the first point you can also use other methods, in which case it probably 609-735 ?font you retreated ... [ellipsis as published] "Wingdings", "J consider this a practical problem : If we want a live television interview (video) with Commentary (Commentary, including voice (audio) and the writing). Let us assume that in the case of A Video File is a document server, the server audio files B B documents and explanations on the C language is C server document. Helpless in a traditional way here (a dead end J), and SMIL can be very easy to do this.

(3) Time Control

If we do not want to use the entire video file, but only with a certain part. The traditional approach is the only feasible use editing software to editing. Much time and effort is not to say that it seemed to prevail, wanted to Cut! SMIL which is really easy to get this done! Look at one such case : A Video File set length of time is 10 seconds, we had to use the 2-5 seconds, other parts of what we do not want, as long as the use of SMIL : A Video File seconds of the second broadcast shows to be the end of the fifth seconds.

Another part-time control of animation effects and retreats. If the above control is the silk, then it is a double-sided embroidery above! We will be back to discuss this issue in detail. J

(4) conduct a demonstration of the entire layout

We used the above-mentioned examples that illustrate the problem : As we have video and what kind of language, we hope layout? Under normal circumstances in a region (the top screen), broadcast video, text shown in another region (at the bottom of the screen). Of course, if you believe in the video above results show a better word, it can be done. SMIL used to achieve this effect very easy!

(5) Multiple language support options

Analysis : A practical example of such a product we want to publicize their targets are a number of countries who have English-speaking countries and French-speaking countries, German national and so forth. Of course, the most important is the Chinese-speaking countries (I am Chinese! ). If we want all people can understand, we understand, we will prepare different language versions of the media documents. The traditional method is to allow users to select and then download the corresponding server versions. Trouble would not talk about it. If we choose the foreigners have not read (sometimes, I went to German, Japanese, Korean sites, not knowing they may say things L), how do? SMIL if they use to organize, provides Well, the SMIL language to the language-specific version of the corresponding set up to broadcast the demonstration. Is convenient!
(6) choose to support more bandwidth

Because not all users connect to the Internet the same way, so that their differences are greater speed. To let them be able to see the demonstration, we can produce a demonstration of different transmission rate. In the traditional method, the user often must choose the link corresponding to the transmission speed machine, and then have a demonstration broadcast corresponding documents. This is indeed solve some problems. In fact, not all users are aware of their connection speed is known, must choose not very troublesome? L. SMIL solve this problem as blowing! Player detect user connections, on the same server "consultations", the corresponding demonstration and broadcast transmission requirements document. Convenience between? This is a technique that is often intelligent flow (Surestream) of this kind.

SMIL language has major advantages over these large. Believe that, in practical application, we will appreciate it more advantages.

: SMIL document in the creation of our past, we have to do the following things :

1, download and install Realone Player. Currently, SMIL version 2.0, full support of SMIL 2.0 is the only version Realone Player! Therefore, I propose that we use it. Members can download from http://www.realnetworks.com/, the website also provides many domestic downloaded. GOLD downloaded version and not downloading BETA版.

2, we editors SMIL source document (procedures) using the Windows annex notebook, and it is hoped to check whether or not your normal notebook. Of course, any ordinary text editor can be (ultra Edit pretty good), but we consider to facilitate learning, the use of the notebook was most apt to find editors.

3, in our study, and I hope that we do not use specialized SMIL editor. On one hand, these existing SMIL editor is not handy. The other hand, did not help us fully understand the SMIL language.
Second, the basic knowledge of SMIL

Now we see a practical example of SMIL (can be prepared with a notebook, in English : state editor. Is not open to input Chinese characters. SMIL player because the Chinese do not understand the punctuation! ) :

"Smil>;

"Head>;

"Meta name="_ftn1"" copyright "content=" Your Name "/>;

"Layout>;

"Known layout marking -->;

"/layout>;

"/head>;

"Body>;

"Causes media labeled -->;

"<img Defended" image1.jpg "/>;

"/body>;

"/smil>;

Obviously, SMIL and HTML format very similar to the grammar! So, if everyone familiar with HTML, SMIL study things very easily. However, the difference between the two is great, so if we want to have a good school, we must conscientiously study!

This can be seen from the above examples :

(1) SMIL procedures to "smil>;, the" /smil>; end.

SMIL must "smil>;, the" /smil>; end, all the other markings which are in between. HTML, and this seems to be the same.

(2) the entire process from the head and body in two parts

Which should be the body. And the head part look at the actual situation. If necessary, we will write. If the entire process is very simple and SMIL head is not necessary, then we can not write. From personal experience, if we want to write a good demonstration effect, the head is essential! J
(3) Property and marking requirements lowercase

SMIL attributes required signs and markings must be lowercase!

We do not want to give here in the definition of attributes and markings. SMIL language is formed by markers. Each firms are marking and labeling basically attribute. For example : "various factions of the party yesterday signed a" image1.jpg "/>;, various factions are marking and the src attribute is that image1.jpg src is the attribute value. Capitalization : attribute values can be. We will encounter some attribute values behind Camel written request. What is the camel way? FadeTocolor such as the attribute values (see, in the middle, low on both sides, is very much like the camel's hump ?J) is the camel way.

(4) There must be marked as the end of a marking Xiegang

In SMIL, if not matching marker signs (such as : "smil>;< /smil>;," head>;< /head>;, "body>;< /body>; etc.), then we must have as Xiegang end labeling (such as :" the various factions of the party yesterday signed a "image1.jpg" />;).

(5) attribute values must use double quotation marks, including up

For example : defended "image1.jpg." : SMIL document server and the file name in the paper were to be consistent, must correct its path. Otherwise, SMIL player, not the paper.

(6) SMIL document entitled *.smil or expand *.smi

We have to expand the name to preserve *.smi *.smil or SMIL document. SMIL Player SMIL only able to identify this document, to adopt the correct way to decode the decoder, and broadcasting. To prevent conflicts with other types of documents were expanding, and strongly recommended the expansion *.smil name! Document : to be based on numbers, letters started in the middle can be underlined, there is no box. For example : test_one.smil can, and test one.smil resolutely not! If you like, you can use the above wording testOne.smil camels. The above examples : original complex system we can, to preserve testOne.smil. TestOne.smil and find a photo into a folder with, your pictures will image1.jpg changed the name (if any special note behind, had to do), then they may use Realone player in the open source code, we see a demonstration of the effects. J

(7) Additional information in writing "between head>;< /head>;

If some of the source code for some of the narrative is additional information, such as copyright, author, title, address, etc. - that we can "head>;< /head>; states. The basic format is : "meta name="_ftn1"" "content=" "/>;, for example :" meta name="_ftn1" "author" content= "litterone" />; "meta name="_ftn1"" title "content=" I want to learn SMI:L "/>;.

(8) with the "Known for -->; Notes :

This is a marked and HTML inside Yang. We can document the source of our Notes. SMIL Player encountered this end, it will pass without notice. For example : we can write the source code in the past, we want to achieve results in the "Known : -->; wrote, and then in the preparation of the source code, if we forget the deletion of the paragraph that would not affect the implementation of the demonstration.

This brief introduction to the basic knowledge of the SMIL language, will have to detail to learn SMIL!


Third, as many SMIL detailed analysis SMIL language, we started to talk about the most commonly used. (Ready? Starting! ), Multimedia fragmented structure (1) "seq>;< /seq>; our first look at the following example : labeled" smil>; "head>;" /head>; "body>;< seq>;< various factions of the party yesterday signed a" image1.jpg "/>; "<img defended" image2.jpg "/>;< /seq>;" Please keep /body>;< /smil>; (remember to use the file format *.smil J) and the source code to see the effects of the operation. I believe that if we can see the results : Realone player is the first showing image1.jpg and image2.jpg show. That is why we are here today "seq>;< /seq>; broadcast marking requirement of the order of the results. "Seq>;< /seq>; : in the" middle seq>;< /seq>; multimedia broadcasting sequence fragments. Shown in the following figure. (2) "marking par>;< /par>;
Check the following examples : "smil>;" head>; "/head>;" body>;< par>;< various factions of the party yesterday signed a "image1.jpg" />;< various factions of the party yesterday signed a "image2.jpg" />;< /par>; "/body>;< /smil>; ->; kept running ->; see results. Realone player shows image1.jpg and image2.jpg. That is why we are here today "par>;< /par>; broadcast parallel markings on the results obtained. "Par>;< /par>; : in the" middle par>;< /par>; fragment parallel multimedia broadcasting. Shown in the following figure. (3) The "seq>;< /seq>; and" synergy par>;< /par>; marker analysis of the examples below : "smil>;" head>; "/head>;" body>;< seq>; "various factions of the party yesterday signed a" image1.jpg "/>;" par>; "<img defended" image2.jpg "/>;" various factions of the party yesterday signed a "image3.jpg" />; "/par>;" various factions of the party yesterday signed a "image4.jpg" />;< /seq>; "/body>;< /smil>;
This example of the results is as follows : first showing image1.jpg Realone player, and then shows image2.jpg image3.jpg and then display image4.jpg. Why? One reason I think we must be very clear. I am not a memo. J
With "seq>;< /seq>; and" two pairs of markers par>;< /par>; this, we control the sequence of the multimedia broadcast extracts, it is very convenient. However, we demonstrated above, though these demonstrations. However, they do not seem to be the time to show our control. Next to address this problem.
2, Time Control
(1) mechanisms developed attributes
Please take a look at this code below results.
"Smil>;
"Head>;
"/head>;
"Body>;
"Seq>;
"<img Defended" image1.jpg "dur=" 5s "/>;
"<img Defended" image2.jpg "dur=" 10s "/";
"/seq>;
"/body>;
"/smil>;
You may have seen Mun! On, we here on the duration of a image1.jpg and image2.jpg provisions. Image1.jpg which lasted five seconds, image2.jpg duration of 10 seconds.
(2) begin and end attributes
Shown above is the long, we wanted to provide broadcast at any time. Look at the following procedures.
"Smil>;
"Head>;
"/head>;
"Body>;
"<img Defended" image1.jpg "begin=" 2 "dur=" 5s "/>;
"/body>;
"/smil>;
This example of the results is as follows : first showing image1.jpg Realone player, and then shows image2.jpg image3.jpg and then display image4.jpg. Why? One reason I think we must be very clear. I am not a memo. J
With "seq>;< /seq>; and" two pairs of markers par>;< /par>; this, we control the sequence of the multimedia broadcast extracts, it is very convenient. However, we demonstrated above, though these demonstrations. However, they do not seem to be the time to show our control. Next to address this problem.
2, Time Control
(1) mechanisms developed attributes
Please take a look at this code below results.
"Smil>;
"Head>;
"/head>;
"Body>;
"Seq>;
"<img Defended" image1.jpg "dur=" 5s "/>;
"<img Defended" image2.jpg "dur=" 10s "/";
"/seq>;
"/body>;
"/smil>;
You may have seen Mun! On, we here on the duration of a image1.jpg and image2.jpg provisions. Image1.jpg which lasted five seconds, image2.jpg duration of 10 seconds.
(2) begin and end attributes
Shown above is the long, we wanted to provide broadcast at any time. Look at the following procedures.
"Smil>;
"Head>;
"/head>;
"Body>;
"<img Defended" image1.jpg "begin=" 2 "dur=" 5s "/>;
"/body>;
"/smil>;

Photo image1.jpg during the above procedure is carried out in two seconds after the demonstration began showing that the time is five seconds. For photo control is the same, and we often need to video / audio control time. The following examples illustrate the problem.
"Smil>;
"Head>;
"/head>;
"Body>;
"Defended the video" test.rm "begin=" 5s "end=" 40s "/>;
"/body>;
"/smil>;
Video test.rm this document (if you do not have readily available *.rm format, or find *.avi firstrun.rm use of the Realone player can be. But who write for the paper! ) In the five seconds after the demonstration began to be broadcast After 40 seconds the entire demonstration broadcast on the broadcast end. The actual broadcast time : 40-5=35 seconds. However, in general, our overall video in a group, this time, he would submit to the Group of time. We then have to explain this issue in the example below.
"Smil>;
"Body>;
"Seq dur=" 5 "";
"<img Defended" image1.jpg "begin=" 2 "dur=" 10 "/>;
"/seq>;
"/body>;
"/smil>;
Image1.jpg host for the duration of the Group 5 seconds, and lasted for 10 seconds image1.jpg own request, which is not acceptable. Image1.jpg fact, the show only 5-2=3 seconds! After the procedure in writing when you must pay attention to the problem.
(3) clip-begin attributes and clip-end
Consider this effect :
If we test.rm broadcast the video / audio 5-10 seconds, the time constantly, how do? ? ? With clip-begin and clip-end J, the problem is very simple! Please read :

"Smil>;" body>;< video defended "test.rm" clip-begin= "5s" clip-end= "10s" />; "/body>;< /smil>; clip-begin time and clip-end attribute is used to control the internal attributes. Multimedia here refers to the internal records of their own time line (timeline). What began in the former local broadcast, which requires an end to broadcast into place. To understand more clearly the time control, we see the following example : "smil>;" body>;< par>; "audio defended" testone.rm "clip-begin=" 5 "dur=" 10s "/>; "audio defended" testtwo.rm "begin=" 7s "clip-begin=" 2s "clip-end=" 15 seconds "/>;" /par>; "/body>;< /smil>; look at the maps below : Obviously, testone.rm five seconds from his first broadcast began broadcasting seven seconds, two seconds from his testtwo.rm testone.rm together with the broadcast began, she has 15 seconds to testone.rm broadcast and stopped broadcasting. testone.rm broadcast 15-5=10 seconds. Testtwo.rm broadcast to only 15 seconds and stopped their broadcast testone.rm broadcast 15-2=13 seconds. Gray map (yellow) part of the broadcast said.
Next time we said to be a way (the time is acquiescence seconds, "2s", "vase" and "2" are the same) :
Reference examples marking time
H-hour to one hour 30 minutes 1.5h
4.75min min minutes to four minutes 45 seconds
S 10.45 seconds, 10 seconds, 450 milliseconds
The right time is as follows : hh:mm:ss.xy. Hh said hours ;mm said electron paramagnetic resonance said minutes ss-tenth seconds expressed mixed with 100 seconds seconds probes said. For example : begin= "01:40.0" said the Department was one minute and 40 seconds, and begin= "01:40" is 1 hour and 40 minutes, said the department started. J really pay attention to the country.
Time control is very important because it directly affects our demonstration effect. We just mentioned this is the most important, we must understand the concept of time and above all meaning.
(4) fill attributes
When a fragment broadcast after the completion of the demonstration, we can show the state is required to fill attributes. Simply say is that we freeze-screen or screens. Look at the examples below :
"Smil>;
"Body>;
"Defended the video" test.rm "dur=" 30s "fill=" freeze "/>;
"/body>;
"/smil>;
Test.rm assumption that the length is 20 seconds, so here we are : in the end test.rm broadcast, the screen showed the test.rm the final frame (that is popular in the last picture), indicating that the time is 30-20=10 seconds; If it is the pictures, then was shown photographs.
Fill attribute only two remove and freeze, the value of acquiescence remove. In the final proposal is a multi-media demonstration on the use of frozen fragment (freeze), in order to prevent the screen empty! J
(5) repeat attributes
If we want the demonstration plots fragment of a fragment or the entire broadcast several times (to mention as the 2nd). After use, then we can attribute to achieve the realistic results. Analysis of the following examples :

"Smil>;
"Body>;
"Vedio defended" test.rm "dur=" 1min "repeat=" 2 "/>;
"/body>;
"/smil>;
The above example is the so test.rm twice. If we want a fragment has been shown on (network-advertising can consider this), then repeat= "indefinite" on it. Of course, want it to stop? Player is a way to stop (stop) button (on the website of Right Key menu plugin process is the stop); Another approach (as we all know) is a closed computer! J
3, layout
We are talking about here is the layout of the screens in our various multimedia fragment shown in the set (it is not simply the distribution of audio files! Why ?J no voice in our ears to listen to what the screen; Our eyes can see pictures, graphics and text in any place! ), Which precisely in the player. Parallel from what we could see from the example shown, if we do not design the layout, then shows the effect of a mess! SMIL is the key part of the essence here, ride Let 's go!
(1) shows the basic definition window
Look at the code below :
"Smil>;
"Head>;
"Layout>;
"Root-layout width=" 300 "height" 200 "background-color=" white "/>;
"/layout>;
"/head>;
"Body>;
"/body>;
"/smil>;
Note : a, layout to be labeled "layout>; beginning and the" end /layout>; other specific markers are in the middle. "Layout>;< /layout>; must be placed on the" head>;< /head>; between.
B, root-layout marking requirements is the most fundamental and bottom of the window. All other windows are separated on the basis of it.
C, width= "300" show window 300 pixels wide ;height= "200" show window of 200 pixels high ;background-color= "black" shows that the window background color to black. Color code can also be used here. For example : background-color= "#000000." More like personal code, the color code because many color expression, but the code is not easy.
(2) definition of multimedia records show window
Analysis of this source code below :
"Smil>;
"Head>;
"Layout>;
"Root-layout width=" 300 "height" 300 "background-color=" yellow "/>;
"Region filled="f"" vedio_region "left=" 5 "top=" 5 "width=" 290 "height" 260 "/>;
"Region filled="f"" text_region "left=" 5 "top=" 270 "width=" 290 "height" 25 "background-color=" white "/>;
"/layout>;
"/head>;
"Body>;
"Par>;
"Vedio defended" test.rm "region=" vedio_region "/>;
"'s Government defended the" test.txt "region=" text_region "/>;
"/par>;
"/body>;
"/smil>;
Note :
A, "region filled="f"" vedio_region "left=" 5 "top=" 5 "width=" 290 "height" 260 "/>; definition multimedia records show window, it is vedio_region id. The id is a must (in SMIL, some of its id is omitted, but we suggest that you wrote, this is very easy to clear the entire SMIL documents thread). Five each from the top and left of the distance between pixels (Note : This window shows the basic coordinates are relative terms. ). Window width to 290 pixels; High as 260 pixels. The following shows the definition and this is the same window.
B, "vedio defended" test.rm "region=" vedio_region "/>; statement fragment test.rm in vedio_region multimedia broadcasting in the region; "'s government defended the" test.txt "region=" text_region "/>; vedio_region statement in the text of this document test.txt regional shows.
The results are examples of the distribution plan :

Multimedia shows fragments of the windows above us is the absolute definition of the method used. Multimedia records show window can also be used to define the relative definition. For example :
"Region filled="f"" vedio_region "top=" 10% "left=" 10% "width=" 80 "height" 80 "/>;
The top window shows the basic terms of the relative proportion. This approach is more intuitive.
(3) fit attributes
Demonstration of the actual production, we met our definition of the problem : we show the size and window size of the fragments multimedia inconsistency, or a large or small. I believe we would face such a problem. The solution :

A revision of the size of a window (but very often we have no way of amendments. Because, if amended, then this will affect other window display. The other window is also amended accordingly. The reality is : We have a lot of fragments of different sizes in the multimedia show with a window! ).
B, and the appropriate use of multimedia window fragments and the matching methods.
See this facet code :
"Region filled="f"" vedio_region "width=" 80 "height" 80 "fit=" meet "/>;
It is meant to meet vedio_region window display of multimedia fragment.
Fit attributes of a hidden attribute values, meet, fill, and scroll tomography four. With the tacit consent of the attribute value is hidden.
Hidden multimedia maintain the same size fragment from the upper left window is beginning to show. If the window size smaller than multimedia fragment size, the gaps will be filled with the background color. If the window size greater than the size of Multimedia fragment, fragment beyond multimedia CD to be part of a window, not to be revealed. Personally do not like that way.
Meet at maintaining multimedia fragment wide / high proportion of the same circumstances, the size of the multimedia fragment zooming. Starting from the upper left corner, zooming to a height and width of the window size equal to the corresponding size, and the other one size smaller than the corresponding window. Blank space filled with the background color. I like this!
Laval said fill multimedia fragment size makes exactly the same size window. If the relief fragment Multimedia / high percentage of the window width and / high percentage range, multimedia will fragment deformation, very ugly. Strongly recommended not to use this method.
Multimedia scroll fragment of the size of what should not be said to amend it to show the normal size. However, if the size of Multimedia fragment beyond the window size, then there will be a corresponding level of, or vertical rolling. - Suited to the type of fragmentation long multimedia display. If multimedia segment showed a very short time, it is proposed to use!
Multimedia records maintained at wide tomography / high proportion of the same circumstances, the size of the multimedia fragment zooming. Starting from the upper left corner, zooming to a height and width of the window size equal to the corresponding size, and the other one size larger than the corresponding window. The distinction was not beyond the CD to show.

Please refer to the effect of various matching graph (scroll saved results)

(4) z-index attributes
The first trial operation source code below :
"Smil>;
"Head>;
"Layout>;
"Root-layout width=" 300 "height" 300 "/>;
"Region filled="f"" vedio1_region "width=" 300 "height" 300 "/>;
"Region filled="f"" vedio2_region "left=" 270 "top=" 270 "width=" 30 "height" 30 "/>;
"/layout>;
"/head>;
"Body>;
"Par>;
"Vedio defended" testone.rm "region=" vedio1_region "/>;
"Vedio defended" testtwo.rm "region=" vedio2_region "/>;
"/par>;
"/body>;
"/smil>;

I think we have seen here : we want is the kind of television picture-in-picture effect. But in the actual show, the small screen sometimes covered by the big picture. I intend to have been wasted. Z-index attribute at this time is our savior.
Revising the "region filled="f"" vedio1_region "width=" 300 "height" 300 "/>;
"Region filled="f"" vedio2_region "left=" 270 "top=" 270 "width=" 30 "height" 30 "/>;
Cheng : "region filled="f"" vedio1_region "width=" 300 "height" 300 "z-index=" 0 "/>;
"Region filled="f"" vedio2_region "left=" 270 "top=" 270 "width=" 30 "height" 30 "z-index=" 1 "/>;
Look at the effect that trip? J
Z-index attribute provides a window display overlapping priorities. The number shown in the above case. This is very easy to understand, we do not have to say much. However, the following points should be noted :
But a root-level window at the last one, and not z-index attributes.
B, z-index attribute values can be negative. After the course, it's ranked 0.
C and no overlapping window can use the same z-index attribute values.
4, production links
The traditional media world is not one of the greatest drawbacks (Interaction). Now the heyday of the flash is essentially a world of the Internet can flow! The flow can be seen world-wide market potential. SMIL is a streaming media and the Internet to solve most of the world's best tool! This part requires that we must grasp, if not, then we learn SMIL will lose its significance. This is because the main features of SMIL (compared with other video-editing software), the same characteristics as the target is C language.
(1) "marking a>;< /a>;
Operation of the procedures below :
"Smil>;
"Head>;
"Layout>;
"Root-layout width=" 300 "height" 300 "/>;
"Region filled="f"" videoregion "top=" 0 "left=" 0 "width=" 300 "height" 300 "/>;
"Layout>;
"/head>;
"Body>;

"A style='mso-footnote-id:ftn1'" 1.rm "";
"Defended the video" videotest.rm "region=" videoregion "/>;
"/a>;
"/body>;
"/smil>;
Under normal circumstances, we see player videotest.rm shown that if we put the mouse is broadcast videotest.rm above, the shape of the mouse will target small hand into shape. Shoot mouse click, the player will cease broadcasting and broadcast videotest.rm broadcast 1.rm the document. Here, we build on the success of a very simple link. "A>;</a>; attribute is used to link marker, which is to link href said in the paper. This method is very simple, we have not done too much introduction.
If we want to create more complicated link, we will apply the following attributes.
(2) "attribute anchor>;
The last cases will be "below body>;< /body>; into this code is not differentiated look at the results?
"Body>;
"Defended the video" videotest.rm "region=" videoregion "";
"Anchor style='mso-footnote-id:ftn1'" 1.rm "/>;
"/video>;
"/body>;
We can see the effect of all the same! Then "anchor>; attribute it redundant? It is not! JJ look :
A, continue to block links
We must consider this question : 0-10 seconds in the chain to a paper document to another 10-20 seconds chain, which how do? We look :
"Body>;
"Defended the video" 1.avi "region=" videoregion "";
"Anchor style='mso-footnote-id:ftn1'" 1.jpg "begin=" 0s "end=" 10s "and";
"Anchor style='mso-footnote-id:ftn1'" videotest.rm "begin=" 10s "end=" 20s "/>;
"/video>;
We will see the results : Player 1.avi broadcast in the chain of 1.jpg 0-10 seconds, 10-20 seconds to videotest.rm chain. Warning : mechanisms developed, and clip-end clip-begin not here!
B, link some SMIL
Links to many documents, we can link almost fragments can be used for multimedia. *.smil And *.html can. However, the following discussion is how to link part of SMIL. Look at examples.
SMIL a document called test11.smil
"Smil>;
"Head>;
"Layout>;
"Root-layout width=" 400 "height" 300 "/>;
"Region filled="f"" videoregion "top=" 0 "left=" 0 "width=" 400 "height" 300 "fit=" meet "/>;
"/layout>;
"/head>;
"Body>;
"Defended the video" 1.avi "region=" videoregion "";
"Anchor style='mso-footnote-id:ftn1'" test11app.smil#testlink "/>;
"/video>;
"/body>;
"/smil>;
SMIL a document called test11app.smil
"Smil>;
"Head>;
"Layout>;
"Root-layout width=" 400 "height" 300 "/>;
"Region filled="f"" videoregion "top=" 0 "left=" 0 "width=" 400 "height" 300 "fit=" meet "/>;
"/layout>;
"/head>;
"Body>;
"Video filled="f"" testlink "defended" 1.avi "clip-begin=" 150 "region=" videoregion "/>;
"/body>;
"/smil>;

They must see! I was test11app.smil for us to set up links on the part of the id, then the link test11.smil words "#" at the marker id. Many of the application within the group is content. We test11app.smil amended as follows :
"Body>;
"Par filled="f"" testlink "";
"Defended the video" 1.avi "clip-begin=" 150 "region=" videoregion "/>;
"/par>;
"/body>;
Here, the link can be said to have perfect. But if so, then the following attributes are essential.
(3) attribute coords
Above will be the "anchor style='mso-footnote-id:ftn1'" 1.rm "/>; code is amended as follows :
"Anchor style='mso-footnote-id:ftn1'" 1.rm "coords=" 0 0,150,300 "/>;
Or :
"Anchor style='mso-footnote-id:ftn1'" 1.rm "coords=" 0 0%,50%,100% "/>;
Operation to see results. We have seen some links to the Left JJ effect, and some have not Right! This is the reason why using the link provided coordinates. Coords attribute value, the first and second respectively in the upper left corner, said the link is the horizontal (left) and vertical (top) coordinates; Third, respectively, said the four links to the bottom right hand corner of the horizontal (left) and vertical (top) coordinates. Above the pixel is the absolute definition, the following definitions of the relative ratio method. Which one do you like the taste of it.
(5)链接注意
我们的演示最后基本上都要放到服务器上。因此,文件的位置的规定就非常重要,如果文件位置出错,那么播放器将找不到文件而不能播放。这是我们最不希望看到的!下面我们就来讨论这个问题。
A、创建基地址

看下面的代码:
< head>;
     < meta name="base" content="rtsp://abc.5dmedia.com/"/>;
  < /head>;
上面就是在< head>;< /head>;中用附加信息的方式规定了整个smil文件的基地址为rtsp://abc.5dmedia.com/。规定了基地址以后,我们在用该地址下的文件的时候,就只需要给出路径就可以了。例如:
< body>;
  < video src="video/first.rm"/>;
  < video src=" video /second.rm"/>;  
  < audio src="rtsp:// abc.mysite.com:554/audio/test.mp3"/>;
< img src="http// www.5dmedia.com/image/welcome.jpg"/>;
< /body>;
这个例子中的前面的两个文件用的是基地址服务器上的文件,所以,可以之写出相对地址。但是,后面的两个文件用的是其他服务器上的文件,我们必须给出绝对地址。其中rtsp是实时流传输协议,它保证SMIL播放器正确地从流服务器abc.mysite.com上的audio文件夹下获得我的所要的文件test.mp3。554为流服务器的端口。http是超文本传输协议。它保证SMIL播放器正确地从web服务器www.5dmedia.com上的image文件夹下获得我的所要的文件welcome.jpg。< audio src="rtsp:// abc.mysite.com:554/audio/test.mp3"/>;说明的是该文件不在上面的基地址下,而在rtsp:// abc.mysite.com:554/audio/这个地方法,所我们必须修改地址。
如果我们用的是本地机器硬盘上的文件就可以用src="file:/c:\audio\first.rm"进行读取该文件。
大家在调用文件之前,一定要弄清楚文件的位置!

5、语言选择和智能流
(1)语言选择
    如果,我们想要扩大我们演示的收看人群,那么我们的听众就会有中国人、美国人、法国人、俄罗斯等等。那么怎样才能提供这种多国语言的支持呢?
Switch属性是该问题的“杀手”!
请看例子:
< smil>;
< body>;
  < switch>;
   < video src="English.rm" system-language="en-us"/>;
   < video src="Chinese.rm" system-language="zh-cn"/>;
  < /switch>;
< /body>;
< /smil>;
在SMIL播放器播放该SMIL文件时,检测你的播放器设置的是什么语言,如果是美国英语(en-us),那么就从服务器下载English.rm播放;如果是简体中文(zh-cn),那么就从服务器下载Chinese.rm文件播放。你可以设置很多的国家的选项。当然你的语言的版本也就很多了。J下面我们给出经常使用的一些语言的代码。
代码        语言
zh-cn        中文 (中华人民共和国)
en-us        英语 (美国)
fr        法语 (标准法语)
de        德育(标准德语)
it        意大利语(标准意大利语)
ja        日语
es        西班牙语(西班牙)

2)智能流(surestream)
用户的联网速度是不尽相同的。有的可能只有50K左右,有的可能有几百K。如果我们满足了高速用户的要求,那么低速用户可能由于速度太慢而不能收看。如果我们满足了低速用户的要求,那么高速用户看到的效果就打了不少的折扣,浪费了高速的带宽。怎么办?
< smil>;
< body>;
  < switch>;
  < vedio src="highspeed.rm" system-bitrate="250000"/>;
  < vedio src="midspeed.rm" system-bitrate="80000"/>;
  < vedio src="lowspeed.rm" system-bitrate="20000"/>;
  < /switch>;
< /body>;
< /smil>;
当用户的联网速度大于250kbps时,播放器就从服务器下载highspeed.rm播放;如果用户的联网速度大于80kbps小于250kbps时,播放器就从服务器下载midspeed.rm播放;如果用户的联网速度大于20kbps小于80kbps时,播放器就从服务器下载lowspeed.rm播放。所谓的“众口难调”在各位的手里就变得如此简单!J
上面讲的就是智能流(surestream)的本质实现方法!我们下面看一个复杂的一点的例子。
< body>;
< switch>;
  < par system-bitrate="225000">;
< !--联网速度大于250kbps时,播放该组-->;
    < audio src="audio/music1.rm"/>;
    < video src="video/video1.rm" region="videoregion"/>;
    < text src="words/narration.txt" region="textregion"/>;
  < /par>;
  < par system-bitrate="80000">;
    < !--联网速度大于80000bps而小于250000bps时,播放该组-->;
    < audio src="audio/music2.rm"/>;
    < video src="video/video2.rm" region="videoregion"/>;
    < textstream src="words/narration.rt" region="textregion"/>;
  < /par>;
  < par system-bitrate="20000">;
    < !--联网速度大于20kbps而小于80kbps时,播放该组-->;
    < audio src="audio/music3.rm"/>;
   < video src="video/video3.rm" region="videoregion"/>;
    < text src="words/narration.txt" region="textregion"/>;
  < /par>;
< /switch>;
< /body>;

(3)语言与速度的同时检测  < body>;  < switch>;  < !—简体中文并且速度大于28kbps -->; < text src=" Chinese_14000.txt" system-language="zh-cn" system-bitrate="28000" />;  < !--简体中文并且速度大于14kbps -->;  < text src="Chinese_28000.txt" system-language="zh-cn" system-bitrate="14000" />;  < !—美国英文并且速度大于28kbps -->;  < text src="english_14000.txt" system-language="en-us" system-bitrate="28000" />;  < !--美国英文并且速度大于14kbps -->;  < text src="english_28000.txt" system-language="en-us" system-bitrate="14000" />;  < /switch>; < /body>;(4)演示速度的控制上面我们讲的是在演示文件已经创建好的条件下进行的。那么,我们怎样制作好多媒体片断。下面是我们的建议:a、  用Realproducer或者其他的压缩工具制作流文件时,选择正确的压缩比例。为高速用户准备的文件的压缩比可以小一些,对于低速用户准备的文件的压缩比要大一点。b、  在网络传输过程中,视频占用的带宽是最多的,音频次之,接下来是动画、图片,文字是最少的。所以,我们充分考虑我们的演示的结构。例如:如果并行播放多个视频,这显然是不合适的。我们可以用图片来替代一部分视频效果。
c、  我们在传输中不能全部占用用户的带宽,必须留出一部分给用户浏览网页或者是干其它用途的。JJJ我们很多的年轻人当然是用于QQ 聊天!下表列出了我们的建议。
用户速度        建议最大流占用带宽
14.4 Kbps modem        10 Kbps
28.8 Kbps modem        20 Kbps
56 Kbps modem        34 Kbps
64 Kbps ISDN        45 Kbps
112 Kbps dual ISDN        80 Kbps
Corporate LAN        150 Kbps
256 Kbps DSL/cable modem        225 Kbps
384 Kbps DSL/cable modem        350 Kbps
512 Kbps DSL/cable modem        450 Kbps
在我们以后的制作中。上面的这些知识是非常实用的。大家一定要努力掌握!
6、  动画效果
我们前面学习的内容是SMIL1.0规定的。在SMIL2.0中添加了不少的内容,其中动画就是其中一个。很多的国外的教程上把flash文件*.swf归为这一类。我们不能同意这样的分类方法。我们认为把这样已经做好的动画该归为视频一类。真正的动画(从SMIL2.0规范中可以看出来)是有SMIL规定的并有SMIL播放器解释产生的动画。
    从实际情况来看,动画效果主要是针对图片产生的。所以,我们在这里用图片来做例子。其他的多媒体的制作方法是类似的。有兴趣的GG、JJ、DD和MM可以自己做做。
(1)             运动动画
为先睹为快,请在Realone player中运行下面的程序:
  < smil xmlns="http://www.w3.org/2000/SMIL20/CR/Language">;
  < head>;
    < layout>;
      < root-layout width="800" height="600"/>;  
      < region id="Images" left="0" width="800" height="600"/>;
    < /layout>;     
  < /head>;  
  < body>;      
          < img region="Images" src="g03.jpg" dur="6s">;  
          < animateMotion from="0 0" to="600 400" dur="4s"/>;            
          < /img>;         
< /body>;
< /smil>;

解释:a、我们这里用到的是SMIL2.0规范中的规定的内容的。所以,在第一行里(xmlns="http://www.w3.org/2000/SMIL20/CR/Language")我们必须声明我们所用的规范。不然的话,播放器可能不能正确解码、播放。
b、  animateMotion标记声明的是我们所要的动画类型。注意:这里就是我们所说的骆驼写法,还记得吧!JJ
c、  from="0 0" to="600 400"属性及其属性值声明的是动画从坐标点(0,0)运动到坐标点(600,400)。这里我们也可以写成:< animateMotion from="0,0" to="600,400" dur="4s"/>;
d、  dur="4s"属性及其属性值声明的是动画在4秒内完成。在我们这个例子中,图片的存在时间是6秒,那么动画完成后,将有2秒钟的时间静止不动。如果图片的存在时间小于动画存在时间,那么动画运动到半路上就的停止,这样的情况是该避免的。
(2) 缩放动画
           下面我们看看另外的一种动画形式:缩放动画。先看效果!J
< smil xmlns="http://www.w3.org/2000/SMIL20/CR/Language">;
  < head>;
    < layout>;
      < root-layout width="800" height="600"/>;  
      < region id="Images" left="0" width="800" height="600"  fit="meet"/>;
        < /layout>;      
  < /head>;
  < body>;   
    < img region="Images" dur="10s" src="g03.jpg" width="400" height="320">;                     
     < animate attributeName="height" from="320" to="160" fill="freeze" dur="10s"/>;
   < /img>;   
< /body>;
< /smil>;
解释:animate attributeName="height" from="320" to="160"声明了动画的类型和参数。大家看了效果以后,在结合上面的参数的意义,各参数是什么意思我们也就不用多讲了。J

7、  转场效果   首先解释一下什么是转场效果。我们的演示中多媒体片断是很多的,不可避免的会有两个片断之间的切换。例如:一个图片演示完了,该接着演示下一个图片,两图片中间是有一个过渡的。这个过渡我们就称谓转场效果。如果我们不设置转场效果,那么,过渡的效果肯定不好。LSMIL中的转场效果大致分为wipe和fade两类。(1)   fade类型从名字就可以看出,这个是淡入淡出的效果。先睹为快!J 请看例子!< smil xmlns="http://www.w3.org/2001/SMIL20/Language">;< head>;< transition id="fade1" type="fade" subtype="fadeToColor" dur="4s" />;     < transition id="fade2" type="fade" subtype="fadeFromColor" dur="4s" />; < /head>;< body>;< img src="g04.jpg" dur="10s" transIn="fade2" transOut="fade1"/>;< /body>;</smil>;解释:a、transition声明我们要设置转场效果。id="fade1"设置了该转场效果的id号。id号必须设置。type="fade"设置了转场效果的基本类型为fade。 subtype="fadeToColor"设置了转场效果的具体类型(子类型)为fadeToColor(注意这里又是我们提到的骆驼写法!)。dur="4s"设置了该场效果完成的时间。b、transIn="fade2"设置了图片g04.jpg显示时采用转场效果fade2; transOut="fade1"规定图片g04.jpg完成显示时采用转场效果fade1。c、fade只有三个子类型。上面我们用了2个。还有一个是crossfade,这个也是缺省设置。
(2)   wipe类型
wipe为擦去类型。该类型的效果很多很多。我们这里所说的wipe只是他们的总称(注意wipe不能作为type的属性值,而是它的子类作为type的属性值,子类的子类作为subtype的属性值!J谁让它的属性值这么多!!!)。具体的有barWipe、boxWipe、fourBoxWipe等36大类!!!不管它有多少类,先看看怎么弄。请看例子:
< smil xmlns="http://www.w3.org/2001/SMIL20/Language">;
  < head>;     
    < transition id="wipe1" type="slideWipe" subtype="fromTop"/>;
    < transition id="wipe2" type="waterfallWipe"/>;  
  < /head>;
  < body>;   
   < img  src="g03.jpg" transIn="wipe1" transOut="wipe2" dur="5s"/>;   
  < /body>;
< /smil>;
解释:a、JJJ和上面的写法基本上是一致的!
      b、type="waterfallWipe"后面没有子类型表示使用的是waterfallWipe类型的默认子类型。
(3)   综合应用
我们上面都只是用在单个多媒体片断上的转场效果。下面看看在多个多媒体片断上怎样设置转场效果。还得看例子:J
< smil xmlns="http://www.w3.org/2001/SMIL20/Language">;
< head>;  
< layout>;
< root-layout width="400" height="300"/>;
< /layout>;
< transition id="fade" type="fade" subtype="fadeToColor" fadeColor="green" dur="4s"/>;
< transition id="fade1" type="fade" subtype="fadeFromColor" fadeColor="red" dur="4s"/>;
< transition id="fade2" type="fade" subtype="crossfade" dur="2s"/>;
< transition id="push" type="snakeWipe" dur="4" />;
< /head>;
< body>;   
< seq>;
    < img dur="5s" src="g06.jpg"  transIn="fade1" fill="transition"/>;
< img dur="4s" src="g05.jpg"  transIn="fade2" fill="transition"/>;
< img dur="4s" src="g06.jpg"  transIn="fade2" fill="transition"/>;
< img dur="4s" src="g05.jpg"  transIn="push" transOut="fade"/>;
< /seq>;      
< /body>;
< /smil>;
解释:a、fadeColor="green"设置了谈出谈入色为绿色(green)。在这里表示的就是从当前的多媒体片断渐变为绿色。下面的fadeColor="red"则表示从红色渐变为当前的多媒体片断(如果是图片则变为图片,如是视频则变为第一帧)。
b、fill="transition"表示的是最后的完成效果有下面的转场效果来决定。
c、最后一个就不能用fill="transition"了。想想,它就是最后一个了,上哪里去找下面的转场效果呢?

四、后记感谢大家一路陪伴!我们终于完成了SMIL基础性学习。SMIL的内容是很丰富的,由于作者的水平、时间和精力有限,研究的不是很深。这次真的体会到学习一种新的语言的难度比学习软件的应用难度大很多,而这是不可以同日而语的。我们所提到的是非常基础、非常重要、非常实用的部分。如果大家有兴趣想进一步研究,可以看看SMIL2.0规范。它位于http://www.w3c.org/下,大家可以下载下来看看。下面该交待的是SMIL目前支持的媒体对象:animation 、video、 audio、 img、 text和 textstream。它们所能支持的格式由我们选择的播放器来决定。下面我们要谈到这个问题。虽然,SMIL的优点很多,但是缺点也是有的。1、 播放器太少目前全面支持SMIL2.0的播放器只有Realone player。而支持SMIL1.0的播放器却很多。例如:Quicktime(苹果(apple Inc.)公司),soja(一个用java语言编写的播放器,体积很小,效果不错。嵌在网页上是在好不过了)。这个问题我想不久就会得到解决。2、 各播放器不太兼容我们在*.smil文件中用的多媒体的格式必须考虑到播放器所能支持的格式。例如:Realone player支持的流文本(stream text)格式*.rt非常不错。可是,很少有其他的播放器支持该中格式。Quicktime支持*.mov格式,这种格式也是非常棒的。然而,支持它的播放器寥寥无几。相信随着各个播放平台的功能的拓展,这个问题也会得到解决。3、 制作的工具匮乏目前我们没有发现好的制作软件。oratrix公司的GRiNS Editor for RealONE      用起来并不方便。而Flution则好像是个人业余写的程序,用起来比GRiNS Editor for RealONE舒服些,但是感觉也不是很好。如果演示不是非常复杂,可以用Real slideshow来做,效果不错,使用也非常简单。如果愈来愈多的公司来写这样的编辑软件,那么将来肯定会有很多好的SMIL:编辑软件。就像今天的html的Dreamweaver一样强。4、中文的支持能力差   我们上面提到可以使用*.txt文件。如果*.txt文件的内容是英文的,那么一切都非常好。但是,如果是中文的话,显示的就是一对乱码。由于个人的水平有限,到目前为止,依然没有找到中文显示的解决办法。

“笑”傲流媒体─SMIL基础教程

我也来谈谈smil.
realone对smil支持不错,而quicktime支持就差很多了,在quicktime里,实际上使用使用track.在某种意义上讲,quicktime本身就是一个非线性编辑器,主要使用track来完成.

做一个最简单的测试,同时播放两个影片,使用smil写出来,在realone和quicktime上能完成,如果其中一个有延迟 就是使用begin=5s,在quicktime中无法完成.quicktime好象使用一种applescript语言.

至于微软  呵呵   就算了   也是部分支持
国内有一个叫傲行的 没测试过

很久没去看了,很多记不清楚了:(



Copyright © 1999-2000 LSLNET.COM. All rights reserved. 蓝森林网站 版权所有。 E-mail : webmaster@lslnet.com