Building FFmpeg su Debian Squeeze con libavfilter e x264

 

Ho scoperto da poco che nell'installazione di default di ffmpeg, manca qualcosa, e che proprio questa cosa che manca ,mi serve per un "esperimento". Comunque andando per ordine e tralasciando a cosa mi serve la  "cosa mancante" ,ho deciso di compilare ffmpeg ex novo, con il supporto x264 e libavfilter. Quindi come primo procedimento ho disinstallato la versione installata dai repo.

 

# apt-get remove ffmpeg x264 libx264-dev

 

dopo di chè ho installato tutto quello che serve per una corretta compilazione:

 

# apt-get build-dep ffmpeg

 

servono anche:

 

# apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libx11-dev libxfixes-dev libxvidcore4-dev zlib1g-dev

 

Scaricare compilare ed installare  soc x264 e ffmpeg:

 

$ svn co svn://svn.ffmpeg.org/soc

$ cd soc/libavfilter

$ ./checkout.sh

$ cd ffmpeg

$ ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab --enable-libtheora --enable-libgsm --enable-libvorbis --enable-filter=movie --enable-avfilter --enable-postproc

$ make

 

con ERROR: libx264 not found, oppue senza, bisogna installare x264:

 

$ cd ../../..

$ git clone git://git.videolan.org/x264.git

$ cd x264

$ ./configure

$ make

# checkinstall --fstrans=no --install=yes --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-squeeze" --backup=no --default

 

tornare nella cartella di ffmpeg:

 

$ cd ../soc/libavfilter/ffmpeg

$ ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab --enable-libtheora --enable-libgsm --enable-libvorbis --enable-filter=movie --enable-avfilter --enable-postproc

$ make

# checkinstall --pkgname=ffmpeg --pkgversion "5:0.7+svn`date +%Y%m%d`" --backup=no --default

 

adesso abbiamo una nuova installazione di ffmpeg con quel qualcosa che mi mancava, ma di cui scriverò la prossima volta 🙂

 

enjoy 😉

Autore: Franco Conidi aka edmond

Senior System Integrator, Network Administrator, Sys Admin Linux, Linux User, Consulente Informatico.

21 pensieri riguardo “Building FFmpeg su Debian Squeeze con libavfilter e x264”

  1. Buon giorno,
    Cerco da più di 20 giorni di installare sul mio server Linux debian squeeze amd64 versione 6 questi software con relative librerie e attivazione di tutti i differenti supporti. FFmpeg,FFmpeg PHP,Lame,Libogg,Libvorbis,FLVtool2,Mplayer,Mencoder. :muro:
    Da premettere che ho sul mio server installato webmin con php5 gestione domini ecc. Dovrei installare sul mio dominio un sito tipo youtube o daimotion. Qualcuno potrebbe darmi una mano nella configurazione e installazione dei differenti services sul mio dedicato. Ho installato tutto, ma credo di aver fatto qualche errore perchè non mi trasforma i video, e poi mi da errore nella creazione delle thumbs.
    Vi ringrazio in anticipo per l’aiuto.

  2. Ti ringrazio prima di tutto per la’iuto che mi darai,

    Allora io ho installato questi supporti

    PHP CLI found (/usr/local/bin/php)
    MEncode rfound (/usr/local/bin/mencoder)
    MPlayer found (/usr/local/bin/mplayer)
    FFMpeg found (/usr/local/bin/ffmpeg)
    FLVTool2 found (/usr/bin/flvtool2)

    ma praticamente mi mancano librerie e codec sia di Mencoder Mplayer e FFmpeg e FFmpeg-php

    JPEG Supportfound (/usr/lib/libjpeg.so.62 (0x00007fe4fb8a8000))
    LAME Supportfound (/usr/local/lib/libmp3lame.so.0 (0x00007fe4f9d7a000))
    XVID Supportmissing ()
    THEORA Supportfound (/usr/local/lib/libtheora.so.0 (0x00007fe4fa659000)
    X264 Support()
    FAAC Supportmissing ()

  3. quelle librerie si trovano tutte nei repo, hai aggiunto al sources.list questo?

    #### Debian Multimedia
    deb squeeze main
    deb-src squeeze main

    # apt-get update && apt-get install debian-multimedia-keyring && apt-get update

  4. si Certo……!!

    e’ STATA LA PRIMA COSA CHE HO FATTO CON LE LIBRERIE.

  5. Potresti aiutarmi a capire l’errore che commetto magari facendomi testare ffmpeck da terminale?

  6. $ ffmpeg -formats
    FFmpeg version SVN-r26400, Copyright (c) 2000-2011 the FFmpeg developers
    built on Nov 28 2011 00:23:13 with gcc 4.4.5
    configuration: –enable-gpl –enable-version3 –enable-nonfree –enable-pthreads –enable-libfaac –enable-libmp3lame –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libtheora –enable-libx264 –enable-libxvid –enable-x11grab –enable-libtheora –enable-libgsm –enable-libvorbis –enable-filter=movie –enable-avfilter –enable-postproc
    libavutil 50.36. 0 / 50.36. 0
    libavcore 0.16. 1 / 0.16. 1
    libavcodec 52.108. 0 / 52.108. 0
    libavformat 52.93. 0 / 52.93. 0
    libavdevice 52. 2. 3 / 52. 2. 3
    libavfilter 1.74. 0 / 1.74. 0
    libswscale 0.12. 0 / 0.12. 0
    libpostproc 51. 2. 0 / 51. 2. 0
    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 alsa ALSA audio output
    DE amr 3GPP AMR file format
    D anm Deluxe Paint Animation
    D apc CRYO APC format
    D ape Monkey’s Audio
    D applehttps 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
    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
    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
    D ivf On2 IVF
    D jack JACK Audio Connection Kit
    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

    Questo con format..

  7. Note, the names of encoders and decoders do not always match, so there are
    several cases where the above table shows encoder only or decoder only entries
    even though both encoding and decoding are supported. For example, the h263
    decoder corresponds to the h263 and h263p encoders, for file formats it is even
    worse.
    $
    Alla fine dei codecs mi da questo.
    Ho provato a convertire e ffmpeg funziona.. può essere un problema di Mencoder + Mplayer.
    Il player non parte perchè ffmpeg non funziona perfettamente?

  8. la nota alla fine è normale. comunque ti mancano
    –enable-libxvid ed –enable-libfaac ecco perchè quei codec
    ti mancano
    Se ffmpeg funziona la cosa mi sembra tutta un po strana, tu hai detto
    di essere su debian stable, quindi è impossibile che ci siano dei problemi nei software, c’è qualcos’altro….

  9. Si, Debian Linux 6.0.3 Kernel and CPU Linux 2.6.32.41-host1-enjoyshell-grsec on x86_64
    Processor information Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 4 cores

    Adesso ricompilo ffmpeg e rimetto su quelle librerie..

    Quindi tu mi dici che non è questione di di ffmpeg e mplayer e mencoder?

    Effettivamente non mi fa visualizzare neanche i file flv. nessun tipo di file. La cosa è strana..!

  10. Questi due passaggi non riesco a completarli… Tu sai darmi una mano?!

    •Must be able to run PHP from the command line (CLI) with exec()
    •Allowed execution of background processes with exec(“binary > /dev/null &”)

    Ti ringrazio ancora per l’aiuto che mi hai dato fino adesso!

  11. Facendo il punto della situazione, ffmpeg-php funziona bene perchè mi fa le immagini dei video.. provandolo a mano ffmpeg funziona perchè mi converte i formati. Provato Mencoder e va anche quello…e Mplayer… nmi da questo errore

    Playing 23.avi.
    AVI file format detected.
    [aviheader] Video stream found, -vid 0
    [aviheader] Audio stream found, -aid 1
    VIDEO: [MP43] 320×240 24bpp 29.970 fps 419.1 kbps (51.2 kbyte/s)
    Clip info:
    Software: Lavf52.0.0
    Load subtitles in ./
    vo: couldn’t open the X11 display ()!
    Error opening/initializing the selected video_out (-vo) device.
    ==========================================================================
    Requested audio codec family [mpg123] (afm=mpg123) not available.
    Enable it at compilation.
    Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
    AUDIO: 22050 Hz, 1 ch, floatle, 64.0 kbit/9.07% (ratio: 8000->88200)
    Selected audio codec: [ffmp3float] afm: ffmpeg (FFmpeg MPEG layer-3 audio)
    ==========================================================================
    [AO OSS] audio_setup: Can’t open audio device /dev/dsp: No such file or directory
    [AO_ALSA] alsa-lib: confmisc.c:768:(parse_card) cannot find card ‘0’
    [AO_ALSA] alsa-lib: conf.c:4170:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
    [AO_ALSA] alsa-lib: confmisc.c:392:(snd_func_concat) error evaluating strings
    [AO_ALSA] alsa-lib: conf.c:4170:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
    [AO_ALSA] alsa-lib: confmisc.c:1251:(snd_func_refer) error evaluating name
    [AO_ALSA] alsa-lib: conf.c:4170:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    [AO_ALSA] alsa-lib: conf.c:4649:(snd_config_expand) Evaluate error: No such file or directory
    [AO_ALSA] alsa-lib: pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM default
    [AO_ALSA] Playback open error: No such file or directory
    [AO ARTS] loading the aRts backend “/usr/lib/libartscbackend.la” failed
    [AO ESD] esd_open_sound failed: Connection timed out
    AO: [pulse] Init failed: Connection refused
    [JACK] cannot open server
    ao_nas: init(): AUDIOSERVER environment variable not set -> nosound
    [AO SDL] Samplerate: 22050Hz Channels: Mono Format floatle
    [AO SDL] Unsupported audio format: 0x1d.
    [AO_ALSA] alsa-lib: confmisc.c:768:(parse_card) cannot find card ‘0’
    [AO_ALSA] alsa-lib: conf.c:4170:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
    [AO_ALSA] alsa-lib: confmisc.c:392:(snd_func_concat) error evaluating strings
    [AO_ALSA] alsa-lib: conf.c:4170:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
    [AO_ALSA] alsa-lib: confmisc.c:1251:(snd_func_refer) error evaluating name
    [AO_ALSA] alsa-lib: conf.c:4170:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    [AO_ALSA] alsa-lib: conf.c:4649:(snd_config_expand) Evaluate error: No such file or directory
    [AO_ALSA] alsa-lib: pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM default
    [AO SDL] Unable to open audio: No available audio device
    DVB card number must be between 1 and 4
    AO: [null] 22050Hz 1ch floatle (4 bytes per sample)
    Video: no video
    Starting playback…
    A: 9.9 (09.9) of 2702.1 (45:02.0) 0.1%
    [3]+ Stopped mplayer -vo xv 23.avi

  12. Requested audio codec family [mpg123] (afm=mpg123) not available.
    Enable it at compilation.
    Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
    AUDIO: 22050 Hz, 1 ch, floatle, 64.0 kbit/9.07% (ratio: 8000->88200)
    Selected audio codec: [ffmp3float] afm: ffmpeg (FFmpeg MPEG layer-3 audio)

    questa parte non è importante, lo fa anche a me e tutto funziona.
    Hai provato nell’impostazioni video di mplayer a settare su gl2 e nella
    sezione codec audio/video scegliere Fmpeg’s libavcodec codec family

  13. Se mi spieghi come posso farlo, ci provo. Grazie per la tua pazienza e per il tuo aiuto.

  14. essendo un server sei senza interfaccia grafica ..giusto?
    io non ho esperienza in ambito server……spero di riuscire ad aiutarti

  15. nella home c’è il file di configurazione di mplayer, il mio che si chiama gui.conf è così:

    cache = “no”
    cache_size = “2048”
    vf_pp = “no”
    autosync = “no”
    autosync_size = “0”
    ao_volnorm = “no”
    ao_surround = “no”
    ao_extra_stereo = “no”
    ao_extra_stereo_coefficient = “1.000000”
    enable_audio_equ = “no”
    equ_channel_1 = “Front Right”
    equ_channel_2 = “Front Left”
    equ_channel_3 = “Rear Right”
    equ_channel_4 = “Rear Left”
    equ_channel_5 = “Center”
    equ_channel_6 = “Bass”
    equ_band_00 = “0.000000”
    equ_band_01 = “0.000000”
    equ_band_02 = “0.000000”
    equ_band_03 = “0.000000”
    equ_band_04 = “0.000000”
    equ_band_05 = “0.000000”
    equ_band_06 = “0.000000”
    equ_band_07 = “0.000000”
    equ_band_08 = “0.000000”
    equ_band_09 = “0.000000”
    equ_band_10 = “0.000000”
    equ_band_11 = “0.000000”
    equ_band_12 = “0.000000”
    equ_band_13 = “0.000000”
    equ_band_14 = “0.000000”
    equ_band_15 = “0.000000”
    equ_band_16 = “0.000000”
    equ_band_17 = “0.000000”
    equ_band_18 = “0.000000”
    equ_band_19 = “0.000000”
    equ_band_20 = “0.000000”
    equ_band_21 = “0.000000”
    equ_band_22 = “0.000000”
    equ_band_23 = “0.000000”
    equ_band_24 = “0.000000”
    equ_band_25 = “0.000000”
    equ_band_26 = “0.000000”
    equ_band_27 = “0.000000”
    equ_band_28 = “0.000000”
    equ_band_29 = “0.000000”
    equ_band_30 = “0.000000”
    equ_band_31 = “0.000000”
    equ_band_32 = “0.000000”
    equ_band_33 = “0.000000”
    equ_band_34 = “0.000000”
    equ_band_35 = “0.000000”
    equ_band_36 = “0.000000”
    equ_band_37 = “0.000000”
    equ_band_38 = “0.000000”
    equ_band_39 = “0.000000”
    equ_band_40 = “0.000000”
    equ_band_41 = “0.000000”
    equ_band_42 = “0.000000”
    equ_band_43 = “0.000000”
    equ_band_44 = “0.000000”
    equ_band_45 = “0.000000”
    equ_band_46 = “0.000000”
    equ_band_47 = “0.000000”
    equ_band_48 = “0.000000”
    equ_band_49 = “0.000000”
    equ_band_50 = “0.000000”
    equ_band_51 = “0.000000”
    equ_band_52 = “0.000000”
    equ_band_53 = “0.000000”
    equ_band_54 = “0.000000”
    equ_band_55 = “0.000000”
    equ_band_56 = “0.000000”
    equ_band_57 = “0.000000”
    equ_band_58 = “0.000000”
    equ_band_59 = “0.000000”
    playbar = “yes”
    load_fullscreen = “no”
    show_videowin = “yes”
    gui_save_pos = “yes”
    gui_main_pos_x = “349”
    gui_main_pos_y = “616”
    gui_video_out_pos_x = “-1”
    gui_video_out_pos_y = “-1”
    idle = “yes”
    gui_skin = “default”
    stopxscreensaver = “yes”
    cdrom_device = “/dev/cdrom”
    dvd_device = “/dev/dvd”
    osd_level = “1”
    vo_driver = “gl2”
    v_vfm = “ffmpeg”
    vf_autoq = “0”
    vo_direct_render = “yes”
    vo_doublebuffering = “yes”
    vo_panscan = “0.000000”
    v_flip = “-1”
    v_framedrop = “0”
    v_idx = “-1”
    v_ni = “no”
    ao_driver = “alsa”
    a_afm = “ffmpeg”
    softvol = “no”
    sub_auto_load = “yes”
    sub_overlap = “no”
    sub_pos = “100”
    sub_unicode = “no”
    font_factor = “0.750000”
    font_name = “Sans”
    font_text_scale = “3.000000”
    font_osd_scale = “4.000000”
    font_blur = “2.000000”
    font_outline = “2.000000”
    font_autoscale = “3”
    ass_enabled = “no”
    ass_use_margins = “no”
    ass_top_margin = “0”
    ass_bottom_margin = “0”

    alla fine trovi l’opzione gl2 ecc ecc, il problema adesso è inserirli nelò tuo file config

  16. Ci provo subito e ti faccio sapere. Grazie per la tua pazienza e il tuo aiuto. A me si chiama mplayer.conf

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *