首页 > 运营 > 建站经验 > 正文

网站建设:网站中视频内容该如何制作?

2020-10-03 15:07:07
字体:
来源:转载
供稿:网友

although i've been working on web sites since 1993, it's only been in the last year that i've started playing around with video on the web on my own sites and on some of the sites i've designed. now that standard web connections are faster than ever, video is more accessible than ever.
我从1993年开始设计网站,但直到去年才开始在自己的网站以及部分为用户设计的网站中增加视频内容。现在网络连接速度越来越快,设置视频内容的网站也越来越多。

the following article is an excerpt from the second edition of my book, learning web design, which is aimed at people who are brand new to web design and production. this excerpt is intended to be a starting point for understanding the basics of web video and is by no means the final word. see the excellent resources at the end of this article for further reading.

这篇文章摘录自我编写的《学习网站设计》(第二版),主要针对刚开始学习网站设计的受众。这篇文章可以帮助初学者了解网站视频设计的基本知识,但并不是最终结论。下面介绍主要内容。

video
视频

how did they get a little movie to play right on their page?
如何在网页中恰到好处地运用视频?

when you see a video playing right on a web page, chances are it's a quicktime movie that has been placed on the page with an <object> tag (the world wide web consortium's [w3c] preferred method) along with an <embed> tag (apple's recommended method for netscape and older browsers) as shown in figure 22-4). this method is discussed in detail in the next section. in order for the movie to display on the web page, the quicktime plug-in must be installed on the user's browser. fortunately, this plug-in is included in current browsers' installation packages. for windows users, code in the <object> tag automatically installs the player necessary for viewing the movie.

如果视频运用其当,那可能是利用<object>标签(w3c常用的方法)与<embed>标签(苹果公司推荐netscape以及更老的浏览器用户使用的方法)设置了quicktime电影,下一节我们会具体介绍这个方法。用户浏览器中只有安装quicktime插件,才能收看电影,值得高兴的是,现在浏览器中包含这些插件。对windows用户来说,<object>中的编码可以自动安装观看电影需要的播放器。

figure 22-4. use the <embed> tag to place a movie and its player right on the page like an image. note that i've added 16 pixels to the actual movie height (120 pixels) to accommodate the player controls.

figure 22-4.
利用<embed>标签设置电影与播放器,类似于设置图片。我在实际电影宽度(120像素)的基础上增加了16个像素,容纳播放器的控制器。

adding_movies_to_your_web_page

as an alternative, you can provide a link to the movie file and let the user download it whenever they want (figure 22-5). when the movie downloads, it can be viewed in the browser window with the quicktime plug-in or it can be played with another movie-playing helper application.

另外,你也可以提供电影链接,保证用户在需要时,可以进行下载(figure 22-5)。电影下载时,保证用户可以在quicktime插件或者其它电影播放程序的帮助下,在浏览器中观看电影。

tip: when linking to an audio or video file, always provide the file size so users can make an informed decision about whether they want to commit to clicking the link.

提示:与音频或视频内容链接时,保证提供文尺寸,这样用户可以提前决定是否进行链接。

figure 22-5. you can also simply link to a movie file. when the user clicks the link, the movie opens in whatever movie player the browser has configured.

figure 22-5
可以与电影进行链接。用户点击链接后,电影可以在浏览器配置的任何播放器中播
放。

adding_movies_to_your_web_page

using <object> and <embed>

利用<object> <embed>标签

to ensure that videos will play properly on all browsers, it is recommended that you place the movie on the page using both the <object> and <embed> tags. the standard, minimum code for doing this is as follows:

为保证视频可以在浏览器中播放,你可以利用<object> <embed>标签进行设置。使用方法如下:

<object width="240" height="196"

  classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b"

  codebase="http://www.apple.com/qtactivex/qtplugin.cab">

  <param name="src" value="moviefile.mov">

 

  <param name="controller" value="true">

  <param name="autoplay" value="false">

  <embed src="moviefile.mov" width="240" height="196" 

    autoplay="false" controller="true"

    pluginspage="http://www.apple.com/quicktime/download/">

  </embed>

</object>

if you look carefully, you will see that the basic directions are repeated in both the <object> tag and its parameters and the <embed> tag. let's take a look at the minimal movie settings.

仔细观察,你会注意到<object><embed>标签中的参数用法重复。下面介绍设置最短视频的方法。

player information
播放器信息

both tags contain code that prompts the browser to download the player necessary for displaying the movie on the page. in the <object> tag, the classid and codebase attributes provide specific directions for automatically installing the required activex element.

上述两个标签中包含允许浏览器下载电影播放器的编码。在<object>标签中,classidcodebase属性指示浏览器自动安装activex元素。

in the <embed> tag, the pluginspage takes the user to a page where they can download the quicktime player if it is not found by the browser.

<embed>标签中,如果浏览器没有发现播放器,插件页面会引领用户进入下载 quicktime播放器的页面。

the values of these attributes (shown in bold) must appear exactly as they are written here or they will not work.

这些属性值(黑体内容)必须这样呈现,不能更改,否则没有任何作用。

source
位置

as for images, you must provide the source url for the movie file in both tags. for the <object> tag, the url is provided within a parameter (<param name="src" value="moviefile.mov">). the <embed> tag uses the src attribute.

与设置图片相同,你需要为两个标签中的电影文本提供url<object>标签中的url会在参量中出现(<param name="src" value="moviefile.mov">)<embed>标签使用src属性。

dimensions
尺寸

the width and height attributes are required in both tags. in order for the controller (the strip at the bottom with the slider and play and pause buttons), you must add 16 pixels to the height of the movie. in the previous example, the original movie is 240 x 180 pixels, so i've set the width to 240 and the height to 196.

两个标签中需要设置宽度与高度属性。你需要在实际电影高度的基础上增加16像素,用来放置视频控制器(带有滑动条、播放键以及暂停键的区域,出现在底部)。在刚才的例子中,电影宽度为240x180 ,所以,我把宽度定为240,高度定为196

controller
控制器

you can decide whether you want the controller to display using the controller parameter and attribute. setting the value to true makes it display; setting it to false hides it. use the autoplay parameter and attribute to set whether the movie starts playing automatically when the page loads (true) or if the user needs to hit the play button to start the movie (false).

你可以利用控制器参数、属性,来决定是否呈现控制器。参数值设置为“true”,呈现控制器;参数值设置为“false”,隐藏控制器。利用自动播放参数、属性,决定网页下载完成后,电影自动播放,还是用户点击播放键之后播放。

this is just the tip of the iceberg of controls for inline video using the <object> and <embed> tags. for a complete list, see apple's tutorial for embedding quicktime movies.

利用<object> <embed>标签,设置视频,还需要了解很多其它内容。你可以阅读苹果公司关于嵌入quicktime movies的手册,获取更多信息。

movie files
电影文件

let's talk a little more about movie files. the quicktime movie format (.mov) is ideal for delivering movies over the web because it is a highly condensed format supported on both pcs and macs. movies can also be saved in mpeg (.mpg or .mp2) format or as windows-only avi files (.avi).

这里,稍微介绍一下电影文件。quicktime电影格式(.mov)适于利用在网站中,因为pc机与苹果机都支持这种高度压缩格式。当然,电影也可以保存为mpeg(.mpg or .mp2)或者avi格式(.avi)

making movies is easier than ever with digital video cameras that can be plugged directly into your computer. you'll need to start with a video source (from your camera or videotape). you'll also need video-editing software, such as quicktime (by apple), media cleaner pro (by terran interactive), apple final cut pro, or adobe premier if you want to go for professional-level editing (adobe.com). if you work on a newer macintosh, you can take advantage of apple's imovie technology, which puts basic movie-making abilities in the hands of consumers.

现在数码相机可以与计算机连接,制作视频就更简单。你需要具备视频资料、视频制作软件,软件包括:quicktime(苹果机)、media cleaner proterran interactive)、apple final cut pro或者adobe premier (adobe.com)。如果拥有最新的macintosh,你可以利用apple's imovie技术,允许网站消费者自己制作视频。

because video and audio information can be huge, the trick to making web-appropriate movies is optimization--the frame rate, the image compression, and the sound compression (see optimizing video for the web below). all video-editing packages provide the tools you need for compressing your video as small as possible.

由于视频与音频的文件尺寸大,我们必须对其进行优化——帧频、图像压缩率、声音压缩率(下面会介绍视频优化方法)。所有视频编辑器提供的压缩工具尺寸需要尽量小。

streaming video
流式视频

like audio, a video source can be streamed so that it starts playing quickly and continues playing as the data is transferred. the options for video are the same as for audio: realmedia (.rm), windows streaming media (.wm), and streaming quicktime. for true streaming performance, the files must be served from a computer outfitted with the appropriate server software. see the companies' web sites, listed earlier in the streaming audio section, for current information on streaming formats.

音频与视频内容可以流动,数据传送时,视频内容快速、不间断地播放。与音频相同,视频也有以下几种:realmedia (.rm)windows streaming media (.wm)、以及 streaming quicktime。流动视频只有在配备适当服务器的电脑中,才能播放。浏览网站,找出流动格式的信息。

optimizing video for the web
优化网站视频

most video editing tools offer automatic web video settings targeted at various internet connection speeds. you may also want to experiment with these settings individually to find the quality that best suits your video.

大多数视频编辑工具提供针对不同网络链接速度的视频设置。你可以单独测试这些编辑工具,找出最适合自己需要的。

frame size
框架尺寸

common frame sizes for web video are 160 x 120 and 240 x 180. some developers go as low as 120 x 90. it is not recommended that you use a frame size larger than 320 x 240 with current technology.

网站视频框架尺寸一般为:160x120240x180。有些网站设计者会设置为120x90,在当前网络技术条件下,框架尺寸不应超过320x240

frame rate
帧频

frame rate is the measure of number of frames per second (fps). standard video is 30 fps. for the web, a frame rate of 15 or 10 fps is more appropriate.

帧频就是指每秒的帧数(fps),标准视频为30fps1510fps是比较合适网站的帧频。

color bit depth
颜色位深

reducing the number of colors from 24-bit to 8-bit will drastically reduce the size of your video, but will also sacrifice quality.

视频颜色由24位缩减为8位,会显著减小尺寸,但视频质量会变差。

data rate
数据传输速率

this is the rate at which data must be transferred in order for the video to play back smoothly. data rate is measured in kilobytes per second (kbps). this is one of the most important settings for web video, particularly for streaming video, and it should be tailored to the targeted internet connection speed. for 56 kb connections, aim for a data rate of 4 kbps; 30 kbps for dsl; and 50 kbps for cable connections.

数据传输速率必须保证视频可以不间断播放,这个速率用每秒千字节(kbps)来测量。对网站视频,尤其是流动视频来说,这是一项重要的设置。网络链接速度不同,这个速率也就不同。56kb的网络链接中,目标传输速率为4kbps;利用dsl进行网络链接时,目标传输速率为30kbps;利用电缆连接时,目标传输速率为50kbps

compression scheme
压缩方案

videos are compressed using compression and decompression algorithms (called codecs). there are many codecs available, but the best choices for web video are h.263 and the sorenson video codec, which can achieve very high image quality at lower data rates. sorenson requires a high-performance processor for playback, so it may not work well on older computers. sorenson 3 video is a later version which requires the latest hardware and software configurations for playback. as an alternative, the cinepak codec is a good general-purpose codec that compresses reasonably well and is supported by older computer configurations.

视频可以通过压缩、解压法则(称为编码/解码器),改变尺寸。可供利用的codecs(编码/解码器)很多,但最好的两种是h.263sorenson video codec,他们可以在较低的传输速率下,保证图像的高质量。由于sorenson需要高性能的处理器,以达到重放的目的,所以它不适合老式计算机。sorenson 3视频是一个较新的版本,需要配置最新的硬件与软件,才能达到重放的目的。你可以使用cinepak,它可以适当压缩视频文件,并且可以在老式计算机中运用。

quality
图像质量

you can set the overall quality of video to low, medium, or high. medium is fine for most purposes.

图像质量可以设置为一般、良好、优质,大多数情况下,质量就可以。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表