我找不到一种方法在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发布于 2017-10-31 21:47:36
我最终以不同的顺序组合了Wondershare中的视频。这对存储并不友好,因为我基本上有几个视频副本,但我可以从几个命令中选择一个开始播放,并将其设置为循环,从而实现了我的大部分目标。
循环代码(比上面的代码简单得多):omxplayer -o local --loop /home/pi/video.mp4
https://stackoverflow.com/questions/45023727
复制相似问题