Codecs and containers

出自 Arch Linux 中文维基

自維基百科Wikipedia, "編解碼器(英語:codec)指的是一個能夠對一個信號或者一個數據流進行編解碼操作的設備或者程序。."

一般來說,編解碼器被多媒體應用程式用來對音頻或視頻流進行編碼或解碼。為了播放編碼後的數據流,用戶必須確保安裝了適當的編解碼器。

這篇文章只關於編解碼器及程式後端;見List of applications/Multimedia 以列舉音視頻播放器的選擇如(MPlayer, mpvVLC)

需求[編輯 | 編輯原始碼]

播放常見的媒體需要

  • 一個播放器
  • 一個編解碼器

如果有了媒體播放器,不一定非要安裝編解碼器。例如,MPlayer 就內置了大量編解碼器。

編解碼器列表[編輯 | 編輯原始碼]

音頻[編輯 | 編輯原始碼]

Wikipedia:Comparison of audio coding formats.

無損音頻編解碼器[編輯 | 編輯原始碼]

  • Apple Lossless (ALAC) — 由蘋果公司開發的無損音頻壓縮編解碼器,部署在其所有的平台和設備上。
https://alac.macosforge.org/ || alac-gitAUR
  • FLAC — 自由的音頻編解碼器
https://xiph.org/flac/ || flac
https://www.wavpack.com/ || wavpack

有損音頻編解碼器[編輯 | 編輯原始碼]

格式 編碼器 解碼器
AAC #AAC
ATSC A/52 aftenAUR a52dec
CELT celtAUR
MPEG-1   libmad
MP3 lame
Musepack (MPC) 1 libmpcdec
Opus opus
Vorbis libvorbis
語音編解碼器
AMR opencore-amr
Speex speex
  1. mppenc 沒有打包。
  • CELT — 開源、無專利的有損編解碼器, 特點是低延遲。
http://www.celt-codec.org/ || celtAUR
  • LAME — MP3 編碼器、可視化框架分析。
https://lame.sourceforge.io/ || lame
  • liba52 — 解碼 ATSC A/52 (Dolby Digital) 流(有損)的自由庫。
https://liba52.sourceforge.io/ || a52dec
  • libdca — 編碼 DTS 相干聲學流(DTS Coherent Acoustics streams)的自由庫。
https://www.videolan.org/developers/libdca.html || libdca
  • MAD — 高品質 MPEG 音頻解碼器。
https://www.underbit.com/products/mad/ || libmad
https://musepack.net/ || libmpcdec
  • opencore-amr — 自適應多速率(Adaptive Multi Rate,AMR)語音解碼器的開源實現。
https://sourceforge.net/projects/opencore-amr/ || opencore-amr
  • Opus — 開源無專利音頻編解碼器,為語音和通用音頻而設計,低延遲。
https://www.opus-codec.org/ || opus
  • Speex — 為語音設計的無專利有損音頻壓縮格式。
https://www.speex.org/ || speex
  • Vorbis — 開源無專利有損音頻編解碼器。
https://xiph.org/vorbis/ || libvorbis
AAC[編輯 | 編輯原始碼]

Wikipedia:

高級音頻編碼(Advanced Audio Coding,AAC)是為數字音頻壓縮而設計的專有音頻編碼格式。作為 MP3 格式的繼任者,AAC在相同採樣率下音質一般優於 MP3。
  • FAAC — 專有 AAC 音頻解碼器。
http://faac.sourceforge.net/ || faac
  • FAAD2 — ISO AAC 音頻解碼器。
http://faac.sourceforge.net/ || faad2
  • Fraunhofer FDK AAC — AAC 編碼器的 OpenCORE 框架實現。該庫經 Fraunhofer AAC 編解碼器修改而來。
https://sourceforge.net/projects/opencore-amr/ || libfdk-aac (codec library) fdkaac (CLI frontend for libfdk-aac)
  • Nero AAC — Nero AAC reference quality MPEG-4 and 3GPP audio codec. (deprecated)
https://www.nero.com/ || neroaac-binAUR

圖像編解碼器[編輯 | 編輯原始碼]

  • JasPer — 新興的 JPEG-2000 Part-1 標準編解碼器的軟體實現。
https://www.ece.uvic.ca/~frodo/jasper/ || jasper
  • OpenJPEG — 開源 JPEG 2000 編解碼器。
https://www.openjpeg.org/ || openjpegAUR
  • WebP — 適用於有損與無損壓縮的圖像格式服務。目前由 Google 開發。
https://developers.google.com/speed/webp/ || libwebp
https://github.com/AOMediaCodec/libavif || libavif
https://github.com/strukturag/libheif || libheif

視頻編解碼器[編輯 | 編輯原始碼]

另見 Wikipedia:Comparison of video codecs

格式 編解碼器庫
AV1 aom, dav1d (decode), rav1e (encode), svt-av1
AVS2 davs2AUR (decode)
Daala daala-gitAUR
Dirac schroedinger
DV libdv
H.265 x265, x265-hgAUR
libde265, libde265-gitAUR
H.264 x264, x264-gitAUR
MPEG-1 libmpeg2 (decode)
MPEG-2
MPEG-4 Xvid (xvidcore)
Theora libtheora
VP8, VP9 libvpx, libvpx-gitAUR
  • AV1 — AOMedia Video 1 (AV1) 是 Google's VP9、Mozilla's Daala、Cisco's Thor 編解碼器的繼任者。「aom」是編解碼器的參考實現, 「dav1d」是注重性能的編解碼器, 「rav1e」 是注重性能的解碼器。Most benchmark show better performances with svt-av1 than rav1e.
https://aomediacodec.github.io/av1-spec/ || aom, dav1d, rav1e, svt-av1
  • Daala — Research video codec under development by the Xiph.Org Foundation and sponsored by the Mozilla Foundation. The goal of the project is to provide a free to implement, use and distribute digital media format and reference implementation with technical performance superior to h.265.
https://www.xiph.org/daala/ || daala-gitAUR
  • libde265 — Open source implementation of the h.265 video codec.
https://github.com/strukturag/libde265 || libde265
  • libdv — The Quasar DV codec (libdv) is a software codec for DV video.
http://libdv.sourceforge.net/ || libdv
  • libmpeg2 — Library for decoding MPEG-1 and MPEG-2 video streams.
https://libmpeg2.sourceforge.io/ || libmpeg2
  • Schrödinger — Advanced royalty-free video compression format designed for a wide range of uses, from delivering low-resolution web content to broadcasting HD and beyond, to near-lossless studio editing.
https://launchpad.net/schroedinger/ || schroedinger
  • Theora — Open video codec developed by the Xiph.org.
https://www.theora.org/ || libtheora
  • VP9 — High-quality, open video format for the web that's freely available to everyone. Improved version of earlier VP8 codec.
https://www.webmproject.org || libvpx
  • x264 — Free library for encoding H264/AVC video streams.
https://www.videolan.org/developers/x264.html || x264
  • x265 — Open-source project and free application library for encoding video streams into the H.265/High Efficiency Video Coding (HEVC) format.
https://www.x265.org/ || x265
  • Xvid — Open source MPEG-4 video codec.
https://www.xvid.com/ || xvidcore

容器格式工具[編輯 | 編輯原始碼]

另見 Wikipedia:Comparison of video container formats

  • MKVToolNix — Set of tools to create, edit and inspect Matroska files.
https://mkvtoolnix.download/ || mkvtoolnix-cli, mkvtoolnix-gui
  • MP4Joiner — A collection of GUI tools to manipulate MP4 files (MP4Joiner, MP4Splitter).
https://www.mp4joiner.org/ || mp4joinerAUR
  • OGMtools — Information, extraction or creation for OGG media streams.
https://www.bunkus.org/videotools/ogmtools || ogmtools

後端[編輯 | 編輯原始碼]

GStreamer[編輯 | 編輯原始碼]

From https://gstreamer.freedesktop.org/:

GStreamer is a library for constructing graphs of media-handling components. The applications it supports range from simple Ogg/Vorbis playback, audio/video streaming to complex audio (mixing) and video (non-linear editing) processing.

Simply, GStreamer is a backend or framework utilized by many media applications. See GStreamer article.

xine[編輯 | 編輯原始碼]

From https://sourceforge.net/projects/xine/:

xine is a free multimedia player. It plays back CDs, DVDs, BluRays and VCDs. It also decodes multimedia files like AVI, MOV, WMV, and MP3 from local disk drives, and displays multimedia streamed over the Internet.

As an alternative to GStreamer, many media players can be configured to utilize the xine backend provided by xine-lib.

Note that the xine project itself provides a capable video player, xine-ui.

libavcodec[編輯 | 編輯原始碼]

libavcodec is part of the FFmpeg project. It includes a large number of video and audio codecs. The libavcodec codecs are included with media players such as MPlayer and VLC, so you may not need to install the ffmpeg package itself.

疑難解答[編輯 | 編輯原始碼]

No H264, mpg4 or Musepack (.mpc) in Totem Player[編輯 | 編輯原始碼]

If you see the "The H264 plugin is missing" warning with Totem media player, 安裝 gst-libav.

No H264 in Parole Player[編輯 | 編輯原始碼]

If you see the "Parole needs H.264 decoder to play this file" warning with Parole media player, 安裝 gst-libav.