move rtmp-stream.sh to PATH /bin

This commit is contained in:
Alfonso Gamboa 2022-06-01 00:59:46 -07:00
parent e22e9e93a0
commit 3fb2f409c5
2 changed files with 23 additions and 13 deletions

View File

@ -1,5 +1,7 @@
#! /bin/sh #! /bin/sh
RTMP_LOG=/opt/wz_mini/log/rtmp.log
source /opt/wz_mini/wz_mini.conf source /opt/wz_mini/wz_mini.conf
if [[ "$RTSP_PASSWORD" == "" ]]; then if [[ "$RTSP_PASSWORD" == "" ]]; then
@ -26,37 +28,45 @@ FACEBOOK_KEY=""
RTSP_STREAM="video1_unicast" RTSP_STREAM="video1_unicast"
VIDEO_SOURCE="rtsp://"$RTSP_LOGIN":"$RTSP_PASSWORD"@0.0.0.0:"$RTSP_PORT"/$RTSP_STREAM" VIDEO_SOURCE="rtsp://"$RTSP_LOGIN":"$RTSP_PASSWORD"@0.0.0.0:"$RTSP_PORT"/$RTSP_STREAM"
AUDIO="-c:a libfdk_aac -afterburner 1 -channels 1 -b:a 256k -profile:a aac_he -ar 16000 -strict experimental"
AUDIO_OPTIONS="-c:a libfdk_aac -afterburner 1 -channels 1 -b:a 256k -profile:a aac_he -ar 16000 -strict experimental"
VIDEO_OPTIONS="-c:v copy -coder 1 -pix_fmt yuv420p -g 30 -bf 0"
if [[ "$2" == "no_audio" ]]; then if [[ "$2" == "no_audio" ]]; then
echo NOAUDIO echo "NO_AUDIO: audio disabled on RTMP Stream."
AUDIO="-an" AUDIO="-an"
fi fi
if [[ "$1" == "youtube" ]]; then if [[ "$1" == "youtube" ]]; then
echo "youtube" echo "RTMP Streaming to: YouTube"
STREAM_PROVIDER="$YOUTUBE_URL" STREAM_PROVIDER="$YOUTUBE_URL"
KEY="$YOUTUBE_KEY" KEY="$YOUTUBE_KEY"
elif [[ "$1" == "twitch" ]]; then elif [[ "$1" == "twitch" ]]; then
echo "twitch" echo "RTMP Streaming to: twitch"
STREAM_PROVIDER="$TWITCH_URL" STREAM_PROVIDER="$TWITCH_URL"
KEY="$TWITCH_KEY" KEY="$TWITCH_KEY"
elif [[ "$1" == "facebook" ]]; then elif [[ "$1" == "facebook" ]]; then
echo "facebook" echo "RTMP Streaming to: facebook"
STREAM_PROVIDER="$FACEBOOK_URL" STREAM_PROVIDER="$FACEBOOK_URL"
KEY="$FACEBOOK_KEY" KEY="$FACEBOOK_KEY"
else else
echo "Usage:" echo "Usage: rtmp-stream.sh <service> <no_audio>"
echo "rtmp facebook" echo ""
echo "rtmp twitch" echo "Available services:"
echo "rtmp youtube" echo "rtmp-stream.sh facebook"
echo "Update the script with your stream keys first" echo "rtmp-stream.sh twitch"
echo "rtmp-stream.sh youtube"
echo "rtmp-stream.sh <service> no_audio disables audio"
echo ""
echo "Update the script with your stream keys first."
exit 0 exit 0
fi fi
sync;echo 3 > /proc/sys/vm/drop_caches sync;echo 3 > /proc/sys/vm/drop_caches
echo "LOG FILE: $RTMP_LOG"
$FFMPEG_BINARY \ $FFMPEG_BINARY \
-rtsp_transport udp -y \ -rtsp_transport udp -y \
-i "$VIDEO_SOURCE" \ -i "$VIDEO_SOURCE" \
-c:v copy -coder 1 -pix_fmt yuv420p -g 30 -bf 0 $AUDIO -aspect 16:9 -f flv "$STREAM_PROVIDER/$KEY" $VIDEO_OPTIONS $AUDIO_OPTIONS -aspect 16:9 -f flv "$STREAM_PROVIDER/$KEY" > $RTMP_LOG 2>&1 &

View File

@ -46,6 +46,7 @@ e37474a12d76cae16336476cba61e8b8 SD_ROOT/wz_mini/bin/neofetch
7fcc716cda1e024dae1045050a135beb SD_ROOT/wz_mini/bin/audioplay_t31 7fcc716cda1e024dae1045050a135beb SD_ROOT/wz_mini/bin/audioplay_t31
e6a6a9dd8ce138686083a3d4303cea40 SD_ROOT/wz_mini/bin/iperf3 e6a6a9dd8ce138686083a3d4303cea40 SD_ROOT/wz_mini/bin/iperf3
0468ffb319707687557353242a518923 SD_ROOT/wz_mini/bin/wg 0468ffb319707687557353242a518923 SD_ROOT/wz_mini/bin/wg
ec21fd00e936a28ea470911a871cf794 SD_ROOT/wz_mini/bin/rtmp-stream.sh
5d1359af0c7c5d326b8682a62f910620 SD_ROOT/wz_mini/bin/strace 5d1359af0c7c5d326b8682a62f910620 SD_ROOT/wz_mini/bin/strace
516118bfcc0f0ddc93fb9339b3c6a315 SD_ROOT/wz_mini/bin/xtables-multi 516118bfcc0f0ddc93fb9339b3c6a315 SD_ROOT/wz_mini/bin/xtables-multi
097cd91a56f2b0caea1dd87ae0e51a54 SD_ROOT/wz_mini/bin/screen 097cd91a56f2b0caea1dd87ae0e51a54 SD_ROOT/wz_mini/bin/screen
@ -68,7 +69,6 @@ cf049b9446094cc8a7e07a33cf91c4a8 SD_ROOT/wz_mini/usr/bin/watch_up.sh
b339aee882a5d1c943ad08e4282ec3fd SD_ROOT/wz_mini/usr/bin/iCamera-dbg b339aee882a5d1c943ad08e4282ec3fd SD_ROOT/wz_mini/usr/bin/iCamera-dbg
20b061689308b2cee7edf3b9b906bca7 SD_ROOT/wz_mini/usr/bin/ucamera 20b061689308b2cee7edf3b9b906bca7 SD_ROOT/wz_mini/usr/bin/ucamera
69d727b25bbd22fb61f1cc0b5a063acb SD_ROOT/wz_mini/usr/bin/upgrade-run.sh 69d727b25bbd22fb61f1cc0b5a063acb SD_ROOT/wz_mini/usr/bin/upgrade-run.sh
47f88eecbd49de573335028dc72dab3e SD_ROOT/wz_mini/usr/bin/rtmp-stream.sh
4c780f0455481d106d47d89f0ae04ed5 SD_ROOT/wz_mini/lib/uClibc.tar 4c780f0455481d106d47d89f0ae04ed5 SD_ROOT/wz_mini/lib/uClibc.tar
9afeb088e4cbabbe0b04033b560204d0 SD_ROOT/wz_mini/lib/libimp.so 9afeb088e4cbabbe0b04033b560204d0 SD_ROOT/wz_mini/lib/libimp.so
4100755cb6cc6e3b76da20c7e3690e16 SD_ROOT/wz_mini/lib/libalog.so 4100755cb6cc6e3b76da20c7e3690e16 SD_ROOT/wz_mini/lib/libalog.so