PACKAGE/BOARD: for ffplay correct PGDOWN/PGUP bindings & launch in fullscreen. (#101)

* PACKAGE-ffmpeg: correct 0003-ffplay-custom-sdlk.patch

* BOARD: launch `ffplay` in fullscreen mode and be less verbose
This commit is contained in:
Apaczer
2024-04-23 21:04:14 +02:00
committed by GitHub
parent 2aff31eaba
commit b830774f6f
2 changed files with 72 additions and 5 deletions

View File

@@ -1,12 +1,21 @@
#!/bin/sh
ffplay_video_func() {
ffplay -fs -autoexit -hide_banner -loglevel warning -i "$1"
}
ffplay_audio_func() {
ffplay -fs -autoexit -hide_banner -loglevel warning -showmode 1 -i "$1"
}
if ffprobe -v error -select_streams v:0 -show_entries stream=codec_type "$1" | grep -q "video"; then
ffplay -autoexit -i "$1"
echo "Found video format, launching FFPLAY..."
ffplay_video_func "$1"
elif ffprobe -v error -select_streams a:0 -show_entries stream=codec_type "$1" | grep -q "audio"; then
ffplay -nodisp -autoexit -i "$1"
echo "Found audio format, launching FFPLAY..."
ffplay_audio_func "$1"
else
echo -en "Invalid video/audio format!"
# We're using SDL terminal to display above echo msg
## because all stdout is parsed to /dev/null from gmenu2x and it's child ps
st -k -e "/bin/sh" "-c" "echo -e \"\n\n\n\n\n\n Invalid video or audio format!\"; sleep 2"
st -k -e "/bin/sh" "-c" "echo -e \"\n\n\n\n\n\n Invalid video or audio format!\"; read -t 2"
fi