本博客中原有一篇“Introduction - How to Create Streaming Video”作为FLASH视频的初级入门文档,为了更多了解FLASH视频播放,深入了解各种方案的利弊,为选择FLASH视频播放方案提供依据,又特译了此篇!
本文从《Flash.Video.for.Professionals Expert Techniques for Integrating Video on the Web》摘录而来,并做了关键性的翻译。
欢迎转载,转载时请注明出处,由于本人也正在学习FLASH相关的知识,本文如有翻译错误,请指正!!
Progressive or Streaming? That Is the Question
Now that you’ve got the interface and functionality under control, it’s time to answer the eternal question: What method will you use to deliver the video? You have three options:
三种视频传输方式:
• Embed the video in an SWF.
视频嵌入到SWF中
• Provide a progressive download FLV, loaded into an SWF.
提供一个渐进式下载然后载入到SWF的FLV视频格式文件
• Stream from Flash Media Server (FMS), viewed through an SWF.
通过SWF观看从FMS(FLASH媒体服务器)流式下载的的视频
Note that in each method, you will need an SWF shell to play the FLV through.
This shell will contain all the ActionScript needed to load the FLV. (Yea! Finally, some
ActionScript!) First, let’s look at each delivery option in detail.
注意以上每种方式,你都需要一个SWF的外壳程序来播放FLV视频。这个外壳程序包含装载FLV视频文件的ActionScript脚本。
Embed Video in SWF
SWF中嵌入视频
This is the most basic option, available for Flash 4 and up (see Figure 3.2). In most professional applications, though, you’d never use this method. It’s good for very short clips (5 seconds or less) whose quality is not so important. The only reason you’d ever want to use this method would be if you needed to deploy one single encapsulated SWF or if you needed to deliver short clips to older versions of Flash. Also, some older versions of the Linux Flash Player have reportedly had issues with FLV playback, so it’s common to use SWF videos when delivering short videos to Linux clients. This embed method can actually be helpful because it gives you visual feedback if you need to develop animation overlays and interactivity. It lets you actually see each frame on the timeline in Flash as you animate.
此种方式主要用于那些视频质量并不重要且非常短小的剪辑(5秒或更短),只有当你需要部署一个单一的封装好的SWF(把剪辑绑定到SWF中)或需要把短小视频剪辑用于老版本Flash中。这种嵌入方式益处在于当你需要开发覆盖与交互功能的动画时它能让你看清你FLASH动画中每一个时间线上的动画帧。
Note: Embedded video is limited to 16,000 frames, and audio can quickly fall out of sync with the video. Also, the SWF’s frame rate must match the video frame rate,which can sometimes create headaches.嵌入式视频有16000帧限制,还有视频音频的同步难题。
Progressive Download
渐进式下载
This is most likely the method you’ll end up using in your application. It is the most commonly used, being compatible with Flash Player 6 and up. “Progressive” means that as the FLV file is downloaded to your computer, or “cached,” it starts to play. This method is most efficient for clips that are 5–90 seconds in length, but longer clips can be accommodated with well-planned caching. There is no limit to file size or duration, and there are no audio synchronization issues. Because the FLV file is external to the SWF shell, it is relatively easy to swap video content without republishing your SWF. This gives you great flexibility in developing dynamic video applications. The frame rate of the video can be different from the SWF, which is also invaluable when swapping videos, allowing you to accommodate files with differing frame rates into the same shell.
这种方式是我们应用最多的方式,可适用于Flash Player 6或以上。渐进(Progressive)表示当FLV视频文件被下载或缓存到我们的电脑,然后再播放。对5-90秒长度的视频很有效,如果更长时间的视频则需要适宜的缓存策略。这种方式没有文件大小与时长限制、没有音频同步问题。由于FLV文件在SWF播放程序外部,所以非常容易在不用重新发布我们的SWF而实现视频切换。
SWF播放的视频可以是不同的帧率,这往往在切换视频时非常有用,可以实现在同一播放程序中调节不同文件为不同帧率播放。
Progressive download isn’t the perfect solution, however. There are three issues that you’ll want to be aware of. First, viewers can’t seek ahead in the video beyond the portion that’s been downloaded, which can be a problem with large video files. Often your viewer wants to skip ahead to a part of the video or see if the content is something they want to watch. Second, when viewers do jump ahead in a fully downloaded video, they’re constrained to jumping between keyframes. This results in a “choppy” feel to the video, which can be undesirable. Finally, there’s the issue of digital rights management (DRM). The FLV file is actually downloaded to the viewer’s machine after it’s cached, and is stored on their hard drive. This can be a big problem if you’re delivering copyright-protected video. If this is an issue for you, you’ll be glad to know that we’ll talk about DRM in more detail later in this chapter.
然而渐进式下载并不是完美的方案。有三个问题你需要了解清楚。
第一,我们不能向前播放那些还没有被下载到我们电脑的那部分视频段,这对于大的视频文件就是个问题了。
第二,当观看者在下载完的视频中向前跳跃播放时,他们会被限制在关键帧间,这就造成视频的波动(闪动,如果没有点击到关键帧,会自动跳动关键帧开始播放?)感。
最后,数字版权管理问题,FLV文件缓存后实际已被下载到观看者的电脑里,被存放到电脑硬盘中。
Streaming
流式下载
If progressive download is the workhorse of Flash video delivery, streaming is the luxury model. Delivered through a streaming server such as Flash Media Server (FMS) and compatible with Flash Player 6 and up, this method features built-in bandwidth detection, high-quality playback, faster video start time, advanced logging and monitoring, and real-time data synchronization. With its persistent connection between the client and server, streaming allows on-the-fly changes to FLV content. For example, you could change to a lower-quality video if the viewer’s connection slows down during playback. Or with live video, you could switch camera angles based on user interaction. You can even use the persistent connection to send data along with the video, such as a chat room or synchronized slides controlled by a live presenter. Scrubbing is streamlined as well; you can smoothly jump ahead in a video without having to download the file to that point, and without the jerkiness of jumping to the nearest existing keyframe (as in progressive download); keyframes are created on the fly by FMS.
如果说渐进式下载是粗重的Flash视频传输模式的话,流式就是一种豪华模式。通过一个媒体服务器(如FMS)传输视频且兼容Flash Player 6或以上版本,这种方式的特点包括了带宽检测、高品质播放、更快的视频开启时间、高级的日志与监视功能,以及实时的数据同步。利用在客户端与服务端的持久性连接,流式传输允许在运行时改变FLV的内容,如可以在观看者在网速下降情况下播放视频时传输更低品质的视频。或者在实时视频中,我们可以基于不同的用户交互下切换摄像的视角。你还可以利用持久的连接在传输视频时发送一些数据,如聊天室或被展示者控制的同步的幻灯片。选段播放(Scrubbing)同样是高效的,你可以平滑向前跳跃到还未下载下来的视频点,不会有渐进式下载时因为跳跃到最近的已下载的关键帧而产生的闪动(jerkiness)现象,关键帧被FMS在运行时创建。
As with progressive download, the SWF acts as a shell containing the video content,
so updating does not require republishing the SWF. Streaming also saves on bandwidth and hardware resources; viewers only download the portion of the video they watch, and nothing is stored on their hard drive. This brings us to another pretty significant benefit—the video is never cached, providing more security for copyrighted content. Currently this is the extent of DRM offered by Flash video. So, if you don’t want your viewers to have a copy of your video somewhere on their hard drive after viewing, streaming is your answer (though we will show you some tricks to add extra barriers to downloading later in this chapter). If you have large quantities of stored video, very long video clips, or live video (such as live event broadcasts or webcam chat rooms), you’ll want to choose streaming. The downside to streaming, of course, is its significantly higher deployment cost. Programming for FMS is also complex, as is setting up your own FMS server. Luckily, there are options such as Flash Video Streaming Services (FVSS) that can help streamline the deployment process in many cases. We’ll cover your various deployment options
而且流式传输可以节省带宽与硬件资源,观看视频的人只要下载那些他们需要观看的视频部分,硬盘上不会存储视频的任何东西(版权管理有用)。
如果你有大量的视频、长时段的视频剪辑或实时视频(如实时广播和视频聊天),则可以利用流式传输。但视频部署成本很高,且在FMS上编程也较复杂。
三种视频传输方式的特点对比:
- 大小: 8.5 KB
分享到:
相关推荐
标题“邵铮:Puma与数据高速公路——实时数据流与分析”和描述“邵铮介绍了Facebook的分析工具和实时数据的使用案例,以及对于可扩展的数据流如何处理,Puma2和Puma3的结构及不同。”,围绕着Facebook的实时数据分析...
6. **视频播放列表**:Flash Player需要一个播放列表来知道何时播放下一个视频。在FLVHT中,这个播放列表通常以XML格式生成,包含每个视频的URL和其他元数据,由ASP动态生成并提供给Flash Player。 7. **安全性与...
通过Flash Communication Server 1.5,用户可以实现FLV格式视频的流式传输,进一步增强了视频的在线播放体验。 综上所述,FLV流媒体格式为在线视频播放提供了一种高效、便捷的解决方案。通过合理的配置和技术支持,...
Flash Video(FLV)是Flash平台专门设计的视频格式,它支持流式传输,能够实现视频的即时播放,无需等待整个文件下载完毕。FLV文件包含音频和视频数据,通过Flash Player插件在网页中播放,极大地提升了用户体验。 ...
下面我们将详细探讨JSP视频播放的原理、实现方式以及可能涉及的相关技术。 1. **视频播放原理**: 视频播放主要依赖于浏览器支持的视频标签 `<video>`,这个HTML5元素使得在网页上直接播放视频成为可能。通过设置`...
该项目是利用Python和Shell脚本编写的文件元数据与流式传输库源码,总计包含72个文件,涵盖27个Python脚本、17个Shell脚本、4个Markdown文档、4个配置文件、3个文本文件、2个PlantUML图和PNG图片、2个OPC文件,以及...
流式传输的实现需要缓存。因为Internet以包传输为基础进行断续的异步传输,对一个实时A/V源或存储的A/V文件,在传输中它们要被分解为许多包,由于网络是动态变化的,各个包选择的路由可能不尽相同,故到达客户端的...
### 大规模数据集的渐进式加载 #### 动机和优势探讨 **数据爆炸和处理挑战** 1. **背景介绍**:随着信息技术的飞速发展,数据量呈现出指数级的增长态势。这种大规模的数据集不仅给存储带来压力,同时也对处理和...
根据网络图形发展的需要,实现一种适用于网络流式传输...由于采用了渐进式编码方式及流技术,使应用这种算法后生成的模型文件可以高效、方便地以渐进方式在网络上传输。最后给出了相关结论数据以及算法实验结果的效果图。
单文件视频传输: 建立server和client之间的socket连接; 实现server端向client端发送视频文件; 实现client端接收server端发送的文件; 流式视频传输: 实现连续文件传输; 实现视频在线播放
如果视频内容存储在网络服务器上,那么应用需要使用URLSession来下载或者流式传输视频数据。AVPlayer能直接处理HTTP Live Streaming (HLS) 和 progressive download。 4. **本地视频播放**: 对于存储在设备上的...
- **模块5:对象和类** ——深入理解面向对象编程的核心概念,如类的设计、对象的创建与操作等。 - **模块6:高级语言特性** ——涉及更高级的语言特性和设计模式,提高编程效率和代码质量。 - **模块7:异常** ...
Adobe Flash File Video Format Specification v10.1 是一个关键的技术文档,它详细阐述了Adobe Flash平台下用于存储和传输视频的两种主要文件格式——FLV(Flash Video)和F4V(Flash MP4 Video)的规范。...
支持广泛的流式视频格式,支持FLV/MP4等格式的渐进式和流式下载播放,支持基于RTMP/RTMPT等流式协议的视频流播放,支持播放使用Apple公司HTTP Live Streaming协议传输的流式视频(M3U8),并可自适应切换码率。...
流式传输的两大主流种类及流式传输特点,过程与结果。
流式视频技术是互联网上广泛使用的一种媒体传输方式,它使得用户可以实时观看视频而无需等待整个文件下载完成。在本文中,我们将深入探讨流式视频服务器和客户机的实现,以及它们在互联网中的核心作用。 一、流式...
标题中的“行业分类-设备装置-用于将SVG内容嵌入进ISO基本媒体文件格式以便渐进地下载或流式传输富媒体内容的方法”揭示了这个技术主题的核心:它涉及到SVG(可缩放矢量图形)与ISO基本媒体文件格式的结合...
背景知识 • 安全背景、Dex格式、Dex指令编码 攻防演进 • 各代Dex壳的特点与弱点 虚拟化设计 • DexVmp设计、安全性 ...全新方式吸引了众多安全爱好者的目光,有助于大家的安卓防守和加固认知,达到新的水平。
这个"IOS实例开发源码——AVPlayer视频播放.zip"压缩包文件内包含了一个使用AVPlayer实现视频播放的示例项目,名为LGPlayer。通过分析这个项目,我们可以深入理解如何在iOS应用中集成视频播放功能。 首先,AVPlayer...