September blog zh-CN "Jiuyue blog" was established on September 15, 2016 (named Jiuyue) website: This website is a non-commercial site with no profit nature. It is a personal blog of September. Most of them record life, personal feelings and some technical abstracts, or reprint and share some interesting things. Tue, 03 Aug 2021 20:28:30 +0800 Tue, 03 Aug 2021 20:28:30 +0800 Ffmpeg video watermarking Tue, 03 Aug 2021 20:28:30 +0800 September  ffmpeg_ test.png

{message type = "success" content = "preview video at bottom" /}

Install ffmpeg

Centos 7

 **Install the EPEL release. Because the installation needs to use other repo sources, it needs to be supported by EPEL sudo yum install -y epel-release rpm **If there is a missing code prompt, execute this command sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7  **Import a code sudo rpm --import  **Install the nux dextop source sudo rpm -Uvh 64/nux-dextop-release-0-1.el7.nux.noarch.rpm **Install ffmpeg sudo yum install -y ffmpeg **Check whether ffmpeg is successfully installed, and the version of ffmpeg will be displayed ffmpeg -version

Ffmpeg de watermarking

Generate a frame image of the video

 INFILE=FFmpeg_ music_ mv.mp4 ffmpeg -hide_ banner -ss 3 -y -i "${INFILE}" -f image2 -vframes 1 ${INFILE}.jpg **Ffmpeg-music-mv.mp4 is the video in the current directory **The current directory obtains a frame image ffmpeg-music-mv.mp4.jpg

Get watermark coordinates
reference resources: ffmpeg-watermark-position-extraction-tools

Open web page Upload the image obtained above, and manually move the mask to the watermark position [size] to cover the watermark

Command: area will generate commands (only capture the content of the video for 15 seconds)
ffmpeg -hide_ Banner - loglevel error - Y - I source video name. MP4 - VF delogo = x = 771: y = 20: w = 144: H = 58: Show = 0 - t 15 output name of watermark. Mp4

De watermark
 INFILE=FFmpeg_ music_ Mv.mp4 source video ffmpeg -hide_ banner -loglevel error -y -i FFmpeg_ music_ mv.mp4 -vf delogo=x=771:y=20:w=144:h=58:show=0 -t 15 222.mp4

Complete content removal time parameters: -t 15

 Infile = source video.mp4 ffmpeg -hide_ Banner - loglevel error - Y - I source video. MP4 - VF delogo = x = 240: y = 446: w = 256: H = 114: Show = 0 after processing. Mp4

{dotted startColor="#ff6c6c" endColor="#1989fa"/}

Source video preview:
{dplayer src=" "/}
:: (funny) Video preview to remove watermark:
{dplayer src=" "/}

{mtitle title="END"/}

Linux installing Python Mon, 07 Jun 2021 20:38:00 +0800 September




 tar -xf Python-3.9.5.tgz cd Python-3.9.5

Compile and install

 ./configure && make && make install

Wait patiently...

Check whether the version is installed successfully

 python3 -V

Establishing a soft link

At the end of the compilation, the program is usually installed in the /usr/local/bin lower
If Python - V does not display the version, create a soft link, which takes effect globally
Soft connection

 ln -s /usr/local/bin/python3.9 /usr/bin/python ln -s /usr/local/bin/python3.9-config /usr/bin/python-config

PIP command error

-bash: pip: command not found

Solution (CentOS version)

Download PIP script


Python executes PIP script installation


View PIP version

 pip -V

Uninstall Python 3

 rpm -qa|grep python3|xargs rpm -ev --allmatches --nodeps

Delete all remaining files

 whereis python3 |xargs rm -frv

View an existing installation of Python

 whereis python
It's windy - you can buy hot noodles with coupons Thu, 06 May 2021 21:43:00 +0800 September After the author (who buys spicy strips also uses coupons) to get the copyright, he always feels that there is something missing.

Suddenly heard this song, let me suddenly recall that summer

Think of the past, is also a lot of emotion, but as time goes by

Lossless - the first version of the 18 years of feeling:: (HA HA)

{MP3 name = "lossless - first version" URL=“ You can buy hot pepper with coupons. FLAC "cover =" " theme="#404040" autoplay="autoplay"/}

{cloud title = "download song - windy" type = "default" URL=“ You can buy hot pepper with Coupons - it's windy. FLAC "password] /}

Record enterprise wechat parameters Wed, 14 Apr 2021 15:17:00 +0800 September parameter explain Access method AgentId Application ID Application interface corpsecret Application key Application interface corpid Enterprise ID Bottom of my business touser Member ID / account number @All represents all members of the enterprise media_ id Image media file ID Online access is valid for 3 days

F12 get media_ id

Management tools - Material Library - upload an image - F12 find the image URL. Request the media in the address_ id

Updated down driver Wed, 07 Apr 2021 18:26:00 +0800 September Just download AI software, open the prompt Video: NVIDIA geforce 850, unsupported video driver

According to the repair tips, updated the next driver, perfect solution

NVIDIA driver download

Just search. This is mine

When installing, choose the second one. I don't know how the first one will fail.

After installation, open AI, no prompt, click Help - system compatibility report - no conflict

Before OBS monitor capture, does not display the image, according to the online tutorial operation can not solve

Through this update It's amazing that OBS works

But still need simple settings, desktop right-click NVIDIA panel - manage 3D - program settings - Custom OBS - integrated image

QAQ: window capture chrome does not display
Chrome can turn off the hardware and speed up the restart

Local projects are uploaded to GitHub via GIT Fri, 02 Apr 2021 16:14:00 +0800 September Download git installation
Install it by default, and then open the menu bar git bash

First installation configuration

 #Configure mailbox with the same account name git config --global “Your_github-Username” git config --global “Your_github-email” #View user name mailbox git config git config #You can also view the user's mailbox directly vim ~/.gitconfig : Q exit

Create SSH key
Since the transmission between the local git warehouse and GitHub warehouse is encrypted through SSH, you need to set it up when connecting

First look at your C disk user directory under the. SSH directory Hidden (C: users user name)
If yes, see if there is. SSH Private key ID_ RSA and public key ID_ These two files, if any, will jump to the next step. If not, they will be created by the following command

 ssh-keygen -t rsa -C "your_github-email"

Just go back a few times

GitHub setting SSH key
Login to GitHub New SSH key

title content
Title Fill in as you like, for example, GIT
Key Generated: ID_

Create empty warehouse (for uploading)

Other orders

git rm -r --cached .
Delete all files in the cache (note that if there is a space, if you change. To a file name, you will cancel a file)

Git upload

The remote warehouse is empty

(new warehouse, no readme. MD)

1. CD to the directory to be uploaded (local warehouse)
For example, in the test folder, PWD can view the current location

2. Initialize the local warehouse

 git init

A. Git folder will be created under the current test directory
This means making this folder a git manageable repository, a local repository that git uses to track and manage version libraries

3. Associate remote warehouse

 Git remote add origin GitHub warehouse HTTPS address

4. Add file to cache

 Git add. / / all contents in the current directory Git add user / / specify a file or folder Git status / / view cache file

(note that there is a space in the "." represents the test. All the files in this folder are submitted. You can also submit the specified files through the GIT add file name

5. Submission instructions

 git commit -m 'first commit'

-The quotation mark after M is the comment content submitted this time. If it is not filled in, an error will be reported

6. Upload


 Git branch XXX / / create branch Git branch - A / / view branch Git checkout XXX / / switch branches
 git push -u origin master

The remote warehouse is empty, so the parameter - u should be added to push the cached file to the master branch of GitHub warehouse

Remote warehouse is not empty

(old warehouses, including those without records)

1. Clone remote warehouse (download)

 Git clone warehouse address

2. CD to clone repository
➽ the cloned repository contains a. Git folder, which does not need git init initialization and associated remote repository address

3. Add file to cache

 Git add. / / all contents in the current directory Git add user / / specify a file or folder Git status / / view cache file

4. Submission instructions

 git commit -m 'first commit'

5. Upload

 git push origin master

Delete warehouse file

Local and remote deletion

 Git clone warehouse address //There is something to ignore Git RM file / / will be deleted locally Git RM - R folder / / will be deleted locally Git RM - RF. / / all local files will be deleted Git commit - M 'delete a file' git push origin master

If you do not want to delete the local file, only delete the corresponding part of the cache, add --cached

Delete remote warehouse only

 Git clone warehouse address //There is something to ignore Git RM -- cached file / / will not be deleted locally Git RM - R -- cached folder / / will not be deleted locally Git RM - RF -- cached. / / all local files will not be deleted Git commit - M 'delete a file' git push origin master

Nginx + RTMP live streaming server Thu, 11 Mar 2021 15:50:39 +0800 September

This article is based on the pagoda panel

Uninstall nginx

The configuration of nginx RTMP and nginx is different, and the installation of nginx RTMP is not supported in the pagoda panel

Pre download nginx

 cd /www/server git clone #Git Error installing git: Yum - y install Git

Modify configuration (pay attention to format)

 vim /www/server/panel/install/

Add module: --add-module=/www/server/nginx-rtmp-module

Install nginx (a long time, can cooperate with screen)

 sh /www/server/panel/install/ install 1.18

Create a website and remember the site directory

Modify nginx configuration

Setup configuration modification about 13 lines added

 rtmp { server { Listen 6666; ා change the listening port at will, and remember to square the corresponding port after replacement chunk_size 4000; application hls { live on; hls on; HLS ᦇ path / www / wwwroot /; # here is the live folder path hls_fragment 5s; } } }

Overload, restart nginx

Push flow

Streaming address: rtmp://IP:port/hls

Play address: http://IP/live/ Streaming key.m3u8

The streaming key is set in the streaming client, such as obs

Firewall release port

This paper refers to: 35774849/article/details/106334115

Common commands of docker Fri, 05 Feb 2021 20:25:00 +0800 September Some basic commands are collected on the network

Docker installation:

Container management

View container name

 docker ps -a

Enter the container terminal

 docker exec -it name bash

Export a file of container

{alert type="success"}
Example: container name D, file name, path in / Python /
Export in container d to / root

Execute under root

 docker cp d:/python/ /root


Version query
docker -v

systemctl start docker

Boot up
systemctl enable docker

stop it
systemctl stop docker

systemctl restart docker

View status
systemctl status docker

Docker container directory
cd /var/lib/docker/containers


View all containers ා view all running containers
docker ps -a #docker ps

Stop a container
docker stop containerID

Start a container
docker start containerID

Restart a container
docker restart containerID

Stop all containers
docker stop $(docker ps -a -q)

Delete a container
docker rm containerID
Docker RM - F containerid ා force deletion

Delete all containers
docker rm $(docker ps -a -q)
Docker RM - f $(docker PS - A - Q) ා force deletion


View image
docker images
delete mirror
docker rmi imageID
Delete all mirrors
docker rmi $(docker images -q)

Record the docker installation record Thu, 04 Feb 2021 13:00:00 +0800 September Official one click installation script! Linux system support!
Common commands:

 curl -sSL  | sh curl -fsSL  | bash -s docker --mirror Aliyun #Start systemctl start docker #Self priming systemctl enable docker

Chinese version of portal

Create directory

 mkdir -p /data/portainer/data /data/portainer/public cd /data/portainer



Unzip to public



 docker run -d --restart=always --name portainer -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /data/portainer/data:/data -v /data/portainer/public:/public portainer/portainer:latest

Initialize configuration via IP: 9000


 curl -L `uname -s`-`uname -m` -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose

1.29.1 Is the version number of docker compose. More versions can be referred to

Determine whether the installation is successful

 docker-compose version

Boot up

If you want the docker compose container to start automatically, you need to create a startup script

Create a new one script
The script content is

 docker-compose -f /export/docker/docker-compose-nginx.yml up -d

-f /export/docker/docker-compose-nginx.yml Is the configuration file that specifies docker compose

Put the written script (. SH) in the directory /etc/profile.d/ After the system starts, all shell scripts in the directory will be executed automatically.


 #Query installed packages [root@ ~]# yum list installed | grep docker docker-ce-cli.x86_ 64             1:20.10.2-3.el7                @docker-ce-stable #Uninstall docker-ce-cli.x86_ sixty-four [root@ ~]# yum -y remove docker-ce-cli.x86_ sixty-four

Finally, delete the container image
rm -rf /var/lib/docker

Convert video to character video through Python Mon, 21 Dec 2020 20:11:00 +0800 September {dplayer src=" " /}


  1. Export each frame of the video
  2. Convert each frame of picture into ASCII code
  3. The converted ASCII image is synthesized into video

For Python installation, refer to this article

Libraries to install for Python


 pip3 install opencv-python


 pip3 install pillow

After installing the library, place the video in the PY script folder and modify it video_ path After the parameter for your video path name can be run

 if __ name__ == '__ main__': video_ path = 'video/heiren.mp4' save_ pic_ path = 'cache_ pic' save_ charpic_ path = 'cache_ char'

The default exported video is .avi Format, you can modify about 107 lines of code, such as MP4

 video_ writter= VideoWriter('video/new_char_video.mp4' ,

source code painting

Final explanation

The script does not deal with audio and can be processed by other software.