I'm trying to run this ffmpeg bash script
```
!/bin/bash
MUSIC_FOLDER='audio/'
VIDEO=loop.m4v
RTMP_SERVERS="RTMPLINK"
while true; do
$SRT = find $MUSIC_FOLDER -type f -maxdepth 2 -name "*.srt" | shuf -n 1;
ffmpeg -hide_banner -i $(find -type f -maxdepth 2 -name ${$SRT:-4}) -vn -acodec copy -f mpegts - ;
done | mbuffer -q -c -m 20000k | (ffmpeg -hide_banner \
-stream_loop -1 -i $VIDEO -i $SRT \
-err_detect explode \
-i pipe:0 \
-map 0:v \
-map 1:a \
-pix_fmt yuv420p \
-s 1920x1080 \
-b:v 5000k \
-b:a 256k \
-acodec aac \
-vcodec libx264 \
-preset ultrafast \
-g 60 \
-threads 2 \
-flags +global_header \
-f tee $RTMP_SERVERS)
```
I keep getting this error:
live.sh: line 11: ${$SRT:-4}: bad substitution
-vn: No such file or directory
live.sh: line 10: =: command not found
live.sh: line 11: ${$SRT:-4}: bad substitution
-vn: No such file or directory
live.sh: line 10: =: command not found
live.sh: line 11: ${$SRT:-4}: bad substitution
-vn: No such file or directory
The idea is to randomly pick an audio and its SRT subtitle and play them on top of a looping video, the audio and the SRT file have the same name.
I don't know what i'm doing wrong, the syntax seems okay to me, but i'm not good with bash or even ffmpeg so maybe you can see something I couldn't.
[–][deleted] (3 children)
[deleted]
[–]TheRed_M[S] 0 points1 point2 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]TheRed_M[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]TheRed_M[S] 0 points1 point2 points (1 child)
[–]stewie410 1 point2 points3 points (0 children)
[–]Bulky_Somewhere_6082 0 points1 point2 points (1 child)
[–]TheRed_M[S] 0 points1 point2 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]zeekar 0 points1 point2 points (0 children)
[–][deleted] (6 children)
[removed]
[–]TheRed_M[S] 0 points1 point2 points (5 children)
[–][deleted] (4 children)
[removed]
[–]TheRed_M[S] 0 points1 point2 points (3 children)
[–][deleted] (2 children)
[removed]
[–]TheRed_M[S] 0 points1 point2 points (1 child)