Hello,
Thank you for the script, but I have a problem with the playlist. What should be the format ?
I've put some echo's on the script to try to understand what is the problem, but I can't see the mistake?
When I use the following script named read_playlist.sh
Code: Select all
#!/bin/bash
PLAYER="omxplayer -o hdmi"
PLAYLIST="play.lst"
# Play the playlist if it exists
if [ -e "$PLAYLIST" ]
then
IFS=$'\012'
echo "lecture de la playlist : " "$PLAYLIST"
for file in $(cat "$PLAYLIST")
do
# echo "lecture forcee"
# omxplayer -o hdmi MPEG4_1280x720.mp4
echo "fichier : " "$file"
echo "commande : " $PLAYER "$file"
$PLAYER "$file"
done
fi
when uncommented, the line
Code: Select all
omxplayer -o hdmi MPEG4_1280x720.mp4
is well executed, the video is outpout on HDMI. The command
Code: Select all
echo "commande : " $PLAYER "$file"
returns the line
Code: Select all
commande : omxplayer -o hdmi "MPEG4_1280x720.mp4"
But when the command
$PLAYER "$file"
is executed I have the following error :
Code: Select all
./read_play_list.sh: line 28: omxplayer -o hdmi: command not found
as if omxplayer is not known there (but known 2 lines before).
Do you have any idea ?
For now, my play list "play.lst" only contains the following line :
"MPEG4_1280x720.mp4"
Do you have any idea of what's going wrong. Thanks for your help.