x264 移植

编译脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

#!/bin/bash
sudo chmod 777 ./* -Rf
path_cur=$(pwd)
# rm -rf x264
build_x264() {
cd x264
sudo make clean
local path="/home/tuling/.FuHan-arm-linux/opt/arm-fullhanv3-linux-uclibcgnueabi-b6/bin"
build_x264=${path_cur}/buildx264
sudo rm -rf $build_x264
sudo mkdir -p $build_x264
./configure \
--prefix=$build_x264 \
--host=arm-fullhanv3-linux-uclibcgnueabi \
--cross-prefix=${path}/arm-fullhanv3-linux-uclibcgnueabi- \
CC=${path}/arm-fullhanv3-linux-uclibcgnueabi-gcc \
--enable-shared \
--disable-static \
--disable-cli
make -j$(nproc)
sudo make install
}

download(){
# git clone https://git.videolan.org/git/x264.git x264
# cd x264
# git checkout stable


# git clone https://code.videolan.org/videolan/x264.git x264
# cd x264

wget https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20171210-2245-stable.tar.bz2
tar -jxvf x264-snapshot-20171210-2245-stable.tar.bz2
sudo chmod 777 ./* -Rf
mv x264-snapshot-20171210-2245-stable x264
rm -rf x264-snapshot-20171210-2245-stable.tar.bz2
cd x264
}


if [ -d "x264" ]; then
echo "x264 exists"
else
download
fi

build_x264

x265 移植

x265的编译脚本:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

#!/bin/bash
sudo chmod 777 ./* -Rf
sudo rm -rf x265
curpath=$(pwd)
buildx265() {
cd x265
git checkout 2.6
sudo apt update
sudo apt install cmake build-essential yasm nasm

sudo apt install cmake-curses-gui
sudo make clean

local path="/home/tuling/.FuHan-arm-linux/opt/arm-fullhanv3-linux-uclibcgnueabi-b6/bin"
build_x265=${curpath}/buildx265
rm -rf $build_x265
sudo mkdir -p $build_x265

set -x
cd ./build/arm-linux
rm crosscompile.cmake
# rm -rf ./*
sudo cp $curpath/crosscompile.cmake ./
pwd
ls -l
# ./make-Makefiles.bash
cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./crosscompile.cmake ../../source && ccmake ../../source
set +x


# cmake -G "Unix Makefiles" \
# -DCMAKE_INSTALL_PREFIX=$build_x265 \
# -DENABLE_SHARED=OFF \
# -DENABLE_STATIC=ON \
# -DENABLE_CLI=OFF \
# -DENABLE_ASSEMBLY=ON \
# ../../source && ccmake../../source

# CC="${path}/arm-fullhanv3-linux-uclibcgnueabi-gcc" \
# CXX="${path}/arm-fullhanv3-linux-uclibcgnueabi-g++" \
# cmake -G "Unix Makefiles" \
# -DCMAKE_INSTALL_PREFIX="$build_x265" \
# -DCMAKE_C_COMPILER=$path/arm-fullhanv3-linux-uclibcgnueabi-gcc \
# -DCMAKE_CXX_COMPILER=$path/arm-fullhanv3-linux-uclibcgnueabi-g++ \
# -DCMAKE_C_FLAGS="-march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard" \
# -DCMAKE_CXX_FLAGS="-march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard" \
# -DENABLE_X86_64=OFF \
# -DENABLE_X86_64=OFF \
# -DENABLE_SSE3=OFF \
# -DENABLE_SSSE3=OFF \
# -DENABLE_SSE4=OFF \
# -DENABLE_ASSEMBLY=OFF \
# ../../source && ccmake ../../source

make -j$(nproc)
sudo make install

}

download(){
git clone https://bitbucket.org/multicoreware/x265_git.git x265
sudo chmod 777 ./* -Rf
cd x265
git checkout 2.6

# wget https://bitbucket.org/multicoreware/x265/downloads/x265_2.6.tar.gz
# tar -xzf x265_2.6.tar.gz
# rm -rf x265_2.6.tar.gz
}

if [ -d "x265" ]; then
echo "x265 exists"
else
download
fi

buildx265