视频文件更准确的描述为“容器”。这是因为它们不仅可包含视频本身,还可包含其他轨道,包括音频、字幕和其他视频素材。而且,容器中每种类型的轨道也可以有多个,例如:
多个视点
立体声或 5.1 版本的混音
不同语言的字幕
不同语言的对话
为了节省带宽和存储空间,每个轨道的内容都使用“编解码器”进行编码;该编解码器可根据需要压缩和解压缩数据。
常见的视频编解码格式为 H.264,而常见的音频编解码格式为 AAC。
文件扩展名(如 .mp4、.mov、.webm 或 .avi)表示视频文件中的数据是使用某种容器格式排列的。
大多数现代设备都有专用于解码视频的硬件。与 CPU 之类的部件相比,该硬件通常在执行该任务时所需的性能更少,这意味着还可将资源用于除解码视频之外的其他任务。
这种硬件加速可通过本机自定义 API 实现,这些 API 因平台而异。Unity 的视频架构通过提供通用 UI 和脚本 API 来访问这些功能,从而隐藏了这些差异。
Unity 还能够进行基于软件的视频解码。此软件解码方案使用 VP8 视频编解码器和 Vorbis 音频编解码器,如果平台的硬件解码方式在分辨率、多个音频轨道或 Alpha 通道支持方面会带来不必要的限制,则软件解码将非常有用(有关更多信息,请参阅透明度文档)。
2017–06–15 页面已发布
Unity 5.6 中的新功能
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.