[+] Docker

This commit is contained in:
acgist
2023-05-23 19:56:16 +08:00
parent 3cf25a1736
commit 1d8507862b
5 changed files with 101 additions and 11 deletions

View File

@@ -6,16 +6,17 @@ base=${bin%/*}
cd $base
echo "启动目录:$base"
# Java运行环境
JAVA=$(which java)
if [ -z "$JAVA" ] ; then
echo "必须安装${java.version}+JDK"
exit 1
fi
# 结束任务
if [ ! -f "/.dockerenv" ]; then
sh bin/stop.sh
# Java运行环境
JAVA=$(which java)
if [ -z "$JAVA" ] ; then
echo "必须安装${java.version}+JDK"
exit 1
fi
bash bin/stop.sh
else
JAVA="java"
fi
# 启动参数
@@ -38,7 +39,7 @@ fi
# 等待任务
if [ ! -f "/.dockerenv" ]; then
sh bin/wait.sh
bash bin/wait.sh
else
echo -e "\033[32m启动成功${project.artifactId}-${project.version}\033[0m"
fi

View File

@@ -6,6 +6,7 @@ sleep 1
# 等待任务
startTime=$(date +%s)
processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}')
processPortNumber=0
if [ ! -z "$processId" ]; then
waitIndex=0
processPortNumber=$(netstat -anop | grep $processId | grep LISTEN | wc -l)
@@ -23,9 +24,9 @@ if [ ! -z "$processId" ]; then
done
echo ""
fi
if [ "$processPortNumber" -lt 1 ]; then
if [ $processPortNumber -lt 1 ]; then
echo -e "\033[31m启动失败${project.artifactId}-${project.version}\033[0m"
sh bin/stop.sh
bash bin/stop.sh
exit 0
else
finishTime=$(date +%s)

View File

@@ -89,6 +89,13 @@ public class RtpTest {
// ffmpeg不支持rtcpMux
// ffmpeg -re -i video.mp4 -c:v libvpx -map 0:0 -f tee "[select=v:f=rtp:ssrc=123123:payload_type=102]rtp://192.168.1.110:40793?rtcpport=47218"
// ffmpeg -re -i video.mp4 -c:v vp8 -map 0:0 -f tee "[select=v:f=rtp:ssrc=123123:payload_type=102]rtp://192.168.1.110:40793?rtcpport=47218"
// 音频视频同时传输
// ffmpeg -re -i video.mp4 -c:v copy -an -f rtp rtp://192.168.8.122:6666 -c:a copy -vn -f rtp rtp://192.168.8.122:7777 -sdp_file taoyao.sdp
// ffplay -protocol_whitelist "file,rtp,udp" -i taoyao.sdp
// ffmpeg -protocol_whitelist "file,rtp,udp" -i taoyao.sdp taoyao.mp4
// 混音
// ffmpeg -re -i video.mp4 -i music.mp3 -map 0 -vn -c:a copy -f rtp rtp://192.168.8.122:6666 -map 0 -an -c:v copy -f rtp rtp://192.168.8.122:7777 -map 1 -c:a aac -f rtp rtp://192.168.8.122:8888 -sdp_file taoyao.sdp
// ffmpeg -protocol_whitelist "file,rtp,udp" -i taoyao.sdp -filter_complex "[0:0]aresample=8000[a0];[0:2]aresample=8000[a2];[a0][a2]amix=inputs=2" taoyao.mp4
final Scanner scanner = new Scanner(System.in);
do {
if(StringUtils.isEmpty(line)) {