linux下mplayer(ffmpeg)通過x264解碼播放高清h264視頻


系統環境:

Linux inbank-GZ 2.6.24-16-generic #1 SMP Thu Apr 10 13:23:42 UTC 2008 i686 GNU/Linux

Ubuntu 8.04

Genuine Intel(R) CPU   1250  @ 1.73GHz  * 2

1G內存


目標:能用mplayer播放H264格式的高清視頻


  1. 下載相關軟件

    Mplayer1.1版本(包含了ffmpeg)

    各類解碼包codes

    x264

    yasm + faac + faad


可以在這裏下載全部包 http://down.51cto.com/data/1861780



2.編譯相關軟件


  • 解壓all-20110131後將文件拷貝到新建好的/usr/local/lib/codecs目錄

  • 編譯yasm + faac + faad

    ./configure && make && make install

  • 編譯x264

    ./configure --enable-shared && make && make install

  • 編譯mplayer

    chmod 775 -R  MPlayer-1.1.1/

    ./configure --enable-x264 --extra-libs="-lx264 -lfaac"  && make && make install



3.mplayer命令操作


如果是在後臺命令行操作,要先敲命令export DISPLAY=:0.0

然後mplayer -vo x11 -fixed-vo -geometry 0:0 -quiet -slave  -demuxer lavf  fenggu.mpg


4.FAQ


  • 報錯

    vo: couldn't open the X11 display ()!

    要先敲export DISPLAY=:0.0


  • 報錯


    /opt/MPlayer-1.0rc4/libavcodec/libx264.c:305: undefined reference to `x264_encoder_headers'

    collect2: ld returned 1 exit status

    make: *** [mplayer] Error 1


    則要在編譯的時候加入相應的庫 --extra-libs="-lx264 -lfaac"


  • 報錯

    video: cannot read properties

    要加入參數 -demuxer lavf



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章