Visualizzazione post con etichetta ubuntu. Mostra tutti i post
Visualizzazione post con etichetta ubuntu. Mostra tutti i post

domenica 30 novembre 2008

[Basics How-To] How i installed/built ffmpeg with mp3, amr, x264, theora, vorbis, xvid support on Kubuntu Hardy Heron 64-bit


Due to license restrictions the ffmpeg binary/package in K/X/Ubuntu repositories the encoding in restricted formats (such as mp3) is not possible by default. Googling around i found out a lot of different guides for ffmpeg installation, but focusing on one format at a time, or enabling only some of ffmpeg features. Here's a (tested) synthesis of all the guides i found. Credits after the howto.

Be warned that i started from a long-time installation, so some more libraries than stated may need to be installed.

Said this, here we go.

We need to remove the repository package and then to install (or compile) the dependencies needed

First a bit of cleansing

$ sudo apt-get remove ffmpeg

Then some utilities & libraries
$ sudo apt-get install git-core checkinstall build-essential subversion liblame-dev libfaad-dev libfaac-dev libxvidcore4-dev libx264-dev libdts-dev libgsm1-dev libtheora-dev libvorbis-dev libdc1394-13-dev libraw1394-dev

Now we have to create a dir to download the source code for ffmpeg and related dependencies
$ mkdir src

Move inside the newly created dir
$ cd src

Now we have to get all of the needed code through subversion, git and wget
$ svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
$ git clone git://git.videolan.org/x264.git
$ wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2
$ wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.3.tar.bz2
$ wget http://www.tortall.net/projects/yasm/releases/yasm-0.7.2.tar.gz

Untar the tarballs
$ tar -xjvf amrnb-7.0.0.2.tar.bz2
$ tar -xjvf amrwb-7.0.0.3.tar.bz2
$ tar -xzvf yasm-0.7.2.tar.gz

Now some compile&install using checkinstall.
Checkinstall is an application meant to replace the 'make install' final command in the process of software installation, by building and installing a .deb (or .rpm or .tgz) package, thus allowing the tracking of the change made, easing software removal.
The output of the process will be a bunch of installed binary packages, removable through dpkg ($sudo dpkg -r [package_name])

Yasm is a modular assembler that will optimize x264 code for MMX/SSE, thus improving encoding speed. The package in Hardy repository is not-so-up-to-date so let's build it.
$ cd yasm-0.7.2
$ ./configure
$ make
$ sudo checkinstall
$ cd ..

Libamr is the audio encoder/decoder for 3gp format (don't know why, checkinstall isn't successful with these)
$ cd amrnb-7.0.0.2
$ ./configure --prefix=/usr
$ make
$ sudo make install
$ cd ..

$ cd amrwb-7.0.0.3
$ ./configure --prefix=/usr
$ make
$ sudo make install
$ cd ..

From Wikipedia: x264 is a free software library for encoding H.264/MPEG-4 AVC video streams
$ cd x264
$ ./configure --prefix=/usr --enable-shared
$ make
$ sudo checkinstall --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-0.0ubuntu1"
$ sudo ldconfig
$ cd ..

At last, here we go with ffmpeg km-long configuration line, then the usual make && checkinstall
$ cd ffmpeg
$ ./configure --enable-gpl --enable-swscale --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libvorbis --enable-libgsm --enable-libdc1394 --disable-debug --enable-shared --enable-libmp3lame --enable-libfaad --enable-libfaac --disable-vhook --enable-libxvid --enable-libx264 --enable-postproc --enable-libamr-nb --enable-libamr-wb --enable-avfilter --enable-nonfree --prefix=/usr
$ make
$ sudo checkinstall

And that's it!

Credits to:
http://symbiotix.net/articles/compiling-ffmpeg-mp3-ubuntu-revised-ubuntu-gutsy-server
http://po-ru.com/diary/up-to-date-ffmpeg-on-ubuntu-hardy/
http://ubuntuforums.org/showthread.php?t=491885

http://ubuntuforums.org/showthread.php?t=786095&highlight=libx264
FFMpeg Documentation & http://howto-pages.org/ffmpeg/ for software usage help

Don't forget myself...... ^^

martedì 2 ottobre 2007

HOW-TO : DVB-T USB Pinnacle e (K)ubuntu

Riporto qui una versione riveduta e corretta delle indicazioni dell'utente renegate sul forum di SuseItalia.org per l'installazione e configurazione della scheda DVB USB della Pinnacle (la guida originale era per la Suse 10.2 con kernel 2.6.19, riveduta e provata da me su Kubuntu 7.04 con kernel 2.6.20):

PRELIMINARI

È necessario avere installato i sorgenti del kernel, preferibilmente la versione 2.6.20
Conviene preparare una cartella su /usr/src per l'installazione.
Il dispositivo va pluggato solo quando indicato esplicitamente in questa guida.

Scaricate i sorgenti v4l (Video4Linux):

http://mcentral.de/hg/~mrec/v4l-dvb-kernel/archive/
10528ad351bd.zip


estraete l'archivio, spostatevi nella cartella appena creata ( ../v4l-dvb-kernel ), compilate e installate

make
sudo make install

Se non ci sono errori si procede con il download del firmware.

Dovrebbe esserci già il firmware di molte schede tv da scaricare dal seguente sito:
http://konstantin.filtschew.de/v4l-firmware/
per le schede pinnacle dovrebbe andare bene la versione 3.

Scompattate il contenuto nella cartella
/lib/firmware/'uname -r'


[metodo alternativo] Personalmente ho estratto il firmware direttamente dal driver per Windows presente sul CD del dispositivo emBDA.sys

(Per fare questo bisogna andare nella cartella ../v4l-dvb-kernel/v4l_experimental/xc3028
copiarci dentro il file emBDA.sys
e quindi compilare)

gcc convert.c -o convert
sudo ./convert emBDA.sys >
/lib/firmware/'uname -r'/xceive_xc_3028.fw

[/metodo alternativo]

quindi riavviate il pc

CONFIGURAZIONE

A questo punto bisogna configurare il tutto

Al riavvio, con scheda scollegata:
sudo modprobe em28xx card=48
sudo modprobe em2880-dvb


Attenzione, la mia scheda è una pinnacle usb2 quindi
card=48
Cambiate questo valore da questo elenco:

m28xx #0: card=0 -> Generic EM2800 video grabber
em28xx #0: card=1 -> Generic EM2820 video grabber
em28xx #0: card=2 -> Generic EM2821 video grabber
em28xx #0: card=3 -> Generic EM2870 video grabber
em28xx #0: card=4 -> Generic EM2881 video grabber
em28xx #0: card=5 -> Generic EM2860 video grabber
em28xx #0: card=6 -> Generic EM2861 video grabber
em28xx #0: card=7 -> Terratec Cinergy 250 USB
em28xx #0: card=8 -> Pinnacle PCTV USB 2
em28xx #0: card=9 -> Hauppauge WinTV USB 2
em28xx #0: card=10 -> MSI VOX USB 2.0
em28xx #0: card=11 -> Terratec Cinergy 200 USB
em28xx #0: card=12 -> Leadtek Winfast USB II
em28xx #0: card=13 -> Kworld USB2800
em28xx #0: card=14 -> Pinnacle Dazzle DVC 90
em28xx #0: card=15 -> Hauppauge WinTV HVR 900
em28xx #0: card=16 -> Terratec Hybrid XS
em28xx #0: card=17 -> Terratec Hybrid XS Secam
em28xx #0: card=18 -> Kworld PVR TV 2800 RF
em28xx #0: card=19 -> Terratec Prodigy XS
em28xx #0: card=20 -> Videology 20K14XUSB USB2.0
em28xx #0: card=21 -> Usbgear VD204v9
em28xx #0: card=22 -> Terratec Cinergy T XS
em28xx #0: card=23 -> Pinnacle PCTV DVB-T
em28xx #0: card=24 -> DNT DA2 Hybrid
em28xx #0: card=25 -> Pinnacle Hybrid Pro
em28xx #0: card=26 -> Hercules Smart TV USB 2.0
em28xx #0: card=27 -> Compro, VideoMate U3
em28xx #0: card=28 -> KWorld DVB-T 310U
em28xx #0: card=29 -> SIIG AVTuner-PVR/Prolink PlayTV USB 2.0
em28xx #0: card=30 -> Terratec Cinergy T XS (MT2060)
em28xx #0: card=31 -> MSI DigiVox A/D
em28xx #0: card=32 -> D-Link DUB-T210 TV Tuner
em28xx #0: card=33 -> Gadmei UTV310
em28xx #0: card=34 -> Kworld 355 U DVB-T
em28xx #0: card=35 -> Supercomp USB 2.0 TV
em28xx #0: card=36 -> Hauppauge WinTV HVR Rev. 1.2
em28xx #0: card=37 -> Gadmei UTV330
em28xx #0: card=38 -> V-Gear PocketTV
em28xx #0: card=39 -> Kworld 350 U DVB-T
em28xx #0: card=40 -> Terratec Hybrid XS (em2882)
em28xx #0: card=41 -> Pinnacle Dazzle DVC 100
em28xx #0: card=42 -> Generic EM2750 video grabber
em28xx #0: card=43 -> Yakumo MovieMixer
em28xx #0: card=44 -> Huaqi DLCW-130
em28xx #0: card=45 -> Generic EM2883 video grabber
em28xx #0: card=46 -> Hauppauge WinTV HVR 950
em28xx #0: card=47 -> Pinnacle PCTV HD Pro
em28xx #0: card=48 -> Pinnacle Hybrid Pro (2)
em28xx #0: card=49 -> Hauppauge WinTV USB 2 (R2)
em28xx #0: card=50 -> NetGMBH Cam
em28xx #0: card=51 -> Leadtek Winfast USB II Deluxe
em28xx #0: card=52 -> MSI DigiVox A/D


Riavviate il PC con la scheda tv usb inserita.

Finito il bootstrap togliete la scheda USB e date i seguenti comandi
sudo rmmod em2880-dvb
sudo rmmod em28xx


Sempre a scheda scollegata date i comandi (questo ulteriore passaggio è necessario per la scheda pinnacle usb e per caricare il modulo del kernel per l'audio)
sudo modprobe em28xx device_mode=1
sudo modprobe em2880-dvb
sudo modprobe em28xx-audio

Quindi inserite la scheda DVB USB.

(Questi ultimi tre comandi andrebbero dati ad ogni riavvio, per caricare i moduli nel kernel.
È comunque possibile inserirli all'avvio aggiungendo nel file
/etc/modules
le seguenti tre righe

em28xx device_mode=1
em2880-dvb
em28xx-audio
)
A questo punto la scheda tv usb dovrebbe essere pronta, facciamo qualche verifica:

VERIFICA 1 - CONTROLLO DEI MESSAGGI DEL KERNEL

dmesg|grep em28

se tutto va bene dovremmo vedere una cosa del genere
tuner 1-0061: chip found @ 0xc2 (em28xx #0)
em28xx #0: V4L2 VBI device registered as /dev/vbi0
em28xx #0: V4L2 device registered as /dev/video0
em2880-dvb.c: DVB Init
DVB: registering new adapter (em2880 DVB-T).
em28xx #0: Found Pinnacle Hybrid Pro
em28xx audio device (eb1a:2881): interface 1, class 1
em28xx audio device (eb1a:2881): interface 2, class 1
em28xx-video.c: Switching device from DVB-T to analogue mode


VERIFICA 2 - STATO DEI DISPOSITIVI AUDIO

cat /proc/asound/cards

se tutto va bene dovremmo vedere una cosa del genere
0 [I82801DBICH4 ]: ICH4 - Intel 82801DB-ICH4
Intel 82801DB-ICH4 with unknown codec at 0xe0100c00, irq 10
1 [Video ]: USB-Audio - USB 2881 Video
USB 2881 Video at usb-0000:00:1d.7-4, high speed


VERIFICA 3 - CONTROLLO SUI MODULI INSTALLATI NEL KERNEL

lsmod|grep em28

se tutto va bene dovremmo vedere una cosa del genere



TEST

Per testare la scheda tv con il digitale terrestre ho usato Kaffeine.
Dovrebbe essere abbastanza semplice per la configurazione perchè quasi automatica. Con questo programma funzionano sia audio che video.
Leggo però in giro per la rete che potrebbe trovare meno canali di altri programmi, rendendo necessaria la creazione di un file di configurazione tramite l'utility
scan

parte delle dvb-utils
sudo apt-get install dvb-utils


Per la creazione del file channels.conf rinvio al blog http://divilinux.wordpress.com/2007/08/03/mplayer-dvb/

Per convertire channels.conf nel formato di Kaffeine (che purtroppo ha problemi nella ricerca canali, fermandosi al primo MUX trovato), invece, occorre visitare il sito http://lab.infodatei.de/conf2dvb/ ed incollare il contenuto del proprio channels.conf nella casella di testo.

Personalmente ho avuto successo solo quando ho inserito il risultato nel file
/home/nome_utente/.kde/share/apps/kaffeine/channels.db

ed effettuato la ricerca canali (con esito disordinato ma funzionante)

In posizione ottimale, con la scarsa antennina in dotazione, riesco a prendere nitidamente quasi tutti i canali, tranne il MUX Mediaset 2 (spero che un'antenna migliore mi aiuti con questo punto)

Per vedere i canali con Xine, Mplayer o VLC occorre mettere channels.conf nella cartella nascosta del programma in questione
/home/nome_utente/.nome_programma

(p.es. home/foo/.mplayer), e dare il comando da terminale
nomeprogramma dvb://nomecanale

dove il nome del canale è uguale alle prime parole per ogni riga di channels.conf

Per tutti i programmi che non supportano l'audio usb dovete reindirizzare l'uscita dell'audio usb su quella della scheda audio con l'utility sox
sudo apt-get install sox

poi:
sox -r 48000 -w -c 2 -t ossdsp /dev/dsp1 -t ossdsp /dev/dsp


N.B. si consiglia vivamente l'utilizzo di antenna condominiale o comunque diversa da quella fornita in dotazione: la ricezione è possibile solo in esterni, con qualità del segnale non eccelsa, numero di canali limitato e SNR alto (superiore al 60%)

sabato 15 settembre 2007

mercoledì 18 luglio 2007

Uff....anche Firefox......

Firefox 2 è pieno di bug e gestisce la memoria da cani (almeno su (K)Ubuntu), è innegabile



...... e io ne ho piene le "tasche"