Định dạng chứa (kỹ thuật số)
Định dạng chứa, Định dạng Contener, wrapper hay metafile là định dạng file cho phép nhúng nhiều luồng dữ liệu vào một file duy nhất, thường cùng với siêu dữ liệu để xác định và mô tả chi tiết hơn các luồng đó.[1] Các ví dụ đáng chú ý về định dạng container bao gồm file lưu trữ (chẳng hạn như định dạng ZIP) và các định dạng được sử dụng để phát lại đa phương tiện (chẳng hạn như Matroska, MP4 và AVI). Trong số các định dạng container đa nền tảng sớm nhất là Distinguished Encoding Rules và Interchange File Format.
Thiết kế
[sửa | sửa mã nguồn]
Mặc dù các container có thể xác định cách dữ liệu hoặc siêu dữ liệu được mã hóa, nhưng chúng không thực sự cung cấp hướng dẫn về cách giải mã dữ liệu đó. Một chương trình có thể mở một container cũng phải sử dụng một codec phù hợp để giải mã nội dung của nó. Nếu chương trình không có thuật toán cần thiết, nó không thể sử dụng dữ liệu được chứa. Trong những trường hợp này, các chương trình thường phát ra thông báo lỗi phàn nàn về việc thiếu codec, mà người dùng có thể có được.
Định dạng container có thể được tạo để bao bọc bất kỳ loại dữ liệu nào. Mặc dù có một số ví dụ về các định dạng tệp như vậy (ví dụ: tệp DLL của Microsoft Windows), nhưng hầu hết các định dạng container đều chuyên biệt cho các yêu cầu dữ liệu cụ thể. Ví dụ: vì luồng âm thanh và video có thể được mã hóa và giải mã bằng nhiều thuật toán khác nhau, nên định dạng container có thể được sử dụng để cung cấp giao diện của một định dạng file duy nhất cho người dùng phần mềm phát lại đa phương tiện.
Cân nhắc
[sửa | sửa mã nguồn]Sự khác biệt giữa các định dạng chứa khác nhau phát sinh từ năm vấn đề chính:
- Mức độ phổ biến; mức độ hỗ trợ rộng rãi của một chứa.
- Chi phí chung. Đây là sự khác biệt về kích thước tệp giữa hai tệp có cùng nội dung trong một chứa khác nhau.
- Hỗ trợ chức năng codec nâng cao. Các định dạng cũ hơn như AVI không hỗ trợ các tính năng codec mới như B-frame, âm thanh VBR hoặc video VFR gốc. Định dạng có thể được "hack" để thêm hỗ trợ, nhưng điều này tạo ra các vấn đề về khả năng tương thích.
- Hỗ trợ nội dung nâng cao, chẳng hạn như chương, phụ đề, thẻ meta, dữ liệu người dùng.
- Hỗ trợ phương tiện truyền phát trực tuyến.
Định dạng mã hóa đơn
[sửa | sửa mã nguồn]Ngoài các định dạng chứa thuần túy, chỉ xác định wrapper nhưng không phải mã hóa, một số định dạng tệp xác định cả lớp lưu trữ và mã hóa, như một phần của thiết kế mô-đun và khả năng tương thích hướng tới.
Ví dụ bao gồm JPEG File Interchange Format (JFIF), để chứa dữ liệu định dạng JPEG, và Portable Network Graphics (PNG).
Về nguyên tắc, mã hóa có thể được thay đổi trong khi lớp lưu trữ vẫn được giữ nguyên; ví dụ, Multiple-image Network Graphics (MNG) sử dụng định dạng chứa PNG nhưng cung cấp hoạt ảnh, trong khi JPEG Network Graphics (JNG) đặt dữ liệu được mã hóa JPEG vào một container PNG; tuy nhiên trong cả hai trường hợp, các định dạng khác nhau có các số ma thuật khác nhau - định dạng xác định mã hóa, mặc dù MNG có thể chứa cả hình ảnh được mã hóa PNG và hình ảnh được mã hóa JPEG.
Định dạng chứa đa phương tiện
[sửa | sửa mã nguồn]The container file is used to identify and interleave different data types. Simpler container formats can contain different types of audio formats, while more advanced container formats can support multiple audio and video streams, subtitles, chapter-information, and meta-data (tags) — along with the synchronization information needed to play back the various streams together. In most cases, the file header, most of the metadata and the synchro chunks are specified by the container format. For example, container formats exist for optimized, low-quality, internet video streaming which differs from high-quality Blu-ray streaming requirements.
Container format parts have various names: "chunks" as in RIFF and PNG, "atoms" in QuickTime/MP4, "packets" in MPEG-TS (from the communications term), and "segments" in JPEG. The main content of a chunk is called the "data" or "payload". Most container formats have chunks in sequence, each with a header, while TIFF instead stores offsets. Modular chunks make it easy to recover other chunks in case of file corruption or dropped frames or bit slip, while offsets result in framing errors in cases of bit slip.
Some containers are exclusive to audio:
- AIFF (IFF file format, widely used on the macOS platform)
- WAV (RIFF file format, widely used on Windows platform)
- XMF (Extensible Music Format)
Other containers are exclusive to still images:
- FITS (Flexible Image Transport System) still images, raw data, and associated metadata.
- TIFF (Tag Image File Format) still images and associated metadata.
- Macintosh PICT resource (PICT), superseded by PDF in Mac OS X
- Windows Metafile (WMF) = (EMF) Enhanced Metafile
- Encapsulated PostScript (EPS)
- Computer Graphics Metafile (CGM)
- Portable Document Format (PDF)
- Corel Draw File (CDR)
- Scalable Vector Graphics (SVG)
- Rich Text Format file (RTF)
Other flexible containers can hold many types of audio and video, as well as other media. The most popular multi-media containers are:[2][3]
- 3GP (used by many mobile phones; based on the ISO base media file format)
- ASF (container for Microsoft WMA and WMV, which today usually do not use a container)
- AVI (the standard Microsoft Windows container, also based on RIFF)
- DVR-MS ("Microsoft Digital Video Recording", proprietary video container format developed by Microsoft based on ASF)
- Flash Video (FLV, F4V) (container for video and audio from Adobe Systems)
- IFF (first platform-independent container format)
- Matroska (MKV) (not limited to any coding format, as it can hold virtually anything; it is an open standard container format)
- MJ2 - Motion JPEG 2000 file format, based on the ISO base media file format which is defined in MPEG-4 Part 12 and JPEG 2000 Part 12
- QuickTime File Format (standard QuickTime video container from Apple Inc.)
- MPEG program stream (standard container for MPEG-1 and MPEG-2 elementary streams on reasonably reliable media such as disks; used also on DVD-Video discs)
- MPEG-2 transport stream (a.k.a. MPEG-TS) (standard container for digital broadcasting and for transportation over unreliable media; used also on Blu-ray Disc video; typically contains multiple video and audio streams, and an electronic program guide)
- MP4 (standard audio and video container for the MPEG-4 multimedia portfolio, based on the ISO base media file format defined in MPEG-4 Part 12 and JPEG 2000 Part 12) which in turn was based on the QuickTime file format.
- Ogg (standard container for Xiph.org audio formats Vorbis and Opus and video format Theora)
- RM (RealMedia; standard container for RealVideo and RealAudio)
- WebM (subset of Matroska, used for web-based media distribution on online platforms; container for royalty-free audio formats Vorbis/Opus and video formats VP8/VP9/AV1)
There are many other container formats, such as NUT, MXF, GXF, ratDVD, SVI, VOB and DivX Media Format
Xem thêm
[sửa | sửa mã nguồn]Chú thích
[sửa | sửa mã nguồn]- ^ Ho, Anthony T. S.; Li, Shujun (ngày 20 tháng 5 năm 2016). Handbook of Digital Forensics of Multimedia Data and Devices, Enhanced E-Book. John Wiley & Sons. tr. 146–(?). ISBN 9781118757079. OCLC 953319457.
- ^ "What Are Container File Formats (Media Containers)?". Cloudinary. ngày 24 tháng 1 năm 2024. Truy cập ngày 22 tháng 8 năm 2024.
- ^ Trattnig, Armin (ngày 14 tháng 6 năm 2022). "The Definitive Guide to Container File Formats". Bitmovin. Truy cập ngày 22 tháng 8 năm 2024.
Liên kết ngoài
[sửa | sửa mã nguồn]- Online Video File Format Identification Tool - Designed primarily for CCTV video formats and codecs