Folgende Warnungen sind aufgetreten:
Warning [2] Undefined variable $unreadreports - Line: 34 - File: global.php(961) : eval()'d code PHP 8.2.2 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/global.php(961) : eval()'d code 34 errorHandler->error_callback
/global.php 961 eval
/printthread.php 16 require_once



RasPiCar Projekt Forum
Start Video Fix (jede Auflösung) - Druckversion

+- RasPiCar Projekt Forum (https://RasPiCarProjekt.de)
+-- Forum: Software (https://RasPiCarProjekt.de/forumdisplay.php?fid=4)
+--- Forum: Programmierung (https://RasPiCarProjekt.de/forumdisplay.php?fid=18)
+--- Thema: Start Video Fix (jede Auflösung) (/showthread.php?tid=1175)



Start Video Fix (jede Auflösung) - cbrauweiler - 15.11.2017

Ich habe das initd Script "asplashscreen" angepasst damit das Start Video mit jeder Auflösung passend dargestellt wird.
Getestet habe ich das mit dem Offiziellen 7" Touch bei 800x480 und mit einem Dell TFT bei 1920x1080.

Das initd Script liegt hier: /etc/init.d/asplashscreen

Hinzugekommen ist folgender Code vor der Zeile "do_start":
Code:
DIMENSIONS=$(fbset -s)
DIMENSIONS=$(echo $DIMENSIONS | cut -d" " -f2)
DIMENSIONS=$(echo $DIMENSIONS | cut -d"\"" -f2)
WIDTH=$(echo $DIMENSIONS | cut -d"x" -f1)
let "WIDTH = $WIDTH - 1"
HEIGHT=$(echo $DIMENSIONS | cut -d"x" -f2)
let "HEIGHT = $HEIGHT - 1"

Und beim omxplayer Aufruf wird die Bildschirmauflösung bei dem 3. und 4. Wert durch $WIDTH $HEIGHT ersetzt.

Das ganze Script sieht dann wie folgt aus:
Code:
#! /bin/sh
### BEGIN INIT INFO
# Provides:          asplashscreen
# Required-Start: $local_fs
# Required-Stop:
# Should-Start:      
# Default-Start:     S
# Default-Stop:
# Short-Description: Show custom splashscreen
# Description:       Show custom splashscreen
### END INIT INFO

DIMENSIONS=$(fbset -s)
DIMENSIONS=$(echo $DIMENSIONS | cut -d" " -f2)
DIMENSIONS=$(echo $DIMENSIONS | cut -d"\"" -f2)
WIDTH=$(echo $DIMENSIONS | cut -d"x" -f1)
let "WIDTH = $WIDTH - 1"
HEIGHT=$(echo $DIMENSIONS | cut -d"x" -f2)
let "HEIGHT = $HEIGHT - 1"

do_start () {

    omxplayer --win 0,0,$WIDTH,$HEIGHT /opt/carpc/startup/loading_video.mp4 &
    # uncomment the following line to show static boot picture and comment out the line above
    #/usr/bin/fbi -T 1 -noverbose -a /etc/splash.png    
    exit 0
}

case "$1" in
  start|"")
    do_start
    ;;
  restart|reload|force-reload)
    echo "Error: argument '$1' not supported" >&2
    exit 3
    ;;
  stop)
    # No-op
    ;;
  status)
    exit 0
    ;;
  *)
    echo "Usage: asplashscreen [start|stop]" >&2
    exit 3
    ;;
esac

: