我找不到在 shell 脚本中使用 omxplayer 以随机“随机播放”顺序播放文件夹中视频的方法。我希望它循环播放“播放列表”,但到目前为止,我只能找到一种方法来循环播放按字母顺序排列的所有文件夹。我将下面的代码版本用于循环。
#!/bin/sh
# get rid of the curso so we don't see it when videos are running
setterm -cursor off
# set here the path to the directory containing your videos
VIDEOPATH="/home/pi/Videos"
# you can normally leave this alone
SERVICE="omxplayer"
# now for our infinite loop!
while true; do
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
sleep 1;
else
for entry in $VIDEOPATH/*
do
clear
omxplayer $entry > /dev/null
done
fi
done
最佳答案
我最终以各种顺序组合了 Wondershare 中的视频。这对存储不友好,因为我基本上有多个视频副本,但我可以从几个命令中选择一个开始播放并将其设置为循环播放,这可以实现我的大部分目标。
循环代码(比上面的代码简单多了):
omxplayer -o local --loop/home/pi/video.mp4
关于linux - omxplayer (raspbian) 在随机播放循环中播放视频文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45023727/