Keep and carry on.
post @ 2024-08-01

1.preparation install dependencies

1
yum install -y gcc g++ cmake gcc-c++ 

2.install and compile x264

if you haven’t installed the bzip2, you can run the code “sudo yum install bzip2“ to install it before decompression.

1
2
3
4
5
6
7
8
9
10
11
wget https://code.videolan.org/videolan/x264/-/archive/master/x264-master.tar.bz2

tar -jxvf x264-master.tar.bz2

cd ./x264-master

make clean && make uninstall

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure --enable-shared

make -j4 && make install  

3.install and compile x265

1
2
3
4
5
6
7
8
9
wget https://anduin.linuxfromscratch.org/BLFS/x265/x265_3.4.tar.gz

tar -zxvf x265_3.4.tar.gz

cd x265_3.4/source

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/x265

make install

4.download source code of ffmpeg, and install it

1
2
3
4
5
6
7
8
9
wget https://ffmpeg.org/releases/ffmpeg-4.2.3.tar.bz2

tar -jxvf ffmpeg-4.2.3.tar.bz2

cd ffmpeg-4.2.3

./configure --prefix=/usr/local/ffmpeg --enable-shared --disable-w32threads --enable-pthreads --enable-gpl --enable-libx264 --enable-libx265 --enable-nonfree

make && make install

5.view install log \configure x265

1
2
3
4
5
6
export PKG_CONFIG_PATH=/usr/local/x265/lib/pkgconfig

or add it in /etc/profile:

export PKG_CONFIG_PATH=/usr/local/x264/lib/pkgconfig/
export PKG_CONFIG_PATH=/usr/local/x265/lib/pkgconfig:$PKG_CONFIG_PATH

6.edit /etc/ld.so.config

1
2
3
4
5
6
include ld.so.conf.d/*.conf

#add the following content
/usr/local/ffmpeg/lib/ #ffmpeg installation path
/usr/local/lib #other installation path,if you didn't select path, when installing x264. this is default path.
/usr/local/x265/lib/ #Installation path for x265
Read More
post @ 2024-08-01

1.check installed cmake version

1
cmake -version

2.create a new dir and enter it

1
2
3
mkdir /opt/cmake

cd /opt/cmake/

3.get install package

1
wget https://cmake.org/files/v3.26/cmake-3.26.4.tar.gz

4.decompression

1
tar -xzvf cmake-3.26.4.tar.gz

5.enter cmake-3.26.4 folder

1
cd cmake-3.26.4

6.configure install path

1
./configure --prefix=/usr/local/cmake

7.install cmake

1
make && make install
1
ln -s /usr/local/cmake/bin/cmake /usr/bin/cmake
Read More

1.install ZLMediaKit

1.1update YUM

1
sudo yum update

1.2install GIT

1
sudo yum install git

1.3download source code of ZLMediaKit

1
2
3
git clone --depth 1 https://gitee.com/xia-chu/ZLMediaKit
cd ZLMediaKit
git submodule update --init

1.4install dependencies

1
2
sudo yum -y install gcc
sudo yum -y install gcc-c++

1.5 isntall cmake

ZLMediaKit use cmake to Build,Makefile(or Xcode/VS project)can only be generated through cmake,so it is necessary to install cmake first to complete the subsequent steps.

1
2
3
4
5
6
sudo yum install cmake
sudo yum install libssl-dev
sudo yum install libsdl-dev
sudo yum install libavcodec-dev
sudo yum install libavutil-dev
sudo yum install ffmpeg

1.6Build and compile projects

1
2
3
4
5
6
cd ZLMediaKit
mkdir build
cd build
DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2j/
cmake ..
make -j4

2.install WVP-PRO

Read More

1.Deployment Mysql5.7.44

1.1.Install .netFreamWork4.5.2(The specified version cannot installed in other versions)

https://dotnet.microsoft.com/zh-cn/download/dotnet-framework/net452

1.2.Install Windows 2008 R2 Service Pack 1

https://www.catalog.update.microsoft.com/Search.aspx?q=KB976932

1.3.Manually installing VC2019C++, it’s recommended to install the 2015-2019 collection, as direct installation is will to fail.

1.4.Normal installation of mysql5.7.44

2.Deployment Nginx

2.1.Download Nginx
http://nginx.org/en/download.html

upload successful

2.2.Unzip of download files

2.3.Run nginx.exe

2.4.configure nginx.conf

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
worker_processes  1;

events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;

sendfile on;

keepalive_timeout 65;

# my application cms
upstream cms {
server localhost:8080;
}

# file preview server
upstream filePreview{
server localhost:8012;
}

server {
listen 80;
server_name localhost;

location / {
proxy_pass http://cms/;
root ../cms/html/web;
index index.html index.htm;
}


location /mg/ {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://cms/mg/;
}

location /filePreview/ {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://filePreview/filePreview/;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

}

}
Read More
post @ 2023-12-08

数据量过大,使用saveBatch保存数据太慢如何解决:
在使用mybatis-plus的saveBatch方法时发现保存太慢,会生成一大堆的insert,而不是一批一批的,影响因素可能有两个,如下:

  1. mybatis-plus使用saveBatch的时候,需要保证字段不为null,如果可能为null的话,在可以在注解上增加忽略

@TableField(value = “manager_name”,insertStrategy = FieldStrategy.IGNORED)
private String managerName;
这样能保证saveBatch的时候只会有一个insert(当然这也取决于你用的批次大小,默认为1000一次insert)

如果没有特别要求,可以设置全局配置来保障,实际中使用批量保存的其实就特定表,也不是特别建议使用全局的配置,把可能的字段添加忽略就行了。

mybatis-plus:
global-config:
db-config:
insert-strategy: ignored
修改完毕后,insert应该是一批一个insert,而不是一堆

Mybatis-Plus saveBatch() 批量保存失效

  1. 如果已经是一批一个insert以后,还是慢,则需要修改数据库链接,需要在数据库链接后面增加

rewriteBatchedStatements=true
这样在调用saveBatch的时候时间能得到有效提升

解释:rewriteBatchedStatements=true
MySQL的JDBC连接的url中要加rewriteBatchedStatements参数,并保证5.1.13以上版本的驱动,才能实现高性能的批量插入。
MySQL JDBC驱动在默认情况下会无视executeBatch()语句,把我们期望批量执行的一组sql语句拆散,一条一条地发给MySQL数据库,批量插入实际上是单条插入,直接造成较低的性能。
只有把rewriteBatchedStatements参数置为true, 驱动才会帮你批量执行SQL
另外这个选项对INSERT/UPDATE/DELETE都有效

Read More
post @ 2023-10-23

Hello!

This is my first article!

Read More
post @ 2023-10-23

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

Read More
⬆︎TOP