Files
buildroot/board/miyoo/main/apps/ffmpeg/ffplay_launch.sh
Apaczer 02627752b2 [PACKAGE/BOARD] add ST_SDL package & update scripts (#54)
* [PACKAGE] add ST_SDL for terminal emulation
* [BOARD] rm 3-party `st` app & update scripts
2023-11-21 15:55:44 +01:00

13 lines
556 B
Bash

#!/bin/sh
if ffprobe -v error -select_streams v:0 -show_entries stream=codec_type "$1" | grep -q "video"; then
ffplay -autoexit -i "$1"
elif ffprobe -v error -select_streams a:0 -show_entries stream=codec_type "$1" | grep -q "audio"; then
ffplay -nodisp -autoexit -i "$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"
fi