QUOTE
"Linux" generally refers to an open-source Unix-clone operating system based on the Linux kernel, written from scratch originally by Linus Torvalds and other smart people from across the web. Although the linux kernel, which interfaces with a computer's hardware, is the core of the operating system, many other programs are needed to form a complete operating system.
Various commercial and non-commercial groups produce Linux-based operating systems containing the kernel, all necessary programs, and an installer. These different versions of linux are referred to as distributions.
There are hundreds of distributions available, with hundreds of different target applications and philosophies on software. There is also much more information available about getting started with linux/unix than is within the scope of this AV faq. Some excellent places to get started learning about distributions are www.distrowatch.com , www.linuxquestions.org , and www.linuxiso.org .
2. I've heard that linux is a very technical operating system. Will it be too difficult for me?
With many of the modern user-friendly distributions, such as Mandrake or Fedora, a great deal of technical knowledge is not needed to install and use software. Good sites to find general guides and answer your questions:
http://www.linuxquestions.org (Great community forums, newbie-friendly)
http://www.tldp.org (extremely in-depth HOW-TOs and FAQs)
http://www.linux-tutorial.info
http://www.linuxsurvival.com
Whenever you hit a problem, you should first check any available documentation for the software involved and search the forums here and some of the sites mentioned above. Linux software in general is quite well documented, most programs include manuals or 'man-pages' which can be accessed as follows:
Code:
man commandname
For Example
man mplayer displays the manpage for mplayerAlso take a look in /usr/doc/ for readmes and other included documentation.
Note: Keeping with common bash nomenclature, in all parts of this FAQ, a command preceded by a '$' prompt indicates that the command should be run from a terminal as a user, and a '#' prompt indicating the command should be run as root.
3. Can I keep windows on my computer and still use linux?
Virtually all modern linux distributions are windows-aware and will detect your windows partition and allow you to dual-boot your PC (meaning you will see a menu when you turn on your PC to choose linux or windows). Linux installers will install a 'bootloader' (a pre-OS software that allows you to boot different operating systems) as part of the installation process. You'll need to install windows first and then linux in order to dual-boot since windows' bootloader will overwrite the bootloader that allows you to dual-boot.
4. What about installing software under linux?
Although this FAQ is not meant to be a guide to using linux, much of the questions we discuss will require new software, so we will quickly reference the three major ways of installing software:
Package distribution: Virtually all linux distributions use some soft of package system, such as RPM (Redhat & many others), DEB (Debian), or TGZ (Slackware). A packaging system is meant to be an easy way of installing software, similar to windows installers. A package file consists of the compiled software and files required, and a script to tell the package managing software how and where to install the files. Most distributions have both command-line and GUI interfaces to their packaging system. Check the documentation for your distribution for how to install packaged software. To install from commandline for the most common package formats:
Code:
rpm: # rpm -i packagename.rpm (see 'man rpm' for more help)
DEB (debian): # apt-get install packagename (see 'man apt-get')
Slackware TGZ: # installpkg packagename.tgz (see 'man installpkg', 'man pkgtool')
Gentoo (portage): # emerge packagename (see 'man emerge')Binary archives: Some software is distributed pre-compiled in binary packages, common extensions are .tar.gz or .tar.bz2. To install such software, simply extract the archive:
tar xvjf name.tar.bz2 or
tar xvzf name.tar.gz
and move the contents of the archive to your desired location. If the software is required to be in a specific location, check the documentation for the software.
Source distributions: Much of the software we will be using for AV conversions is distributed in source form, in which you download the source code for a program and compile it yourself. To compile software, you will need to install the development software included with your distribution (such as gcc, g++, make, autoconf, libtool, etc. - different software requires different tools). Then simply untar the source archive in whatever directory you prefer to keep your source code (a common choice is /usr/local/src). Instructions for building the source code are included normally in the root of the archive in the INSTALL file, but the most common method of compiling is a three command method, executed from the root of the source directory:
./configure (checks for the required software and headers)
make (builds and links the software)
make install (copies the compiled software and libraries to the appropriate directory)
If any of the steps failed, check the error message, it will usually tell you what is missing or what went wrong. To perform the final step, you will most likely need to be root (su command).
Do I need to do any extra setup for audio / video output?
Since we already assumed you have an up and running linux installation, you most likely won't have to do any work in this area. Most modern distributions automatically configure X and audio for you, and there is a host of information on the web for configuring X.
As far as audio goes, there are many different audio architectures available. We recommend choosing a distribution that uses ALSA (the advanced linux sound architecture) by default since it is the most powerful sound system and supports the most hardware. If your distribution doesn't include it, check out Q19 of the AC3 FAQ or this gentoo ALSA guide.
2. What is a good audio/video player for linux?
There are many excellent AV players available for linux, the three most popular are mplayer, videolan's VLC, and xine. Binary packages of these players are included in most distributions.
Since mplayer is one of the most versastile players, includes mencoder, one of the best transcoding softwares, and is one of the easiest players to build from source, we'll mention how to install mplayer here:
1.) Install any applicable libraries/codecs you want to use with mplayer first. For basic operation you'll probably want libavcodec, xvid, and some win32 binary codecs (for formats without open source libraries). Download one of the binary codec packs from the mplayer homepage (for example extralite.tar.gz) and extract it to /usr/local/lib/codecs/. If you're compiling from CVS (recommended) make sure to check out the libavcodec source for copying into the mplayer source directory:
Code:
$ cvs -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co ffmpeg/libavcodecFor more information on the involved software see http://mplayerhq.hu/DOCS/HTML/en/install.html and http://mplayerhq.hu/DOCS/HTML/en/codecs.html#ffmpeg .
2.) Download mplayer source code from http://www.mplayerhq.hu/homepage/design7/dload.html . The recommended version is always the latest CVS (mplayer-current.tar.bz2) Although binary packages from mplayer are available for many systems, it is usually better to compile from source since mplayer will be optimized for your processor, and the installation will detect what codec and AV output libraries are present on your system. Unpack the tarball in your directory of choice:
Code:
$ tar xvjf mplayer-current.tar.bz2Or if you want to use CVS for quicker future updates:
Code:
$ cvs -d:pserver:anonymous@mplayerhq.hu:/cvsroot/mplayer co mainDon't forget to copy the libavcodec directory we checked out earlier into the 'main' directory.
3.) Configure mplayer by running ./configure from the root of the mplayer directory. './configure --help' will show you some configuration options, and you may want to add support for the GUI and for large files:
Code:
$ ./configure --enable-gui --enable-largefilesAfter running this script will tell you which codecs and output libraries have been detected, check through the list to make sure everything you need has been detected. You can then build and install mplayer and mencoder:
Code:
$ make
# make install4.) Be sure to read over the mplayer manpage ( I know it's enormous) to become familiar with its control. You can add options to the mplayer config file (default /usr/local/etc/mplayer/mplayer.conf) rather than specifying them on the commandline. My mplayer.conf looks like this: (specify dvd drive location, alsa audio driver, and try S/PDIF output before others)
Code:
ao=alsa
dvd-device=/dev/hdc
ac=hwac3,In order to run the GUI you'll need to put a skin in '/usr/local/share/mplayer/Skin/default' (download & install a skin from the homepage, unpack, and rename the folder to 'default') and a default sub font in '~/.mplayer/subfont.ttf'.
Now you should be set to play with mplayer and encode with mencoder. You can find lots more information on all these topics in the mplayer documentation ( http://mplayerhq.hu/DOCS/HTML/en/ ) and the mplayer manpage ('man mplayer').
3. What about a good audio player for linux?
Two good winamp-like players for linux are XMMS and beep-media-player (a fork of XMMS with an updated interface). One or both of these is included with many distributions.
Like winamp there are a host of input and output plugins available for XMMS. You can get the source for these at the xmms homepage or from your distribution's repositories (in the case of gentoo, debian, or other distros with vast repositories).
A newer audio player that is gaining much popularity is amaroK. amaroK features a gstreamer interface, an advanced media library, highly configurable interface, cover art downloading plugin, and much more.
Please note that some distros such as Redhat/Fedora do not include an mp3 decoder with XMMS due to legal reasons. In this case you need to install an mp3 plugin, check out rpm.livna.org for RPMs of this and other packages omitted from the Fedora/Red Hat distribution.
4. What options do I have for playing DVDs under linux?
Many distributions include some sort of DVD capable player in their main repository. Please note that as with MP3, some distributions do not include CSS-decrypting capable players due to legal reasons. As above rpms can be found at rpm.livna.org, or you can install your own player.
A full mplayer install as noted above will be dvd-capable (although mplayer does not support menues at this time) and you can play dvds through the GUI or by the command
Code:
mplayer dvd://1 -dvd-device /dev/hdcIn this example the dvd device is /dev/hdc, you'll need to specify the device via CLI or config file unless the device is the mplayer default /dev/dvd.
Videolan's VLC is another good choice for dvd playback, you can find binaries on their homepage or source install instructions here.
Two other common DVD players are xine and ogle.
4B. How can I playback an ISO image of a DVD on my hard drive?
You can easily mount the iso and then play it back as if it is a mounted DVD disc, for example:
Code:
# mkdir /mnt/dvd_image
creates the mountpoint directory
# mount -o loop -t udf /path/to/image.iso /mnt/dvd_image
mounts the ISO image /path/to/image.iso on the /mnt/dvd_image directory
$ mplayer dvd://1 -dvd-device /mnt/dvd_image
Plays the mounted image with mplayer
$ vlc --dvd /mnt/dvd_image
Plays the mounted image with VLC5. How can I playback audio in multichannel or over S/PDIF?
For S/PDIF, you'll first need to set up the appropriate ALSA settings by running alsamixer (assuming your distro uses ALSA, see Q1 above) and unmuting the S/PDIF output. PCM audio will automatically be played over s/pdif, to play passthrough DTS or AC3 you'll need to specify this setting in the player. In mplayer this is done with the '-ac hwac3' or '-ac hwdts' switches, in VLC the settings can be found in the audio section of the preferences.
For analog multichannel you'll again need to set up the appropriate outputs in alsamixer and you can then specify '-channels 6' in mplayer.
6. How can I play video content over my tv-out in linux?
You'll first want to configure X to run your Tv-out as a second xineramascreen (dual head configuration). There are many guides on the internet for this configuration based on different video card manufacturers, see this LQ wiki page for some starter information. After this is set up you can specify the xineramascreen for playback in mplayer via the '-xineramascreen #' switch or in vlc by the '--x11-xineramascreen #' switch.
Virtualdub and VFW codecs for windows are great. Is there anything like this for linux?
avidemux2 is an advanced native linux video editing and encoding tool with a GUI interface very similar to virtualdub's. It supports many video codecs and output formats. Unlike virtualdub for windows it is more difficult for codecs to be supported in avidemux, however since it is not VFW based it is free to be much more versatile as far as output formats and advanced video codecs. avidemux supports more codecs and formats with every release and is a great application to get started with encoding video under linux.
Some people have successfully gotten virtualdub working under wine; however, keep in mind that virtually all of virtualdub's tools (aside from proprietary codecs) can be used in native linux apps.
2. What native tools are available for general purpose encoding?
GUI (graphical interface) Tools
avidemux2: easy virtualdub-like interface, many filters, codecs, and formats are supported.
dvd::rip: A GUI frontend to transcode, built-in DVD ripper, supports many different codecs and output formats.
acidrip: a DVD encodeing frontend based on mplayer/mencoder.
drip: A DVD to DIVX conversion application, supports MSMPEG4, OpenDivx, XviD for video, MP3 audio, has problems with some NTSC DVDs.
CLI (command-line interface) Tools
mencoder: The encoding application paired with mplayer, supports a vast amount of input formats, processing filters, and output codecs, although output container formats are currently limited to AVI and MPEG output format. See here for a tutorial on the command line interface.
transcode: a suite of CLI utilities for transcoding video and audio based on a modular structure. Supports many codecs and containers. See the wiki for command line help.
ffmpeg: a complete recording, converting and streaming solution, based on libavcodec/libavformat. Supports most of the codecs supported by mplayer as well as a few more container options
Various commercial and non-commercial groups produce Linux-based operating systems containing the kernel, all necessary programs, and an installer. These different versions of linux are referred to as distributions.
There are hundreds of distributions available, with hundreds of different target applications and philosophies on software. There is also much more information available about getting started with linux/unix than is within the scope of this AV faq. Some excellent places to get started learning about distributions are www.distrowatch.com , www.linuxquestions.org , and www.linuxiso.org .
2. I've heard that linux is a very technical operating system. Will it be too difficult for me?
With many of the modern user-friendly distributions, such as Mandrake or Fedora, a great deal of technical knowledge is not needed to install and use software. Good sites to find general guides and answer your questions:
http://www.linuxquestions.org (Great community forums, newbie-friendly)
http://www.tldp.org (extremely in-depth HOW-TOs and FAQs)
http://www.linux-tutorial.info
http://www.linuxsurvival.com
Whenever you hit a problem, you should first check any available documentation for the software involved and search the forums here and some of the sites mentioned above. Linux software in general is quite well documented, most programs include manuals or 'man-pages' which can be accessed as follows:
Code:
man commandname
For Example
man mplayer displays the manpage for mplayerAlso take a look in /usr/doc/ for readmes and other included documentation.
Note: Keeping with common bash nomenclature, in all parts of this FAQ, a command preceded by a '$' prompt indicates that the command should be run from a terminal as a user, and a '#' prompt indicating the command should be run as root.
3. Can I keep windows on my computer and still use linux?
Virtually all modern linux distributions are windows-aware and will detect your windows partition and allow you to dual-boot your PC (meaning you will see a menu when you turn on your PC to choose linux or windows). Linux installers will install a 'bootloader' (a pre-OS software that allows you to boot different operating systems) as part of the installation process. You'll need to install windows first and then linux in order to dual-boot since windows' bootloader will overwrite the bootloader that allows you to dual-boot.
4. What about installing software under linux?
Although this FAQ is not meant to be a guide to using linux, much of the questions we discuss will require new software, so we will quickly reference the three major ways of installing software:
Package distribution: Virtually all linux distributions use some soft of package system, such as RPM (Redhat & many others), DEB (Debian), or TGZ (Slackware). A packaging system is meant to be an easy way of installing software, similar to windows installers. A package file consists of the compiled software and files required, and a script to tell the package managing software how and where to install the files. Most distributions have both command-line and GUI interfaces to their packaging system. Check the documentation for your distribution for how to install packaged software. To install from commandline for the most common package formats:
Code:
rpm: # rpm -i packagename.rpm (see 'man rpm' for more help)
DEB (debian): # apt-get install packagename (see 'man apt-get')
Slackware TGZ: # installpkg packagename.tgz (see 'man installpkg', 'man pkgtool')
Gentoo (portage): # emerge packagename (see 'man emerge')Binary archives: Some software is distributed pre-compiled in binary packages, common extensions are .tar.gz or .tar.bz2. To install such software, simply extract the archive:
tar xvjf name.tar.bz2 or
tar xvzf name.tar.gz
and move the contents of the archive to your desired location. If the software is required to be in a specific location, check the documentation for the software.
Source distributions: Much of the software we will be using for AV conversions is distributed in source form, in which you download the source code for a program and compile it yourself. To compile software, you will need to install the development software included with your distribution (such as gcc, g++, make, autoconf, libtool, etc. - different software requires different tools). Then simply untar the source archive in whatever directory you prefer to keep your source code (a common choice is /usr/local/src). Instructions for building the source code are included normally in the root of the archive in the INSTALL file, but the most common method of compiling is a three command method, executed from the root of the source directory:
./configure (checks for the required software and headers)
make (builds and links the software)
make install (copies the compiled software and libraries to the appropriate directory)
If any of the steps failed, check the error message, it will usually tell you what is missing or what went wrong. To perform the final step, you will most likely need to be root (su command).
Do I need to do any extra setup for audio / video output?
Since we already assumed you have an up and running linux installation, you most likely won't have to do any work in this area. Most modern distributions automatically configure X and audio for you, and there is a host of information on the web for configuring X.
As far as audio goes, there are many different audio architectures available. We recommend choosing a distribution that uses ALSA (the advanced linux sound architecture) by default since it is the most powerful sound system and supports the most hardware. If your distribution doesn't include it, check out Q19 of the AC3 FAQ or this gentoo ALSA guide.
2. What is a good audio/video player for linux?
There are many excellent AV players available for linux, the three most popular are mplayer, videolan's VLC, and xine. Binary packages of these players are included in most distributions.
Since mplayer is one of the most versastile players, includes mencoder, one of the best transcoding softwares, and is one of the easiest players to build from source, we'll mention how to install mplayer here:
1.) Install any applicable libraries/codecs you want to use with mplayer first. For basic operation you'll probably want libavcodec, xvid, and some win32 binary codecs (for formats without open source libraries). Download one of the binary codec packs from the mplayer homepage (for example extralite.tar.gz) and extract it to /usr/local/lib/codecs/. If you're compiling from CVS (recommended) make sure to check out the libavcodec source for copying into the mplayer source directory:
Code:
$ cvs -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co ffmpeg/libavcodecFor more information on the involved software see http://mplayerhq.hu/DOCS/HTML/en/install.html and http://mplayerhq.hu/DOCS/HTML/en/codecs.html#ffmpeg .
2.) Download mplayer source code from http://www.mplayerhq.hu/homepage/design7/dload.html . The recommended version is always the latest CVS (mplayer-current.tar.bz2) Although binary packages from mplayer are available for many systems, it is usually better to compile from source since mplayer will be optimized for your processor, and the installation will detect what codec and AV output libraries are present on your system. Unpack the tarball in your directory of choice:
Code:
$ tar xvjf mplayer-current.tar.bz2Or if you want to use CVS for quicker future updates:
Code:
$ cvs -d:pserver:anonymous@mplayerhq.hu:/cvsroot/mplayer co mainDon't forget to copy the libavcodec directory we checked out earlier into the 'main' directory.
3.) Configure mplayer by running ./configure from the root of the mplayer directory. './configure --help' will show you some configuration options, and you may want to add support for the GUI and for large files:
Code:
$ ./configure --enable-gui --enable-largefilesAfter running this script will tell you which codecs and output libraries have been detected, check through the list to make sure everything you need has been detected. You can then build and install mplayer and mencoder:
Code:
$ make
# make install4.) Be sure to read over the mplayer manpage ( I know it's enormous) to become familiar with its control. You can add options to the mplayer config file (default /usr/local/etc/mplayer/mplayer.conf) rather than specifying them on the commandline. My mplayer.conf looks like this: (specify dvd drive location, alsa audio driver, and try S/PDIF output before others)
Code:
ao=alsa
dvd-device=/dev/hdc
ac=hwac3,In order to run the GUI you'll need to put a skin in '/usr/local/share/mplayer/Skin/default' (download & install a skin from the homepage, unpack, and rename the folder to 'default') and a default sub font in '~/.mplayer/subfont.ttf'.
Now you should be set to play with mplayer and encode with mencoder. You can find lots more information on all these topics in the mplayer documentation ( http://mplayerhq.hu/DOCS/HTML/en/ ) and the mplayer manpage ('man mplayer').
3. What about a good audio player for linux?
Two good winamp-like players for linux are XMMS and beep-media-player (a fork of XMMS with an updated interface). One or both of these is included with many distributions.
Like winamp there are a host of input and output plugins available for XMMS. You can get the source for these at the xmms homepage or from your distribution's repositories (in the case of gentoo, debian, or other distros with vast repositories).
A newer audio player that is gaining much popularity is amaroK. amaroK features a gstreamer interface, an advanced media library, highly configurable interface, cover art downloading plugin, and much more.
Please note that some distros such as Redhat/Fedora do not include an mp3 decoder with XMMS due to legal reasons. In this case you need to install an mp3 plugin, check out rpm.livna.org for RPMs of this and other packages omitted from the Fedora/Red Hat distribution.
4. What options do I have for playing DVDs under linux?
Many distributions include some sort of DVD capable player in their main repository. Please note that as with MP3, some distributions do not include CSS-decrypting capable players due to legal reasons. As above rpms can be found at rpm.livna.org, or you can install your own player.
A full mplayer install as noted above will be dvd-capable (although mplayer does not support menues at this time) and you can play dvds through the GUI or by the command
Code:
mplayer dvd://1 -dvd-device /dev/hdcIn this example the dvd device is /dev/hdc, you'll need to specify the device via CLI or config file unless the device is the mplayer default /dev/dvd.
Videolan's VLC is another good choice for dvd playback, you can find binaries on their homepage or source install instructions here.
Two other common DVD players are xine and ogle.
4B. How can I playback an ISO image of a DVD on my hard drive?
You can easily mount the iso and then play it back as if it is a mounted DVD disc, for example:
Code:
# mkdir /mnt/dvd_image
creates the mountpoint directory
# mount -o loop -t udf /path/to/image.iso /mnt/dvd_image
mounts the ISO image /path/to/image.iso on the /mnt/dvd_image directory
$ mplayer dvd://1 -dvd-device /mnt/dvd_image
Plays the mounted image with mplayer
$ vlc --dvd /mnt/dvd_image
Plays the mounted image with VLC5. How can I playback audio in multichannel or over S/PDIF?
For S/PDIF, you'll first need to set up the appropriate ALSA settings by running alsamixer (assuming your distro uses ALSA, see Q1 above) and unmuting the S/PDIF output. PCM audio will automatically be played over s/pdif, to play passthrough DTS or AC3 you'll need to specify this setting in the player. In mplayer this is done with the '-ac hwac3' or '-ac hwdts' switches, in VLC the settings can be found in the audio section of the preferences.
For analog multichannel you'll again need to set up the appropriate outputs in alsamixer and you can then specify '-channels 6' in mplayer.
6. How can I play video content over my tv-out in linux?
You'll first want to configure X to run your Tv-out as a second xineramascreen (dual head configuration). There are many guides on the internet for this configuration based on different video card manufacturers, see this LQ wiki page for some starter information. After this is set up you can specify the xineramascreen for playback in mplayer via the '-xineramascreen #' switch or in vlc by the '--x11-xineramascreen #' switch.
Virtualdub and VFW codecs for windows are great. Is there anything like this for linux?
avidemux2 is an advanced native linux video editing and encoding tool with a GUI interface very similar to virtualdub's. It supports many video codecs and output formats. Unlike virtualdub for windows it is more difficult for codecs to be supported in avidemux, however since it is not VFW based it is free to be much more versatile as far as output formats and advanced video codecs. avidemux supports more codecs and formats with every release and is a great application to get started with encoding video under linux.
Some people have successfully gotten virtualdub working under wine; however, keep in mind that virtually all of virtualdub's tools (aside from proprietary codecs) can be used in native linux apps.
2. What native tools are available for general purpose encoding?
GUI (graphical interface) Tools
avidemux2: easy virtualdub-like interface, many filters, codecs, and formats are supported.
dvd::rip: A GUI frontend to transcode, built-in DVD ripper, supports many different codecs and output formats.
acidrip: a DVD encodeing frontend based on mplayer/mencoder.
drip: A DVD to DIVX conversion application, supports MSMPEG4, OpenDivx, XviD for video, MP3 audio, has problems with some NTSC DVDs.
CLI (command-line interface) Tools
mencoder: The encoding application paired with mplayer, supports a vast amount of input formats, processing filters, and output codecs, although output container formats are currently limited to AVI and MPEG output format. See here for a tutorial on the command line interface.
transcode: a suite of CLI utilities for transcoding video and audio based on a modular structure. Supports many codecs and containers. See the wiki for command line help.
ffmpeg: a complete recording, converting and streaming solution, based on libavcodec/libavformat. Supports most of the codecs supported by mplayer as well as a few more container options

