move sleep before starting of ffmpeg

This commit is contained in:
deflax 2025-04-21 23:52:29 +03:00
parent 59ce841742
commit fa300b030f

View file

@ -8,8 +8,7 @@ FFMPEG_LOGLEVEL="repeat+level+info"
mkdir -p ./rec/
cleanup()
{
cleanup() {
adb_pid=$(ps aux | grep 'adb' | grep ${android} | awk '{print $2}');
echo "] Killing adb services with pid=${adb_pid}"
kill -9 ${adb_pid}
@ -28,7 +27,7 @@ else
exit 1
fi
is_correct_port () {
is_correct_port() {
# check if port 5555 is open
PORT=$(nmap -sT -P0 ${android} -p 5555 | awk -F/ '/tcp open/{print $1}')
if [[ $PORT == 5555 ]]; then
@ -70,6 +69,7 @@ scrcpy -n \
while :
do
sleep 5
CURRENTDATE=`date +"%Y_%m_%d_%T"`
echo "] ffmpeg start at ${CURRENTDATE}"
@ -91,6 +91,5 @@ do
#CURRENTDATE=`date +"%Y_%m_%d_%T"`
echo "] ffmpeg end at ${CURRENTDATE}"
sleep 5
done