18 Apr 2018, 12:58

Hallo zusammen,

ich habe folgendes Problem. Ich habe ein längeres Recalbox-Intro das ich einfügen möchte (26 Sek.).
(Bevor Fragen vom Support kommen, ja es ist ein Recalbox Zeichen groß im Intro zu sehen, ich mache hier kein rebranding!)

Ich benutze die Aktuelle Recalbox Version für Odroid XU4!

Hier meine s02splash:

#!/bin/bash

selectVideo() {
IFS='
'
videoList=($(find /recalbox/system/resources/splash -name *.mp4))
videoNumber=${#videoList[*]}
video=${videoList[$((RANDOM%videoNumber))]}
echo "${video}"
}
video="`selectVideo`"

do_ffmpeg_start () {
if ! `which ffplay >/dev/null` || [[ ! -f $video ]] ; then
    return
fi
ffplay_opts="-hide_banner -autoexit"
ffplay_srt="subtitles=/recalbox/system/resources/splash/recalboxintro.srt:force_style='FontName=/usr/share/fonts/dejavu/DejaVuSans-BoldOblique.ttf,Fontsize=10'"
ffplay $ffplay_opts -vf "$ffplay_srt" "$video" >/dev/null 2>&1 &
PID=$!
count=0

while [[ ! -f "/tmp/emulationstation.ready" && ! -e "/var/run/kodi.msg" && $count -lt 200 ]]; do
    sleep 0.1
    ((count++))
done
do_ffmpeg_stop $PID
show_logo
}

do_ffmpeg_stop () {
kill -9 $1
}


do_omx_start ()
{
# odroid xu4 has not omxplayer, make it run this code make it flash
if [[ ! -f $video || ! -f /usr/bin/omxplayer ]]; then
    return
fi

# Initialize dbus session
OMXPLAYER_DBUS_ADDR="/tmp/omxplayerdbus.root"
OMXPLAYER_DBUS_PID="/tmp/omxplayerdbus.root.pid"
exec 5> "$OMXPLAYER_DBUS_ADDR"
exec 6> "$OMXPLAYER_DBUS_PID"
dbus-daemon --fork --print-address 5 --print-pid 6 --session
until [ -s "$OMXPLAYER_DBUS_ADDR" ]; do
    echo "waiting for dbus address to appear" >&2
    sleep .2
done
DBUS_SESSION_BUS_ADDRESS=`cat $OMXPLAYER_DBUS_ADDR`
DBUS_SESSION_BUS_PID=`cat $OMXPLAYER_DBUS_PID`
export DBUS_SESSION_BUS_ADDRESS
export DBUS_SESSION_BUS_PID

# Launch the video
omx_fnt="--font=/usr/share/fonts/dejavu/DejaVuSans-BoldOblique.ttf"
omx_opt="--adev both --no-keys --layer=10000 --aspect-mode=fill"
omx_srt="--no-ghost-box --lines=1 --align=left $omx_fnt --font-size=20 --subtitles=/recalbox/system/resources/splash/recalboxintro.srt"
/usr/bin/omxplayer.bin $omx_opt $omx_srt $video &
PID=$!

# Stop the video when ready
if [[ $? -eq 0 ]]; then
    # Wait for emulationstation or Kodi, but not more than 20 seconds
    count=0
    while [[ ! -f "/tmp/emulationstation.ready" && ! -e "/var/run/kodi.msg" && $count -lt 27 ]]; do
        sleep 1
        ((count++))
    done
     # Finish with a one second fade out.
sleep 27
    audio_fade=1
    video_fade=250
    while [[ $video_fade -gt 0 ]]; do
        sleep .02
        dbus-send --print-reply=literal --session --dest=org.mpris.MediaPlayer2.omxplayer /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Volume double:$audio_fade >/dev/null
        dbus-send --print-reply=literal --session --dest=org.mpris.MediaPlayer2.omxplayer /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.SetAlpha objpath:/not/used int64:$video_fade >/dev/null
        audio_fade=`echo "$audio_fade .02" | awk '{printf "%.2f", $1-$2}'`
        ((video_fade=video_fade-5))
    done
    # Ready flag set or timeout occured; stop video process.
    dbus-send --print-reply=literal --session --dest=org.mpris.MediaPlayer2.omxplayer /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Action int32:15 >/dev/null
fi
}

wait_for_fb () {
# on some sytems, fb0 is not immediatly loaded, so, keep a chance by waiting a bit
N=0
while ! test -e /dev/fb0 -o $N -gt 15
do
    sleep 1
    let N++
done
}

show_logo() {
wait_for_fb
test -e /dev/fb0 && fbv -f -i /recalbox/system/resources/splash/logo-version.png
}

case "$1" in
start)
    if [[ `cat /recalbox/recalbox.arch` == "rpi"* ]] ; then
        ( do_omx_start ; show_logo ) &
    else
        ( wait_for_fb ; do_ffmpeg_start ) &
    fi
    ;;
stop)
   ;;
restart|reload)
   ;;
*)
esac

exit $?

Ich habe es mit Änderungen hier:

while [[ ! -f "/tmp/emulationstation.ready" && ! -e "/var/run/kodi.msg" && $count -lt 27 ]]; do

und auch hier versucht:

# Finish with a one second fade out.
sleep 27

Beides war erfolglos. Das Video bricht nach ca. 7 Sekunden ab und lädt direkt in die ES. Auch der Sound der ES ist dann nicht zu hören. Entferne ich das Video zeigt er ganz normal das recalbox PNG an, lädt ES und ich habe Sound. Auch bei Videos unter 5 Sekunden habe ich kein Problem!

Kann mir bitte jemand sagen was ich noch machen kann um das Abbrechen des Intros zu verhindern?

Mit freundlichen Grüßen:

Thomas