Monday, May 25, 2009

Debian 5 (Lenny) - Multimedia

This is work in progress. Do not link to this page, it might change!

Hardware and preparation | OS installation | Console and web monitoring | Network and services | Multimedia | Security and performace

# aptitude install alsa-utils libesd-alsa0
# alsaconf
# alsamixer
To save mixer settings:
# alsactl store
Problem: sound won't work in cplay, but it works with mplayer. Still to investigate...
Links: alsaconf deprecated, ESS Maestro3/Allegro devices.


[X] /var/log/dmesg: "Driver ‘pcspkr’ is already registered, aborting…"
This is a bug in kernel. In the link below, someone says it must be pcspkr and snd-pcsp both trying to handle the same device.
Solution: add a blacklist in /etc/modprobe.d/blacklist:
# echo "blacklist snd-pcsp" >> /etc/modprobe.d/alsa-base-blacklist

Though it's weired to think about installing desktop applications on a server, there is no other way (that I know of) to install applications such as VisualRoute or virtualization software (VMware etc.). I'm planning to make this server as lite as possible, but slightly nice (for my taste).

We need to install a X Window System ( is the de-facto window system/server in Linux), over which we add a window manager (because I don't like the's default xterm). The default XDM login manager has simplicity needed for remote desktop. Menus are automatically generated by a debian package menu.

Installation (1):
# aptitude install xorg {this will automatically install x-windows-system-core and xterm}
# aptitude install xdm {choose the preferred one}
# aptitude fluxbox/blackbox/openbox

Installation (2):
# aptitude install x-windows-system-core# aptitude install gnome-core/kde-core/fluxbox/xfce4
aptitude install xdmLinks: Debian reference - The X Window System, Debian Etch - A minimal setup with X, Comparison of X window managers,
WMs/DEs reviewed:
- tiled: 9wm + rio, eventually (first tiled wm, very basic; C language), aewm (alpha since long time, written in C), awesome (next generation, very light 'though complex - multihead display, title bar, config file; fork of dwm), dwm (max 2000 lines of code, written in C language, very minimalistic, no title bar, no config file), ion, larswm (a rewrite of 9wm that adds automatic tiling, virtual desktops and many more features to make it a highly productive user environment; too white), lwm (Lightweight Window Manager) (nice and clean), ratpoison (inspired by screen), Stumpwm (Lisp, rather ancient, successor of ratpoison), xmonad (written in Haskell, too white), w9wm (evolved 9wm), wmii,
- simple: aewm (Win95 look) / WindowLab (UNIX), GoFun, LiteStep (aims to replace Windows Explorer shell), Ratpoison (HOWTO: Ratpoison Basic Configuration), Stumpwm (Lisp, really uggly!), twm (standard WM from
- poor graphics: AntiRight, Afterstep (/aterm), BlackBox (C++), Echinus (based on dwm and fwm, same author), Equinox (like Win95), FVWM, ion3, IceWM (= iceweasel), Matchbox, Motif/MWM, OpenBox (written in C), ROX, TkDesk, UDE (Unix Desktop Environment), WindowMaker.
- rich graphics: Enlightenment (past default for GNOME up to 2.1), Étoilé, Fluxbox (based on BlackBox), Gnome / GNUstep (part of GNU Project, available in GNUstep Live CD based on Debian), KDE /CDE (UNIX), KWin, LXDE (Lightweight X11 Desktop Environment), Sawfish (Lisp, past default for GNOME, before Enlightenment), Xfce/Xfwm4/EDE (Minix, Mandriva), XPde
- 3D hardware: Beryl (forked from Compiz), Compiz (Debian HOW-TO : AIGLX + Compiz),
From the above, only the following captured my attention: Echinus, Equinox, lwm,
Login managers reviewed:
- startx + .xsession file (To choose the window manager/desktop environment, you can edit ~/.xinitrc or ~/.xsession and add as the last line 'gnome-session' 'startkde' or 'fluxbox' as per choice)
- slim - links:
- xdm - smallest and works well to get you going on your way. Highly configurable.
- wdm - combines the functions of a graphical display manager identifying and authenticating a user on a system with some of the functions of a session manager in selecting and starting a window manager. Optionally, wdm can shutdown (reboot or halt) the system.
- gdm - easily configurable and adds libraries you need if you want to use the synaptic package manager (also contains a lot of the extra functions of xdm)
- kdm - largest and bloated

Desktop applications
[X] VNC - remote desktop
For remote desktop to work (both for physical server or virtual machines), vnc4server has to be installed:
# aptititude install vnc4server
To do.

[X] Conkeror - browser based on Mozilla; links: Conkeror screenshots, Conkeror .deb-Packages for Debian- and Ubuntu-like Operating Systems.


It would be nice if I might someday add the functionality of dual-view display: a primary console display attached to physical display, and a secondary Media-PC display attached to TV or projector. I don't find yet the time, nor the usability of such setup - 'though being possible would be reasonably enough to do it. :)

[?] Add multimedia capabilities:

Video recording / Monitoring
Links: WebCam under Linux, Webcam on debian, Motion - a software motion detector, CLI Magic: Getting into Motion, webcam-server package.

CD/DVD backup/recording
(1) Install some software:
# aptitude install dvdbackup vobcopy
(2.a) Copy the full content of the media:
# dvdbackup -M -i /dev/hdb -o /mount/dvd-temp/
(2.b) ... or just the feature:
# dvdbackup -F -i /dev/hdb -o /mount/dvd-temp/
(2.c) If errors appear, try the title switch (replace DVD_TITLE with your own given name of the CD/DVD):
# dvdbackup -M -n DVD_TITLE -i /dev/hdb -o /mount/dvd-temp/
(2.d) Encrypted DVDs can be ripped using vobcopy: to do.
(2.e) Alternativelly, vobcopy has verbose output and I like it more:
# vobcopy -m -i /mount/dvd-drive/ -o /mount/dvd-temp/
(3) Transcoding - compressing the DVD to avi/divx: to do.

DVD to DivX script files
- dvd2divx
- lxdvdrip

Save DVD in one file, as MPEG
(1) Insert DVD
(2) Mount the DVD drive
(3) Copy file01.vob, fil02.vob...etc to your hard drive.
(4) in terminal run:
# cat file01.vob fil02.o2 file03.vob > file.mpg

1:1 DVD to ISO
# cd vobcopy -v -m /media/cdrom0 cd mkisofs -v -dvd-video -o ../MOVIE_Name.iso
It needs libdvdcss2 for decryption. (Never tried this myself.)

Alternate 1:1 DVD to IMG
# dd if=/dev/hdb of=/mount/local/video/movie.img
To watch it later:
# mount -o loop /mount/local/video/movie.img /mnt && vlc dvd:///mnt
(Never tried that either.)

DVD to DivX (3-pass encodig)
Remove this file, which can come from a previous 3-pass encoding (it interferes with current one):
# rm frameno.avi
Start the 3-pass encoding process (audio encoding takes place in a separate pass):
# mencoder -dvd 2 -ovc frameno -o frameno.avi -oac mp3lame -lameopts vbr=3
# mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o movie.avi
# mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o movie.avi
Source: Encoding with MEncoder.

DVD to DivX (3-pass encodig) + copy 2 subtitles
# rm subtitles.idx subtitles.sub
# mencoder -dvd 1 -vobsubout subtitles -vobsuboutindex 0 -sid 2 -o frameno.avi -ovc frameno -oac mp3lame -lameopts vbr=3
# mencoder -dvd 1 -oac copy -ovc divx4 -divx4opts pass=1
# mencoder -dvd 1 -oac copy -ovc divx4 -divx4opts pass=2 -vobsubout subtitles -vobsuboutindex 1 -sid 5

Extract the French subtitle from MPEG file
# rm subtitles.idx subtitles.sub
# mencoder movie.mpg -ifo movie.ifo -vobsubout subtitles -vobsuboutindex 0 -vobsuboutid fr -sid 1

Ripping DVD (dump the whole movie into one de-CSS'ed VOB file)
# mplayer dvd://$TITLE -dvd-device /dev/hdb -v -v -dumpstream -dumpfile dvd_file.vob
Transcoding (3 passes):

# mencoder "$CACHE" -oac mp3lame -lameopts abr:br=$A_BITRATE:mode=0 -aid $A_ID -af volume=15:sc -ovc frameno -o frameno.avi
# mencoder "$CACHE" -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vhq:v4mv:vqmin=2:vbitrate=${V_BITRATE}:vpass=1 -vf pp=de -aid $A_ID -o "/dev/null"
# mencoder "$CACHE" -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vhq:v4mv:vqmin=2:vbitrate=${V_BITRATE}:vpass=2 -vf pp=de -aid $A_ID -o "$OUT"

Other interesting tools controlling CD/DVD/BR (Blue-Ray)
- cdrtools, made of: cdrecord (CD/DVD/BD recording), readcd (CD-clone capabilities), cdda2wav (the most evolved CD-audio extraction program with paranoia support), mkisofs (create hybrid ISO9660/JOLIET/HFS filesystes with optional Rock Ridge attributes), isodebug (print mkisofs debug information from media), isodump (dump ISO-9660 media), isoinfo (analyse/verify ISO/9660/Joliet/Rock-Ridge Filesystems), isovfy (verify the ISO-9660 structures), rscsi (remote SCSI enabling daemon). There is a fight between the developer and Debian developers who created a fork out of cdrtools called cdrkit. Links: Linux controversy, cdrtools - a tale of two licenses (2006), cdrkit: Debian's fork of cdrtools, Bug #361450: Cdrtools: Debian adds many broken patches, Cdrtools Has Been Forked (Debian User Forums), linux.debian.devel mailing list (Google Groups),
- cdrkit (a fork of cdrtools, initiated by the Debian project), made of: wodim (cdrecord), icedax (cdda2wav), genisoimage (mkisofs)
- cdrskin, command-line interface (CLI) tool as a part of the Libburnia project. It should be noted (as stated on the website), that cdrskin has to be aware of cdrecord but not vice versa. In time, it is desired that cdrskin will replace cdrecord.

Keep for later reading:
- Copying or Ripping DVD's in Linux (Debian)
- DVD to iPod Made Easy (based on Howto encode DVD video for an iPod (ffmpeg))
- Encode Video for iPod Video
- Ripping and transcoding DVD video with GNU/Linux
- Ripping and transcoding DVD video with Linux
- DVD ripping and transcoding with Linux
- mencoder/transcode command-line
- 5 Best Applications to Rip and Transcode DVDs in Linux
- Transcode - The video transcoder to rule them all
- Converting video in linux using ffmpeg and mencoder
- ffmpeg ripping dvd to xvid, suggestions on options to use
- Howto Rip a DVD - Easy and Free with Linux
- Convert videos with mencoder or ffmpeg and play them in your DAP
- Using HandBrakeCLI
- k9copy/k9copy in Ubuntu (alternative to DVDShrink, available in linux vi Wine)
- undvd, Transcode FAQ
- ffmpeg
- libdvdcss/official website (free alternative to DeCSS)
- dvd::rip documentation
- tuxrip

Media box

Audio only
- Ampache (available at SourceForge, freshmeat) - Web-based audio file manager (to view, edit, and play)
- MPD - Media Player Daemon
- Zina (available at SourceForge, freshmeat) - graphical interface to MP3 collection, personal jukebox, Podcaster and MP3 streamer

Video only

Photo albums only
- Gallery (available at SourceForge, freshmeat) - Web-based photo album (PHP)

Online TV only
- Firefly / mt-daapd - the purpose of this project is to be able to serve the widest variety of - digital music content over the widest range of devices, and the best server software to serve digital music to the Roku Soundbridge and iTunes; links: Howto Setup iTunes-compatible Media server in Ubuntu

Live-CD or linux distro
- GeeXboX - Live-CD distro as a HTPC, using MPlayer
- LinuxMCE - HTPC based on KUbuntu, and software like Asterisk, Xine, MythTV, VDR, Firefox, VideoLAN and SlimServer
- Knoppmyth - linux distro as a HTPC based on Debian, having MythTV PVR
- Medibuntu - Multimedia, Entertainment & Distractions In Ubuntu
- Mythbuntu - linux distro as HTPC, based on Ubuntu and MythTV, having Xfce by default
- MythDora - Live-CD linux distro as HTPC, based on Fedora and MythTV
- Linpus Media Center - linux distro as HTPC
- Ubuntu on Playstation 3 (Ubuntu), Linux in PS3.

Live-CD or linux distro
HTPC (mixed functionality) - music, video, photo and/or online TV
- Freevo - MythTV alternative; PVR, playback of videos, DVDs, pictures, music, and watching live TV
- My Media System - HTPC with no TV functionality of its own, but offers the possibility to integrate it
- MythTV - HTPC, with support for plugins (audio, video, photo, RSS, internet etc.)
- VDR - Video Disk Recorder -digital satellite receiver and Video Disk Recorder
- VLC - multimedia player and multimedia framework capable of reading most audio and video formats (MPEG-2, MPEG-4, H.264, DivX, MPEG-1, mp3, ogg, aac ...) as well as DVDs, Audio CDs VCDs, and various streaming protocols; links: VLC - advanced use
- XBMC Media Center -software media player and entertainment hub for digital media
- Yaass Project (available at SourceForge, freshmeat) - web-based streaming server with an iTunes-like interface to share MP3 library (Java servlet compliant- runs on Tomcat, Jetty etc.)

- IR Blaster - IR sensor to be used as receiver for remote, to control MythTV

Links: Restricted Formats (Ubuntu), MPlayer/FFmpeg can handle hd-dvd/Blu-ray video now (.evo rips), Debian Multimedia, Ripping DVD audio to ogg in Ubuntu, Media Server tutorial + WOL (Wake-on-lan).

About / Despre acest blog
Disclaimer and privacy statement / Confidenţialitate
Updated / Actualizat: 2009-09-15.


No comments: