Script para compilar / instalar FFMPEG con x264 en Linux – Debian y Centos

1533743527_fca3d440d7

Compilar FFMPEG – PHP-FFMPEG – MPLAYER – GIT – LAME – LIBOGG – LIBVORVIS – XVIDCORE – YASM

He estado personalizando algunas tareas para facilitarme la vida instalar algunas cosillas que me pide la gente así que he hecho un pequeño script para compilar FFMPEG con x264 y demás dependencias.

Tal cual como se los dejo funciona solo en debian, para centos tengo que cambiar la parte de apt, que instala el compilador y las dependencias de este mismo, lo demás lo compila sin problemas, aunque hoy no lo voy a hacer ya que me gusta probarlo y no tengo tiempo para montar un VPS con centos ahora mismo, pero tarde o temprano lo haré.

Si bien es cierto que se puede instalar mediante apt-get install ffmpeg pero, no lo instala todo y con el scritp compilamos y tendremos mejor rendimiento y también no tenemos que buscar los repos para todo, que si bien en debian vienen por defecto todos los paquetes y podemos instalar con apt-get o aptitude sin problemas con los repos por defecto, en centos es un poco más complicado y hay que buscar repos, así que este script le será más útil a los que tienen servidores centos ( cuando este funcionando para centos que son dos tonterías y funciona ) que a la gente de debían que lo pueden instalar por apt, aunque, a día de hoy el script instala las últimas versiones de los paquetes, los cuales puede que no estén en la última versión de los repos.

Bueno antes de dejar el script que hace este ?

Bueno.. básicamente ejecuta un apt-get update, luego instala el compilador y luego descarga los paquetes desde mirror.skamasle.com y los compila, por ahora no hay que hacer, ni escribir nada, ni el script nos preguntará si queremos o no cambiar las rutas o si queremos excluir algún paquete. Así que les dejo el script aquí pegado por si ustedes quieren quitar alguna linea o cambiar algunas rutas.

Solo tienen que copiar lo siguiente y pegarlo a a cualquier archivo tipo install.sh y luego ejecutarlo.

Este script esta en fase de pruebas – Use bajo su propio riesgo.

######
# Estoy agregando las ultimas versiones de lame y de otros programas desactualizados, supongo en estos días estará.
#####

#!/bin/bash
# Instalador de FFMPEG
# Skamasle.com
# Maksim Usmanov ( Skamasle )
# v 0.2 alpha
# 13 enero 2014
# Script en fase de pruebas, use bajo su propio riesgo, puede contener errores,
# no se recomienda usar en entornos en produccion
tmpdir=/tmp/ffmpeg-skamasle
if [ $(id -u) != "0" ]; then
    echo "Llama al señor root"
    exit 0
fi
echo "Este script compilara /instalara ffpmeg y las dependencias mas comunes ( lame, yasm, libogg, mencoder, mplayer etc"
echo "Se descargaran los archivos de mirror.skamasle.com / velocidad restringida a 400KB/s"
	tput setaf 6
echo "Preciona una tecla para continuar"
	tput sgr 0
read continue
apt-get update
apt-get install -y build-essential make automake patch gcc

if [ ! -d $tmpdir ]; then
mkdir $tmpdir
fi

wget -O $tmpdir/git-1.7.6.1.tar.gz https://mirror.skamasle.com/pkg/ffmpeg/git-1.7.6.1.tar.gz
	tar -C $tmpdir -zxvf $tmpdir/git-1.7.6.1.tar.gz
	cd $tmpdir/git-1.7.6.1
	./configure --prefix=/usr --libdir=/usr/lib --without-tcltk
	make
	make install

	wget -O $tmpdir/yasm-1.1.0.tar.gz https://mirror.skamasle.com/pkg/ffmpeg/yasm-1.1.0.tar.gz
	tar -C $tmpdir -zxvf $tmpdir/yasm-1.1.0.tar.gz
	cd $tmpdir/yasm-1.1.0
	./configure --prefix=/usr --libdir=/usr/lib
	make
	make install

	#git clone git://git.videolan.org/x264
	wget -O $tmpdir/x264.tar.gz https://mirror.skamasle.com/pkg/ffmpeg/x264.tar.gz
	tar -C $tmpdir -zxvf $tmpdir/x264.tar.gz
	cd $tmpdir/x264
	./configure --prefix=/usr --libdir=/usr/lib --enable-shared --enable-pic --enable-visualize
	make
	make install

	wget -O $tmpdir/faac-1.28.tar.gz https://mirror.skamasle.com/pkg/ffmpeg/faac-1.28.tar.gz
	tar -C $tmpdir -zxvf $tmpdir/faac-1.28.tar.gz
	cd $tmpdir/faac-1.28
	./configure --prefix=/usr --libdir=/usr/lib --with-mp4v2
	make
	make install

	wget -O $tmpdir/lame-3.98.4.tar.gz https://mirror.skamasle.com/pkg/ffmpeg/lame-3.98.4.tar.gz
	tar -C $tmpdir -zxvf $tmpdir/lame-3.98.4.tar.gz
	cd $tmpdir/lame-3.98.4
	./configure --prefix=/usr --libdir=/usr/lib --enable-nasm --enable-efence --enable-decode-layer1 --enable-mp3x --enable-mp3rtp
	make
	make install

	wget -O $tmpdir/opencore-amr-0.1.2.tar.gz https://mirror.skamasle.com/pkg/ffmpeg/opencore-amr-0.1.2.tar.gz
	tar -C $tmpdir -zxvf $tmpdir/opencore-amr-0.1.2.tar.gz
	cd $tmpdir/opencore-amr-0.1.2
	./configure --prefix=/usr --libdir=/usr/lib
	make
	make install

	wget -O $tmpdir/libogg-1.1.4.tar.gz https://mirror.skamasle.com/pkg/ffmpeg/libogg-1.1.4.tar.gz
	tar -C $tmpdir -zxvf $tmpdir/libogg-1.1.4.tar.gz
	cd $tmpdir/libogg-1.1.4
	./configure --prefix=/usr --libdir=/usr/lib
	make
	make install

	wget -O $tmpdir/libvorbis-1.2.3.tar.gz https://mirror.skamasle.com/pkg/ffmpeg/libvorbis-1.2.3.tar.gz
	tar -C $tmpdir -zxvf $tmpdir/libvorbis-1.2.3.tar.gz
	cd $tmpdir/libvorbis-1.2.3
	./configure --prefix=/usr --libdir=/usr/lib
	make
	make install

	wget -O $tmpdir/SDL-1.2.15.tar.gz https://mirror.skamasle.com/pkg/ffmpeg/SDL-1.2.15.tar.gz
	tar -C $tmpdir -zxvf $tmpdir/SDL-1.2.15.tar.gz
	cd $tmpdir/SDL-1.2.15
	apt-get install -y xorg-dev
	./configure --prefix=/usr --libdir=/usr/lib --enable-ipod --enable-x11-shared --enable-video-carbon
	make
	make install

	wget -O $tmpdir/libtheora-1.1.1.zip https://mirror.skamasle.com/pkg/ffmpeg/libtheora-1.1.1.zip
	unzip -d $tmpdir $tmpdir/libtheora-1.1.1.zip
	cd $tmpdir/libtheora-1.1.1
	./configure --prefix=/usr --libdir=/usr/lib
	make
	make install

	#git clone git://review.webmproject.org/libvpx.git
	wget -O $tmpdir/libvpx.tar.gz https://mirror.skamasle.com/pkg/ffmpeg/libvpx.tar.gz
	tar -C $tmpdir -zxvf $tmpdir/libvpx.tar.gz
	cd $tmpdir/libvpx
	./configure --prefix=/usr --libdir=/usr/lib --enable-shared --enable-pic --enable-debug --enable-gprof --enable-gcov --enable-vp8 --enable-mem-tracker
	make
	make install

	wget -O $tmpdir/xvidcore-1.3.1.tar.gz https://mirror.skamasle.com/pkg/ffmpeg/xvidcore-1.3.1.tar.gz
	tar -C $tmpdir -zxvf $tmpdir/xvidcore-1.3.1.tar.gz
	cd $tmpdir/xvidcore/build/generic
	./configure --prefix=/usr --libdir=/usr/lib
	make
	make install

	#git clone git://git.videolan.org/ffmpeg.git ffmpeg
	wget -O $tmpdir/ffmpeg.tar.gz https://mirror.skamasle.com/pkg/ffmpeg/ffmpeg.tar.gz
	tar -C $tmpdir -zxvf $tmpdir/ffmpeg.tar.gz
	cd $tmpdir/ffmpeg
	./configure --prefix=/usr --libdir=/usr/lib --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-x11grab --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid
	make
	make install

	wget -O $tmpdir/ffmpeg-php-0.6.0.tar.gz https://mirror.skamasle.com/pkg/ffmpeg/ffmpeg-php-0.6.0.tar.gz
	tar -C $tmpdir -zxvf $tmpdir/ffmpeg-php-0.6.0.tar.gz
	cd $tmpdir/ffmpeg-php-0.6.0
	phpize
	./configure --prefix=/usr --libdir=/usr/lib --with-ffmpeg --with-pic
	make
	make install
	

	wget -O $tmpdir/MPlayer-1.0rc4.tar.bz2 https://mirror.skamasle.com/pkg/ffmpeg/MPlayer-1.0rc4.tar.bz2
	tar -C $tmpdir -jxvf $tmpdir/MPlayer-1.0rc4.tar.bz2
	cd $tmpdir/MPlayer-1.0rc4
	./configure --prefix=/usr --libdir=/usr/lib
	make
	make install

ffmpeg -a

	tput setaf 6
echo 'Listo añade  extension="ffmpeg.so" a tu PHP.ini para usar php-ffpmeg'
	tput sgr 0

Bien, yo lo acabo de probar con debian 6 repositorios por defecto.

Aquí el resultado:

skamasle-instalar-ffmpeg

Formatos:

File formats:
D. = Demuxing supported
.E = Muxing supported
--
E 3g2 3GP2 format
E 3gp 3GP format
D 4xm 4X Technologies format
D IFF IFF format
D ISS Funcom ISS format
D MTV MTV format
DE RoQ raw id RoQ format
E a64 a64 - video for Commodore 64
D aac raw ADTS AAC
DE ac3 raw AC-3
E adts ADTS AAC
D aea MD STUDIO audio
DE aiff Audio IFF
DE alaw PCM A-law format
DE amr 3GPP AMR file format
D anm Deluxe Paint Animation
D apc CRYO APC format
D ape Monkey's Audio
D applehttp Apple HTTP Live Streaming format
DE asf ASF format
E asf_stream ASF format
DE ass Advanced SubStation Alpha subtitle format
DE au SUN AU format
DE avi AVI format
E avm2 Flash 9 (AVM2) format
D avs AVS format
D bethsoftvid Bethesda Softworks VID format
D bfi Brute Force & Ignorance
D bink Bink
D c93 Interplay C93
D caf Apple Core Audio Format
DE cavsvideo raw Chinese AVS video
D cdg CD Graphics Format
E crc CRC testing format
DE daud D-Cinema audio format
D dfa Chronomaster DFA
DE dirac raw Dirac
DE dnxhd raw DNxHD (SMPTE VC-3)
D dsicin Delphine Software International CIN format
DE dts raw DTS
DE dv DV video format
D dv1394 DV1394 A/V grab
E dvd MPEG-2 PS format (DVD VOB)
D dxa DXA
D ea Electronic Arts Multimedia Format
D ea_cdata Electronic Arts cdata
DE eac3 raw E-AC-3
DE f32be PCM 32 bit floating-point big-endian format
DE f32le PCM 32 bit floating-point little-endian format
DE f64be PCM 64 bit floating-point big-endian format
DE f64le PCM 64 bit floating-point little-endian format
D fbdev Linux framebuffer
DE ffm FFM (FFserver live feed) format
DE ffmetadata FFmpeg metadata in text format
D film_cpk Sega FILM/CPK format
DE filmstrip Adobe Filmstrip
DE flac raw FLAC
D flic FLI/FLC/FLX animation format
DE flv FLV format
E framecrc framecrc testing format
E framemd5 Per-frame MD5 testing format
DE g722 raw G.722
E gif GIF Animation
D gsm raw GSM
DE gxf GXF format
DE h261 raw H.261
DE h263 raw H.263
DE h264 raw H.264 video format
D idcin id Cinematic format
DE image2 image2 sequence
DE image2pipe piped image2 sequence
D ingenient raw Ingenient MJPEG
D ipmovie Interplay MVE format
E ipod iPod H.264 MP4 format
D iv8 A format generated by IndigoVision 8000 video server
DE ivf On2 IVF
D jv Bitmap Brothers JV
D lmlm4 lmlm4 raw format
D lxf VR native stream format (LXF)
DE m4v raw MPEG-4 video format
E matroska Matroska file format
D matroska,webm Matroska/WebM file format
E md5 MD5 testing format
DE mjpeg raw MJPEG video
DE mlp raw MLP
D mm American Laser Games MM format
DE mmf Yamaha SMAF
E mov MOV format
D mov,mp4,m4a,3gp,3g2,mj2 QuickTime/MPEG-4/Motion JPEG 2000 format
E mp2 MPEG audio layer 2
DE mp3 MPEG audio layer 3
E mp4 MP4 format
D mpc Musepack
D mpc8 Musepack SV8
DE mpeg MPEG-1 System format
E mpeg1video raw MPEG-1 video
E mpeg2video raw MPEG-2 video
DE mpegts MPEG-2 transport stream format
D mpegtsraw MPEG-2 raw transport stream format
D mpegvideo raw MPEG video
E mpjpeg MIME multipart JPEG format
D msnwctcp MSN TCP Webcam stream
DE mulaw PCM mu-law format
D mvi Motion Pixels MVI format
DE mxf Material eXchange Format
E mxf_d10 Material eXchange Format, D-10 Mapping
D mxg MxPEG clip file format
D nc NC camera feed format
D nsv Nullsoft Streaming Video
E null raw null video format
DE nut NUT format
D nuv NuppelVideo format
DE ogg Ogg
D oma Sony OpenMG audio
DE oss Open Sound System playback
E psp PSP MP4 format
D psxstr Sony Playstation STR format
D pva TechnoTrend PVA file and stream format
D qcp QCP format
D r3d REDCODE R3D format
DE rawvideo raw video format
E rcv VC-1 test bitstream
D rl2 RL2 format
DE rm RealMedia format
D rpl RPL/ARMovie format
DE rso Lego Mindstorms RSO format
DE rtp RTP output format
DE rtsp RTSP output format
DE s16be PCM signed 16 bit big-endian format
DE s16le PCM signed 16 bit little-endian format
DE s24be PCM signed 24 bit big-endian format
DE s24le PCM signed 24 bit little-endian format
DE s32be PCM signed 32 bit big-endian format
DE s32le PCM signed 32 bit little-endian format
DE s8 PCM signed 8 bit format
DE sap SAP output format
D sdp SDP
D shn raw Shorten
D siff Beam Software SIFF
D smk Smacker video
D sol Sierra SOL format
DE sox SoX native format
DE spdif IEC 61937 (used on S/PDIF - IEC958)
DE srt SubRip subtitle format
E svcd MPEG-2 PS format (VOB)
DE swf Flash format
D thp THP
D tiertexseq Tiertex Limited SEQ format
D tmv 8088flex TMV
DE truehd raw TrueHD
D tta True Audio
D tty Tele-typewriter
D txd Renderware TeXture Dictionary
DE u16be PCM unsigned 16 bit big-endian format
DE u16le PCM unsigned 16 bit little-endian format
DE u24be PCM unsigned 24 bit big-endian format
DE u24le PCM unsigned 24 bit little-endian format
DE u32be PCM unsigned 32 bit big-endian format
DE u32le PCM unsigned 32 bit little-endian format
DE u8 PCM unsigned 8 bit format
D vc1 raw VC-1
D vc1test VC-1 test bitstream format
E vcd MPEG-1 System format (VCD)
D video4linux Video4Linux device grab
D video4linux2 Video4Linux2 device grab
D vmd Sierra VMD format
E vob MPEG-2 PS format (VOB)
DE voc Creative Voice file format
D vqf Nippon Telegraph and Telephone Corporation (NTT) TwinVQ
D w64 Sony Wave64 format
DE wav WAV format
D wc3movie Wing Commander III movie format
E webm WebM file format
D wsaud Westwood Studios audio format
D wsvqa Westwood Studios VQA format
D wtv Windows Television (WTV)
D wv WavPack
D x11grab X11grab
D xa Maxis XA File Format
D yop Psygnosis YOP Format
DE yuv4mpegpipe YUV4MPEG pipe format

Pueden descargar el script desde aquí: script para compilar ffmpeg

Publicado por Maks Skamasle

Sysadmin, fotógrafo aficionado y me gusta tomar el té por las madrugadas cuando no hay ruido ni sol y mas fresco esta el día.

No usamos Cookies para rastrear nada, navega tranquilo...
Seguir Navegando
x