1

この投稿の好意により、次の bash スクリプトがあります。

#!/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"

# 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

omxplayer の呼び出しを全画面表示に変更し、サウンドを出力しました。

omxplayer -r -o hdmi $entry > /dev/null

しかし、私の好みの設定に変更する前でも、スクリプトはフォルダ内の最初のビデオを再生するだけで、無限にループします。ビデオの許可を確認しましたが、スクリプトを実行するユーザーがすべて同じ所有者です。

4

1 に答える 1

1

そのスクリプトは間違っています。私はそれにいくつかの更新を加えました。それがあなたのために働くかどうか見てください

#!/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
于 2013-05-10T17:29:15.677 に答える