Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบ >> Linux

ทำไมไฟล์เพลงและวิดีโอเล่นไม่ได้บน Linux และวิธีแก้

คุณสลับมา Linux พร้อมฟังเพลงดูวิดีโอ แต่ — โอ้ไม่ — ไฟล์เล่นไม่ได้!

ทำไมไฟล์เพลงและวิดีโอเล่นไม่ได้บน Linux และวิธีแก้

นี่คือ moment ที่ทำให้ new Linux users หลายคนประหลาด Windows และ Mac OS X เล่น media files out of the box โทรศัพท์และแท็บเล็ตก็เล่นได้ ทำไม Linux ไม่ได้?

อย่างง่าย distribution ของคุณไม่มาพร้อม codecs ที่จำเป็น ไม่ใช่ oversight มี legal และ ethical reasons ที่บาง projects ไม่ pre-install codecs พยายามทำให้เข้าใจง่าย แล้วค่อยดูว่าทำได้อะไร

Codecs คืออะไร?

Codec คือสิ่งบอกคอมพิวเตอร์ว่า decode หรือ encode data stream ยังไง relevant ทุกครั้งที่อยากดูวิดีโอ ไม่ว่าจะ locally หรือบนเว็บ เราอาจใช้ทั้งวัน list video codecs และการทำงาน แต่เรา cover ไปแล้ว

Codecs จำเป็นตอนเล่น audio รูปแบบเพลง common คือ MP3 (จำได้ไหม portable media players เรียกว่า MP3 players เห็นจะเล่น formats อื่นได้) Alternatives: AAC, WAV, Ogg Audio ไม่ซับซ้อนเท่าวิดีโอ แต่ยังต้องมีบางอย่างบอก music app ว่าเล่นไฟล์เหล่านี้ยังไง

โดยไม่มี codecs ที่จำเป็น คุณเล่น formats บางอย่างไม่ได้ และสร้างพวกมันไม่ได้

ทำไมไฟล์เพลงและวิดีโอเล่นไม่ได้บน Linux และวิธีแก้

หมายถึงแม้คุณบันทึก audio file สำหรับ podcast บน Linux ได้ง่าย คุณ save ใน popular formats บางอย่างไม่ได้จนกว่าจะได้ right software อาจฟังหรือดู downloads ของ favorite feeds ไม่ได้

聽起來 essential functionality โดยเฉพาะตอนนี้ ทำไม Linux distributions ไม่ ship ด้วย codecs?

Multimedia and the Law

Multimedia formats หลายอย่างมี patents ปกติไม่ affect users โดยตรง เพราะพวกเขา stream 什么他们想要在设备上拥有的东西 但专利持有者向制造这些产品的公司收取费用

Microsoft, Apple, Google, และ computer OEMs จ่าย royalties ขายคอมพิวเตอร์ที่เล่น encumbered multimedia formats ได้ นี่แพง Microsoft หยุด DVD playback บน Windows 8 ปี 2012 เพราะคิดว่าจ่าย royalty ต่อเครื่องที่รัน Windows 8 ไม่คุ้ม หลายเครื่อง ไม่ก็ส่วนใหญ่ ไม่มี disc drives

Linux distributors ไม่ขายผลิตภัณฑ์ ให้ software ฟรี และไม่จ่าย license ต่อ download Projects เหล่านี้ ship ได้แค่ free, non-restricted formats ตัวอย่าง: Ogg, Matroska, WebM

ติดตั้ง proprietary codecs ไมยาก แต่อาจ illegal ในประเทศคุณ Linux global reach บาง distributions ทำให้ restricted codecs ง่ายสำหรับใครก็ติดตั้ง Downside: คนอาจฝ่าฝืนกฎหมายโดยไม่รู้ Ubuntu user ใน US technically ไมควรเข้าถึง free versions ของ codecs นี้ แต่ distribution ไม่ทำให้ชัดเจน อย่างนั้น ไม่คาดว่าความคลุมเครือนี้จะทำให้คุณลำบากจริง

How to Install Codecs

บาง distributions ship codecs pre-installed ส่วนใหญ่ major ones ไม่ วิธีติดตั้ง codecs แตกต่างตาม distro ที่รัน แต่ใน most cases มี option ซื้อ codec pack

นี่คือสิ่งที่คาดหวังจาก several common distributions

Ubuntu

Ubuntu ไม่ให้ codecs out of the box แต่ allow users download MP3 codec จาก Fluendo ระหว่างติดตั้ง codec นี้ Fluendo ทำให้ใครก็ติดตั้งฟรีได้ legally เพราะ patent holders ไม่ charge end users

อื่นๆ ผ่าน Ubuntu Software Center เป็น restricted extras

ทำไมไฟล์เพลงและวิดีโอเล่นไม่ได้บน Linux และวิธีแก้

Fedora

Fedora ไม่ให้ proprietary codecs ไม่ว่าจะ pre-installed หรือใน repositories ส่วนหนึ่งจาก principled dedication ให้แค่ free software ส่วนหนึ่งเพราะ project sponsored by Red Hat US company subject to US law

ได้ non-free codecs โดยเพิ่ม unofficial RPM Fusion repository

OpenSUSE

เหมือนกัน fresh openSUSE install ทิ้งคุณกับ free codecs เท่านั้น Project ทำ extensive list ของ formats ที่ considered restricted

OpenSUSE 鼓励你买 codecs 但社区建议 alternative approach 不花钱

Arch Linux

作为 build-your-own distribution Arch Linux 不附带 codecs 一无所有 但项目在 repositories 包含 restricted formats 得到 codecs 当你安装 libraries needed 来播放它们

How to Avoid the Issue Entirely

ถ้าไม่อยากติดตั้ง codecs ติดตั้ง distribution ที่รวมมาพร้อม Linux Mint หนึ่งที่มุ่ง new users เล่น proprietary codecs out of the box Adobe Flash, MP3, และแม้ capability เล่น DVDs มา included (อีกอย่างที่แนะนำซื้อ) ผู้ที่อยาก Linux Mint แต่ไม่อยาก risk legal issues ดาวน์โหลด No Codecs version

Technically ไม่อยู่นอกป่ากว้างทั้งหมด เหมือน Windows และ Mac OS X อาจยังเจอ media format บ้างที่เครื่องยังไม่เข้าใจ list of codecs ที่มีอยู่ใหญ่โหด

ทำไมไฟล์เพลงและวิดีโอเล่นไม่ได้บน Linux และวิธีแก้

แต่โอกาสมากถ้าคุณโยน VLC ไปที่ video คุณน่าจะได้มันทำงาน MPlayer เป็น media player อีกตัวเล่นได้ almost anything

Easy Listening, and Keep Watching

Linux อาจไม่ทำ codecs ให้ทันที แต่ติดตั้งแล้วคุณ good to go หลายโปรแกรมใช้ same libraries ใน backend เช่น GStreamer หรือ Xine คุณควร fire up various music และ video players โดยไม่ต้อง configure แต่ละตัว และในพื้นที่นี้มีเยอะให้เลือก

ดังนั้น despite initial setup คุณยังใช้ Linux computer manage music library, edit home videos, และดูหนังโปรดได้ อย่าให้ initial errors ดับ expectations คุณอาจพบ experience ดีกว่าที่ทิ้งไว้ (อีกครั้ง free music players เยอะให้ลอง)

กำลัง掙扎让某些音频或视频文件在 Linux 下播放? 在您的发行版上让编解码器工作很困难? 在下面的评论中寻求帮助或分享您的经验!

Image Credit: Angry Penguin by Wnong via Shutterstock, Audio and Video File Format Icons. 15 common digital audio and video file formats isolated on white.