Skip to content

Commit 767b49a

Browse files
committed
3.1.0
1. Add a script for using apt. 2. Modify the readme file.
1 parent 4aaefd6 commit 767b49a

File tree

2 files changed

+46
-5
lines changed

2 files changed

+46
-5
lines changed

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,20 @@ The following instructions are used for building the project on Windows with Vis
2323
git clone --single-branch -b master-linux https://github.com/cainmagi/FFmpeg-Encoder-Decoder-for-Python.git
2424
```
2525

26-
2. Get the shared version of the Linux FFMpeg. We support three different approaches for this step:
26+
2. Install the pre-requisite packages. The following script could be used by ubuntu or debian. If users are using other Linux distribution, they should install `gcc` and `g++` by themselves.
27+
28+
```shell
29+
chmod +rwx ./apt-requirements.sh
30+
./apt-requirements.sh
31+
```
32+
33+
We strongly suggest that users should also install the python dependencies (optional):
34+
35+
```shell
36+
python -m pip install -r requirements.txt
37+
```
38+
39+
3. Get the shared version of the Linux FFMpeg. We support three different approaches for this step:
2740
* Build the shared libs of FFMpeg from the source codes by yourself. We provide [a compiling script :page_with_curl:](https://github.com/cainmagi/FFmpeg-Encoder-Decoder-for-Python/blob/deps/install-ffmpeg-4_4.sh) in the deps branch. You could download and build it by the following commands:
2841

2942
```shell
@@ -51,26 +64,25 @@ The following instructions are used for building the project on Windows with Vis
5164
* The dependencies could be also downloaded by the automatic script, you just need to run
5265

5366
```shell
54-
python -m pip install -r requirements.txt
5567
python webtools.py
5668
```
5769

5870
This script requires users to install `urllib3`. The `tqdm` is also recommended to be installed.
5971

60-
3. Building `mpegCoder` requires `GLIBC>=2.29`. This requirement is not satisfied in some cases. However, if you have built FFMpeg by our script, the requirement would be fulfilled (i.e. you could skip this step). If users are using our pre-built dependencies, users may need to solve this problem by
72+
4. Building `mpegCoder` requires `GLIBC>=2.29`. This requirement is not satisfied in some cases. However, if you have built FFMpeg by our script, the requirement would be fulfilled (i.e. you could skip this step). If users are using our pre-built dependencies, users may need to solve this problem by
6173

6274
```shell
6375
cd FFmpeg-Encoder-Decoder-for-Python
6476
ln -sf ./dependencies/lib-fix/libm-2.31.so /lib/x86_64-linux-gnu/libm.so.6
6577
```
6678

67-
4. Build `mpegCoder` by running the following script. The built file would be stored in `./build`. If you has not fetched the dependencies in the step 2, running the `setup.py` may trigger an event for fetching the online dependencies.
79+
5. Build `mpegCoder` by running the following script. The built file would be stored in `./build`. If you has not fetched the dependencies in the step 2, running the `setup.py` may trigger an event for fetching the online dependencies.
6880

6981
```shell
7082
python setup.py build
7183
```
7284

73-
5. Rename the built module as `mpegCoder.so`, then you could import it in the same directory. If you have built FFMpeg by our script, you do not need any other dependencies when importing the libs. However, if not, you may need to download [the lib dependencies :package:](https://github.com/cainmagi/FFmpeg-Encoder-Decoder-for-Python/releases/download/deps-3.0.0/so-linux-ffmpeg_4_4.tar.xz) and add the `lib` folder to your `LD_LIBRARY_PATH`:
85+
6. Rename the built module as `mpegCoder.so`, then you could import it in the same directory. If you have built FFMpeg by our script, you do not need any other dependencies when importing the libs. However, if not, you may need to download [the lib dependencies :package:](https://github.com/cainmagi/FFmpeg-Encoder-Decoder-for-Python/releases/download/deps-3.0.0/so-linux-ffmpeg_4_4.tar.xz) and add the `lib` folder to your `LD_LIBRARY_PATH`:
7486

7587
```shell
7688
mkdir -p /apps/ffmpeg-4.4

apt-requirements.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# Make bashline configurations.
4+
set -e
5+
RESET='\033[0m'
6+
COLOR='\033[1;32m'
7+
COLOR_ERR='\033[1;31m'
8+
9+
function msg {
10+
echo -e "${COLOR}$(date): $1${RESET}"
11+
}
12+
13+
function msg_err {
14+
echo -e "${COLOR}$(date): $1${RESET}"
15+
}
16+
17+
function fail {
18+
msg_err "Error : $?"
19+
exit 1
20+
}
21+
22+
function mcd {
23+
mkdir -p "$1" || fail
24+
cd "$1" || fail
25+
}
26+
27+
msg "Install gcc and g++."
28+
apt-get update --qq || fail
29+
apt-get -y install gcc g++ || fail

0 commit comments

Comments
 (0)