0
我一直在一個項目中播放一個文件夾中的所有視頻。它工作的很好,但我需要視頻路徑根據定期更改的輸入更改CRON。我希望它在輸入更改後立即更改視頻通道,但不要直到當前視頻結束,但不播放當前視頻通道中的其餘視頻。Raspbery Pi - 循環視頻omxplayer
這裏是文件夾中播放所有視頻代碼:
#!/bin/sh
# get rid of the cursor so we don't see it when videos are running
setterm -cursor off
# set here the path to the directory containing your videos
VIDEOPATH="/mnt/storage/videos"
# you can normally leave this alone
SERVICE="omxplayer"
for entry in $VIDEOPATH/*
do
clear
$SERVICE $entry > /dev/null
while ps ax | grep -v grep | grep $SERVICE > /dev/null
do
sleep 5;
done
done
一個很好的答案將非常感激,謝謝!