1. 程式人生 > >視頻轉碼: linux下用mplayer做視頻轉碼

視頻轉碼: linux下用mplayer做視頻轉碼

視頻轉碼

視頻轉碼器mplayer安裝使用


#!/bin/bash
#1、保證系統可以連到外網,需要下載安裝包和依賴包

set -e

MPlayer="/usr/myapp"

MPVer="MPlayer-1.3.0"

mkdir $MPlayer -pv 
yum install wget gcc git -y
cd /usr/local/src
wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20110131.tar.bz2
wget http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.3.0.tar.gz
echo "export PATH="$PATH:/usr/myapp/ffmpeg/bin"" >> /etc/profile
source /etc/profile
tar xf all-20110131.tar.bz2
tar xf MPlayer-1.3.0.tar.gz

mv /usr/local/src/all-20110131 /usr/local/lib/codecs

cd /usr/local/src/$MPVer

./configure --prefix=$MPlayer/mplayer --codecsdir=/usr/local/lib/codecs && make && make install

if [[ $? == 0 ]];then
    cd $MPlayer/mplayer/bin && ls
    echo -e "\033[31m Usage:\n\t  路徑:/usr/myapp/mplayer/bin/ \033[0m"
    echo -e "\033[31m Usage:\n\t  mencoder 1.rmvb -o output.avi -oac mp3lame -lameopts cbr:br=32 -ovc x264 -x264encopts bitrate=440 -vf scale=448:-3 \033[0m"

    echo "export PATH="$PATH:/usr/myapp/mplayer/bin"" >> /etc/profile
    source /etc/profile
    #mencoder 1.rmvb -o output.avi -oac mp3lame -lameopts cbr:br=32 -ovc x264 -x264encopts bitrate=440 -vf scale=448:-3
else
    break
fi

視頻轉碼: linux下用mplayer做視頻轉碼