Web多媒体:编解码器和容器
In my experience, many web developers have a poor understanding of digital video technologies; as a result, the file size of the video they produce tends to be huge, and completely inappropriate for the web. Thus, my attempt at a guide.
以我的經驗,許多Web開發人員對數字視頻技術了解甚少。 結果,他們制作的視頻的文件大小往往很大,并且完全不適合網絡使用。 因此,我嘗試進行指導。
In general, people trying to optimize video suffer from the same ignorance as those trying to optimize bitmap images: they do not understand appropriate format and compression. In video this is complicated by a common confusion between codec and container.
通常,嘗試優化視頻的人們與試圖優化位圖圖像的人們一樣無知:他們不了解適當的格式和壓縮方式。 在視頻中, 編解碼器和容器之間的常見混淆使情況變得復雜。
編解碼器 (codec)
A codec (for compressor-decompressor) is the algorithm used to lower file size. JPEG is a codec that is primarily used for still images; the MPEG codec is the equivalent for video.
編解碼器 (用于壓縮器/解壓縮器)是用于減小文件大小的算法。 JPEG是主要用于靜止圖像的編解碼器。 MPEG編解碼器與視頻等效。
Some typical video codecs include:
一些典型的視頻編解碼器包括:
| MPEG-1 | 1993 | One of the oldest video standards, released in 1993 and now widely deployed. Its goal was to enable video playback from CD’s. Relatively low visual quality coupled with high file sizes meant that video standards quickly moved to MPEG 2. Layer 3 of the MPEG 1 codec is the basis for the popular .mp3 audio format | Video CD, SVCD, some low-quality DVD. |
| MPEG-2 | 1995 | The world’s most popular codec, in terms of market penetration: every commercial DVD-video uses MPEG-2, as do most commercial digital cable and OTA television stations. | DVD, television. Some web video. |
| MPEG-4 | 1998 | Significantly improved and more efficient codec. Actually contains two families of codecs (MPEG-4 Part 2 and MPEG-4 AVC / H.264. MPEG-4 Part 2 codecs include: DivX, Xvid, FFmpeg MPEG-4 and 3ivx. H.264 includes the eponymous codec, as well as x264 (an open-source encoder-only version of H.264), Divx Pro and Apple’s implementation of H.264. | Blu-Ray and HD-DVD; some web video. |
| WMV | 1999 | Windows Media Video. Comes in several versions (WMV 7 – 9). WMV9 is standardized as the VC-1 codec. | Windows Media Files, limited use in Blu-Ray and HD-DVD |
| VP6 ~ VP8 | 2003 | Proprietary codec by On2 Technologies; the most recent version (VP8) has been open-sourced by Google. | Limited use in web video. |
| Sorenson 3 | 2001 | A codec made popular by its association with QuickTime; essentially the ancestor to H.264. | Web video, particularly movie trailers, but now superseded by H.264 |
| MPEG-1 | 1993年 | 最古老的視頻標準之一,于1993年發布,現已廣泛部署。 其目標是啟用CD的視頻播放。 相對較低的視覺質量以及較高的文件大小,意味著視頻標準Swift轉向了MPEG2。MPEG1編解碼器的第3層是流行的.mp3音頻格式的基礎 | 視頻CD,SVCD和一些低質量的DVD。 |
| MPEG-2 | 1995年 | 就市場滲透率而言,這是世界上最受歡迎的編解碼器:每個商業DVD視頻都使用MPEG-2,大多數商業數字有線電視和OTA電視臺也是如此。 | DVD,電視。 一些網絡視頻。 |
| MPEG-4 | 1998年 | 顯著改進和更有效的編解碼器。 實際上包含兩個編解碼器系列(MPEG-4第2部分和MPEG-4 AVC / H.264。 MPEG-4第2部分編解碼器包括:DivX,Xvid,FFmpeg MPEG-4和3ivx。 H.264包括同名的編解碼器,以及x264(H.264的僅開源編碼器版本),Divx Pro和Apple的H.264實施。 | 藍光和高清DVD; 一些網絡視頻。 |
| WMV | 1999年 | Windows Media視頻。 有幾種版本(WMV 7 – 9)。 WMV9被標準化為VC-1編解碼器。 | Windows Media文件,僅限在Blu-Ray和HD-DVD中使用 |
| VP6?VP8 | 2003年 | On2 Technologies的專有編解碼器; 最新版本(VP8)已由Google開源。 | 網絡視頻使用有限。 |
| 索倫森3 | 2001 | 通過與QuickTime結合而流行的編解碼器; 本質上是H.264的始祖。 | 網絡視頻,特別是電影預告片,但現在已被H.264取代 |
Generally speaking the more recent the codec the better the compression, bandwidth use and image quality, and thus the smaller the file size; H.264 is better than MPEG-2 on almost all counts. On the other hand, older codecs tend to have a wider range of support: almost every piece of digital AV equipment made in the last fifteen years understands MPEG2; fewer understand H.264. As always, choices are a tradeoff between ubiquity and efficiency.
一般來說,編解碼器越新,壓縮,帶寬使用和圖像質量越好,因此文件大小越小; 在幾乎所有方面,H.264都比MPEG-2更好。 另一方面,較舊的編解碼器往往具有更廣泛的支持:在過去的15年中,幾乎所有的數字AV設備都可以理解MPEG2;而在過去的15年中,幾乎所有的數字AV設備都可以理解MPEG2。 很少了解H.264。 與往常一樣,選擇是普遍存在和效率之間的權衡。
容器 (container)
A container is a “wrapper” format around encoded media. A container format, in and of itself, does not say anything about the type of media inside of it, or the codec used to compress that media, although there may be strong associations between certain codecs and containers.
容器是圍繞編碼媒體的“包裝”格式。 一種容器格式,和其本身的,并沒有說明用于壓縮該介質,雖然可能有一定的編解碼器和容器之間的強關聯的它的內部介質類型,或編解碼器什么 。
Some examples of containers used for video are: Quicktime (.mov), Windows Media Video (.wmv), Audio Video Interleave (.avi), Real Media (.rm), Matroska (.mkv) and Flash Video (.flv or .f4v).
用于視頻的容器的一些示例包括:Quicktime( .mov ),Windows Media Video( .wmv ),Audio Video Interleave( .avi ),Real Media( .rm ),Matroska( .mkv )和Flash Video( .flv或.f4v )。
Again, it is very important to distinguish between container and codec. The codec is the method with which media is encoded; the container is the wrapper around the content. The container format often implies that a particular application should be used for playing back the content (QuickTime for .mov, Flash Player for .flv, etc).
同樣,區分容器和編解碼器非常重要。 編解碼器是對媒體進行編碼的方法。 容器是內容的包裝。 容器格式通常意味著應使用特定的應用程序來播放內容( .mov的 QuickTime, .flv的 Flash Player等)。
One reason that many people get confused between containers and codecs is that either may be used as the suffix of a file. For example, test-movie.mov is a container file that could contain anything at all; test.mp4 is a video file encoded in H.264 MPEG-4.
許多人在容器和編解碼器之間感到困惑的原因之一是,兩者都可以用作文件的后綴。 例如, test-movie.mov是一個容器文件,可以包含所有內容。 test.mp4是以H.264 MPEG-4編碼的視頻文件。
翻譯自: https://thenewcode.com/104/Web-Multimedia-codecs-and-containers
總結
以上是生活随笔為你收集整理的Web多媒体:编解码器和容器的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 工作288:跨组件传值
- 下一篇: [css] 举例说明backgroun